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

Unified Diff: base/debug/trace_event.h

Issue 7495031: trace_event support for thread names (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks to pass all trybots. Created 9 years, 4 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/debug/trace_event.cc » ('j') | base/debug/trace_event_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/trace_event.h
diff --git a/base/debug/trace_event.h b/base/debug/trace_event.h
index d1c74180d16b41e93ca8fa4ff2cf20b5e825ff7d..b1c64afb1cc4a538651a41cc654f5e7bd446ba68 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
@@ -512,6 +514,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 +524,8 @@ class BASE_API TraceLog {
BufferFullCallback buffer_full_callback_;
std::vector<TraceEvent> logged_events_;
+ base::hash_map<PlatformThreadId, std::string> thread_names_;
+
DISALLOW_COPY_AND_ASSIGN(TraceLog);
};
« no previous file with comments | « no previous file | base/debug/trace_event.cc » ('j') | base/debug/trace_event_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698