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

Unified Diff: base/trace_event/memory_allocator_dump_guid.h

Issue 1173263004: [tracing] Send unique tracing process id for cross-process memory dumps identification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 6 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
Index: base/trace_event/memory_allocator_dump_guid.h
diff --git a/base/trace_event/memory_allocator_dump_guid.h b/base/trace_event/memory_allocator_dump_guid.h
index 634ca8133b53200ecc7bc9cfa9300642ed8ecebc..51958e0f3a59a708e4a731938082930160c728d6 100644
--- a/base/trace_event/memory_allocator_dump_guid.h
+++ b/base/trace_event/memory_allocator_dump_guid.h
@@ -15,14 +15,24 @@ namespace trace_event {
class BASE_EXPORT MemoryAllocatorDumpGuid {
public:
+ static const int kInvalidChildProcessId = -1;
+
MemoryAllocatorDumpGuid();
explicit MemoryAllocatorDumpGuid(uint64 guid);
// Utility ctor to hash a GUID if the caller prefers a string. The caller
- // still has to ensure that |guid_str| is unique, per snapshot, within the
- // global scope of all the traced processes.
+ // can insert "$$" in the string and it will be replaced by the unique child
+ // process id for creating cross-process unique guid. Otherwise the caller
+ // has to ensure that |guid_str| is unique, per snapshot, within the global
+ // scope of all the traced processes.
+ // NOTE: In single process mode or when tracing is not enabled the "$$" does
+ // not get replaced and the caller has to set the id.
explicit MemoryAllocatorDumpGuid(const std::string& guid_str);
+ // Sets the unique id of the child process for creating cross process unique
+ // guids. Pass kInvalidChildProcessId for invalidating the id.
+ static void SetUniqueChildProcessId(int child_process_id);
+
uint64 ToUint64() const { return guid_; }
// Returns a (hex-encoded) string representation of the guid.
« no previous file with comments | « no previous file | base/trace_event/memory_allocator_dump_guid.cc » ('j') | base/trace_event/memory_allocator_dump_guid.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698