Commit e6782025 authored by Sasha McIntosh's avatar Sasha McIntosh Committed by Commit Bot

blink: Cache metrics recording follow-up

Restructure memory dump metrics to avoid double counting memory.

Affected metrics:
  Memory.Experimental.Gpu2.Small.ServiceTransferCache
  Memory.Experimental.Gpu2.Small.ServiceTransferCache.AvgImageSize
  Memory.Experimental.Gpu2.Small.ServiceDiscardableManager
  Memory.Experimental.Gpu2.Small.ServiceDiscardableManager.AvgImageSize

Bug: 963619
Change-Id: Ia1ae23ce99d351807eb1e3f9727882ec2257a153
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1888095Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarssid <ssid@chromium.org>
Reviewed-by: default avatarEric Karl <ericrk@chromium.org>
Commit-Queue: Sasha McIntosh <sashamcintosh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711024}
parent 5a5c98dc
......@@ -102,14 +102,14 @@ const char* const kAllocatorDumpNameWhitelist[] = {
"font_caches/font_platform_data_cache",
"font_caches/shape_caches",
"gpu/discardable_cache/cache_0x?",
"gpu/discardable_cache/avg_image_size/cache_0x?",
"gpu/discardable_cache/cache_0x?/avg_image_size",
"gpu/gl/buffers/context_group_0x?",
"gpu/gl/renderbuffers/context_group_0x?",
"gpu/gl/textures/context_group_0x?",
"gpu/gr_shader_cache/cache_0x?",
"gpu/shared_images/client_0x?",
"gpu/transfer_cache/cache_0x?",
"gpu/transfer_cache/avg_image_size/cache_0x?",
"gpu/transfer_cache/cache_0x?/avg_image_size",
"history/delta_file_service/leveldb_0x?",
"history/usage_reports_buffer/leveldb_0x?",
"java_heap",
......
......@@ -113,9 +113,8 @@ const Metric kAllocatorDumpNamesForMetrics[] = {
EmitTo::kSizeInUkmAndUma, &Memory_Experimental::SetFontCaches},
{"gpu/discardable_cache", "ServiceDiscardableManager", !kLargeMetric, kSize,
EmitTo::kSizeInUmaOnly, nullptr},
{"gpu/discardable_cache/avg_image_size",
"ServiceDiscardableManager.AvgImageSize", !kLargeMetric, kSize,
EmitTo::kSizeInUmaOnly, nullptr},
{"gpu/discardable_cache", "ServiceDiscardableManager.AvgImageSize",
!kLargeMetric, "average_size", EmitTo::kSizeInUmaOnly, nullptr},
{"gpu/gl", "CommandBuffer", kLargeMetric, kEffectiveSize,
EmitTo::kSizeInUkmAndUma, &Memory_Experimental::SetCommandBuffer},
{"gpu/gr_shader_cache", "Gpu.GrShaderCache", !kLargeMetric, kEffectiveSize,
......@@ -124,8 +123,8 @@ const Metric kAllocatorDumpNamesForMetrics[] = {
EmitTo::kIgnored, nullptr},
{"gpu/transfer_cache", "ServiceTransferCache", !kLargeMetric, kSize,
EmitTo::kSizeInUmaOnly, nullptr},
{"gpu/transfer_cache/avg_image_size", "ServiceTransferCache.AvgImageSize",
!kLargeMetric, kSize, EmitTo::kSizeInUmaOnly, nullptr},
{"gpu/transfer_cache", "ServiceTransferCache.AvgImageSize", !kLargeMetric,
"average_size", EmitTo::kSizeInUmaOnly, nullptr},
{"history", "History", !kLargeMetric, kEffectiveSize,
EmitTo::kSizeInUkmAndUma, &Memory_Experimental::SetHistory},
{"java_heap", "JavaHeap", kLargeMetric, kEffectiveSize,
......
......@@ -118,11 +118,8 @@ bool ServiceDiscardableManager::OnMemoryDump(
if (!entries_.empty()) {
MemoryAllocatorDump* dump_avg_size =
pmd->CreateAllocatorDump(base::StringPrintf(
"gpu/discardable_cache/avg_image_size/cache_0x%" PRIXPTR,
reinterpret_cast<uintptr_t>(this)));
dump_avg_size->AddScalar(MemoryAllocatorDump::kNameSize,
MemoryAllocatorDump::kUnitsBytes,
pmd->CreateAllocatorDump(dump_name + "/avg_image_size");
dump_avg_size->AddScalar("average_size", MemoryAllocatorDump::kUnitsBytes,
total_size_ / entries_.size());
}
......
......@@ -326,13 +326,10 @@ bool ServiceTransferCache::OnMemoryDump(
if (total_image_count_ > 0) {
MemoryAllocatorDump* dump_avg_size =
pmd->CreateAllocatorDump(base::StringPrintf(
"gpu/transfer_cache/avg_image_size/cache_0x%" PRIXPTR,
reinterpret_cast<uintptr_t>(this)));
pmd->CreateAllocatorDump(dump_name + "/avg_image_size");
const size_t avg_image_size =
total_image_size_ / (total_image_count_ * 1.0);
dump_avg_size->AddScalar(MemoryAllocatorDump::kNameSize,
MemoryAllocatorDump::kUnitsBytes,
dump_avg_size->AddScalar("average_size", MemoryAllocatorDump::kUnitsBytes,
avg_image_size);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment