Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Unified Diff: components/leveldb_proto/leveldb_database.cc

Issue 2399903004: Add LevelDB database names to tracing path for easier debugging (Closed)
Patch Set: Add missing databases. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/trace_event/memory_infra_background_whitelist.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/leveldb_proto/leveldb_database.cc
diff --git a/components/leveldb_proto/leveldb_database.cc b/components/leveldb_proto/leveldb_database.cc
index 5769710cb170a517364e92289b4e9aa701092aea..753e4cb91156e1ae7205410c28f931880bb8acc4 100644
--- a/components/leveldb_proto/leveldb_database.cc
+++ b/components/leveldb_proto/leveldb_database.cc
@@ -187,16 +187,14 @@ bool LevelDB::OnMemoryDump(const base::trace_event::MemoryDumpArgs& dump_args,
res = base::StringToUint64(value, &size);
DCHECK(res);
+ std::string dump_name = "leveldb/leveldb_proto";
+ if (!client_name_.empty())
+ dump_name += "/" + client_name_;
base::trace_event::MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(
- base::StringPrintf("leveldb/leveldb_proto/0x%" PRIXPTR,
+ base::StringPrintf("%s/0x%" PRIXPTR, dump_name.c_str(),
reinterpret_cast<uintptr_t>(db_.get())));
dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
base::trace_event::MemoryAllocatorDump::kUnitsBytes, size);
- if (!client_name_.empty() &&
- dump_args.level_of_detail !=
- base::trace_event::MemoryDumpLevelOfDetail::BACKGROUND) {
- dump->AddString("client_name", "", client_name_);
- }
// Memory is allocated from system allocator (malloc).
const char* system_allocator_pool_name =
« no previous file with comments | « base/trace_event/memory_infra_background_whitelist.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698