From 8917f4b12ff4d00895bdb8ec926f1323c8de19b5 Mon Sep 17 00:00:00 2001 From: "reveman@chromium.org" Date: Thu, 5 Jun 2014 16:25:25 +0000 Subject: [PATCH] chrome: Add crash key for discardable memory usage. BUG=372158 Review URL: https://codereview.chromium.org/313683002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275150 0039d316-1c4b-4281-b951-d872f2087c98 --- base/memory/discardable_memory_manager.cc | 6 ++++++ chrome/common/crash_keys.cc | 2 ++ 2 files changed, 8 insertions(+) diff --git a/base/memory/discardable_memory_manager.cc b/base/memory/discardable_memory_manager.cc index 3e90d223a560..49ecc484a7a6 100644 --- a/base/memory/discardable_memory_manager.cc +++ b/base/memory/discardable_memory_manager.cc @@ -7,7 +7,9 @@ #include "base/bind.h" #include "base/containers/hash_tables.h" #include "base/containers/mru_cache.h" +#include "base/debug/crash_logging.h" #include "base/debug/trace_event.h" +#include "base/strings/string_number_conversions.h" #include "base/synchronization/lock.h" namespace base { @@ -213,6 +215,10 @@ void DiscardableMemoryManager::EnforcePolicyWithLockAcquired() { void DiscardableMemoryManager::BytesAllocatedChanged() const { TRACE_COUNTER_ID1("base", "DiscardableMemoryUsage", this, bytes_allocated_); + + static const char kDiscardableMemoryUsageKey[] = "dm-usage"; + base::debug::SetCrashKeyValue(kDiscardableMemoryUsageKey, + Uint64ToString(bytes_allocated_)); } } // namespace internal diff --git a/chrome/common/crash_keys.cc b/chrome/common/crash_keys.cc index 461e9111cd1a..edb6cac4edd3 100644 --- a/chrome/common/crash_keys.cc +++ b/chrome/common/crash_keys.cc @@ -142,6 +142,8 @@ size_t RegisterChromeCrashKeys() { { kGPURenderer, kSmallSize }, #endif + // base/: + { "dm-usage", kSmallSize }, // content/: { "ppapi_path", kMediumSize }, { "subresource_url", kLargeSize }, -- 2.11.4.GIT