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

Unified Diff: base/trace_event/memory_allocator_dump.h

Issue 1583483002: [tracing] Add method to create "weak" global dumps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes. Created 4 years, 11 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 | « no previous file | base/trace_event/memory_allocator_dump.cc » ('j') | base/trace_event/memory_allocator_dump.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_allocator_dump.h
diff --git a/base/trace_event/memory_allocator_dump.h b/base/trace_event/memory_allocator_dump.h
index 6c514fa6a62380b9ec6180792451a40b3a9dbbf9..0b4821ac58a4c7cf75e8c2d914996902b751802e 100644
--- a/base/trace_event/memory_allocator_dump.h
+++ b/base/trace_event/memory_allocator_dump.h
@@ -26,6 +26,12 @@ class TracedValue;
// Data model for user-land memory allocator dumps.
class BASE_EXPORT MemoryAllocatorDump {
public:
+ enum Flag {
Primiano Tucci (use gerrit) 2016/01/19 17:07:11 s/Flag/Flags/
ssid 2016/01/20 18:58:34 Done.
+ // A dump marked weak will be removed from tracing. It is used when dump
Primiano Tucci (use gerrit) 2016/01/19 17:07:11 I'd clarify and say "will be discarded by TraceVie
ssid 2016/01/20 18:58:34 Done.
+ // provider is unsure of the existence of a block of memory.
+ WEAK = 1 << 0,
+ };
+
// MemoryAllocatorDump is owned by ProcessMemoryDump.
MemoryAllocatorDump(const std::string& absolute_name,
ProcessMemoryDump* process_memory_dump,
@@ -68,6 +74,11 @@ class BASE_EXPORT MemoryAllocatorDump {
return process_memory_dump_;
}
+ // Use enum Flag to set values.
+ void set_flags(uint8_t flags) { flags_ |= flags; }
Primiano Tucci (use gerrit) 2016/01/19 17:07:11 Why not just int (there seems to be lot of precede
ssid 2016/01/20 18:58:34 Done.
+ void unset_flags(uint8_t flags) { flags_ &= ~flags; }
Primiano Tucci (use gerrit) 2016/01/19 17:07:11 s/unset/clear/
ssid 2016/01/20 18:58:34 Done.
+ uint8_t flags() { return flags_; }
+
// |guid| is an optional global dump identifier, unique across all processes
// within the scope of a global dump. It is only required when using the
// graph APIs (see TODO_method_name) to express retention / suballocation or
@@ -83,6 +94,7 @@ class BASE_EXPORT MemoryAllocatorDump {
ProcessMemoryDump* const process_memory_dump_; // Not owned (PMD owns this).
scoped_refptr<TracedValue> attributes_;
MemoryAllocatorDumpGuid guid_;
+ uint8_t flags_; // See enum Flag.
Primiano Tucci (use gerrit) 2016/01/19 17:07:11 ditto here for int
ssid 2016/01/20 18:58:34 Done.
// A local buffer for Sprintf conversion on fastpath. Avoids allocating
// temporary strings on each AddScalar() call.
« no previous file with comments | « no previous file | base/trace_event/memory_allocator_dump.cc » ('j') | base/trace_event/memory_allocator_dump.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698