Commit c4067793 authored by Benoit Lize's avatar Benoit Lize Committed by Commit Bot

[PartitionAlloc] Record thread cache size in UMA.

When PartitionAlloc is malloc(), the thread cache is used by malloc(),
otherwise by the FastMalloc partition. Record its size in UMA for both
cases.

Bug: 998048
Change-Id: I9072890b76c2c125409ae44e956913ef5bfe26e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2549964Reviewed-by: default avatarssid <ssid@chromium.org>
Reviewed-by: default avatarCaitlin Fischer <caitlinfischer@google.com>
Commit-Queue: Benoit L <lizeb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829606}
parent ba990717
......@@ -8,6 +8,7 @@
#include <string>
#include <utility>
#include "base/allocator/buildflags.h"
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/containers/flat_map.h"
......@@ -208,6 +209,10 @@ const Metric kAllocatorDumpNamesForMetrics[] = {
{"malloc/allocated_objects", "Malloc.AllocatedObjects", MetricSize::kLarge,
kEffectiveSize, EmitTo::kSizeInUkmAndUma,
&Memory_Experimental::SetMalloc_AllocatedObjects},
#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
{"malloc/thread_cache", "Malloc.ThreadCache", MetricSize::kSmall, kSize,
EmitTo::kSizeInUmaOnly, nullptr},
#endif
{"mojo", "NumberOfMojoHandles", MetricSize::kSmall,
MemoryAllocatorDump::kNameObjectCount, EmitTo::kCountsInUkmOnly,
&Memory_Experimental::SetNumberOfMojoHandles},
......@@ -249,6 +254,11 @@ const Metric kAllocatorDumpNamesForMetrics[] = {
"PartitionAlloc.Partitions.FastMalloc", MetricSize::kLarge, kSize,
EmitTo::kSizeInUkmAndUma,
&Memory_Experimental::SetPartitionAlloc_Partitions_FastMalloc},
#if !BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
{"partition_alloc/partitions/fast_malloc/thread_cache",
"PartitionAlloc.Partitions.FastMalloc.ThreadCache", MetricSize::kSmall,
kSize, EmitTo::kSizeInUmaOnly, nullptr},
#endif
{"partition_alloc/partitions/layout", "PartitionAlloc.Partitions.Layout",
MetricSize::kLarge, kSize, EmitTo::kSizeInUkmAndUma,
&Memory_Experimental::SetPartitionAlloc_Partitions_Layout},
......
......@@ -14597,6 +14597,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<suffix name="History" label="Only counting memory used by History service."/>
<suffix name="LevelDatabase"
label="Only counting memory used by Level databases."/>
<suffix name="Malloc.ThreadCache"
label="Memory used by all thread caches, recorded when PartitionAlloc
is used as malloc()."/>
<suffix name="Net"
label="Only counting memory used by Networking sockets and caches."/>
<suffix name="Net.UrlRequestContext"
......@@ -14605,6 +14608,10 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<suffix name="NumberOfNodes" label=""/>
<suffix name="OmniboxSuggestions"
label="Only counting memory used by Omnibox suggestions provider."/>
<suffix name="PartitionAlloc.Partitions.FastMalloc.ThreadCache"
label="Memory used by all thread caches for the FastMalloc partition.
Recorded in blink processes, unless PartitionAlloc is used as
malloc()."/>
<suffix name="SiteStorage.IndexDB"
label="Only counting memory used by IndexedDB API."/>
<suffix name="SiteStorage.LocalStorage"
......
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