Chromium Code Reviews| Index: base/debug/trace_event.h |
| diff --git a/base/debug/trace_event.h b/base/debug/trace_event.h |
| index d1c74180d16b41e93ca8fa4ff2cf20b5e825ff7d..4689eda89a5989e82ec289905da3731056613339 100644 |
| --- a/base/debug/trace_event.h |
| +++ b/base/debug/trace_event.h |
| @@ -90,6 +90,7 @@ |
| #include <vector> |
| #include "base/callback.h" |
| +#include "base/hash_tables.h" |
| #include "base/memory/singleton.h" |
| #include "base/string_util.h" |
| #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
| @@ -296,7 +297,8 @@ const size_t kTraceMaxNumArgs = 2; |
| enum TraceEventPhase { |
| TRACE_EVENT_PHASE_BEGIN, |
| TRACE_EVENT_PHASE_END, |
| - TRACE_EVENT_PHASE_INSTANT |
| + TRACE_EVENT_PHASE_INSTANT, |
| + TRACE_EVENT_PHASE_METADATA |
| }; |
| // Simple union of values. This is much lighter weight than base::Value, which |
| @@ -500,6 +502,9 @@ class BASE_API TraceLog { |
| AddTraceEventEtw(phase, name, id, extra.c_str()); |
| } |
| + // Metadata |
| + void SetCurrentThreadName(const char* name); |
| + |
| // Exposed for unittesting only, allows resurrecting our |
| // singleton instance post-AtExit processing. |
| static void Resurrect(); |
| @@ -512,6 +517,7 @@ class BASE_API TraceLog { |
| TraceLog(); |
| ~TraceLog(); |
| const TraceCategory* GetCategoryInternal(const char* name); |
| + void AddCurrentMetadataEvents(); |
| // TODO(nduca): switch to per-thread trace buffers to reduce thread |
| // synchronization. |
| @@ -521,6 +527,8 @@ class BASE_API TraceLog { |
| BufferFullCallback buffer_full_callback_; |
| std::vector<TraceEvent> logged_events_; |
| + base::hash_map<PlatformThreadId, std::string> thread_names_; |
|
Sigurður Ásgeirsson
2011/08/02 19:36:41
It looks like this map will grow without bounds as
|
| + |
| DISALLOW_COPY_AND_ASSIGN(TraceLog); |
| }; |