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

Unified Diff: base/debug/trace_event.h

Issue 66193005: Independently enable recording and event callback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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_impl.h » ('j') | no next file with comments »
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 1cd43a37ed78a6cc553dd915c7bd79f68e4fc107..18feb33f3d0754897156a84c5027a7a64e9441dc 100644
--- a/base/debug/trace_event.h
+++ b/base/debug/trace_event.h
@@ -807,6 +807,8 @@
// Set the duration field of a COMPLETE trace event.
// void TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(
+// const unsigned char* category_group_enabled,
+// const char* name,
// base::debug::TraceEventHandle id)
#define TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION \
base::debug::TraceLog::GetInstance()->UpdateTraceEventDuration
@@ -888,7 +890,7 @@ TRACE_EVENT_API_CLASS_EXPORT extern \
name, trace_event_internal::kNoEventId, \
TRACE_EVENT_FLAG_NONE, ##__VA_ARGS__); \
INTERNAL_TRACE_EVENT_UID(tracer).Initialize( \
- INTERNAL_TRACE_EVENT_UID(category_group_enabled), h); \
+ INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, h); \
}
// Implementation detail: internal macro to create static category and add
@@ -1378,12 +1380,15 @@ class TRACE_EVENT_API_CLASS_EXPORT ScopedTracer {
~ScopedTracer() {
if (p_data_ && *data_.category_group_enabled)
- TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(data_.event_handle);
+ TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(
+ data_.category_group_enabled, data_.name, data_.event_handle);
}
void Initialize(const unsigned char* category_group_enabled,
+ const char* name,
base::debug::TraceEventHandle event_handle) {
data_.category_group_enabled = category_group_enabled;
+ data_.name = name;
data_.event_handle = event_handle;
p_data_ = &data_;
}
@@ -1396,6 +1401,7 @@ class TRACE_EVENT_API_CLASS_EXPORT ScopedTracer {
// uninitialized accesses.
struct Data {
const unsigned char* category_group_enabled;
+ const char* name;
base::debug::TraceEventHandle event_handle;
};
Data* p_data_;
@@ -1410,6 +1416,7 @@ class TRACE_EVENT_API_CLASS_EXPORT ScopedTraceBinaryEfficient {
private:
const unsigned char* category_group_enabled_;
+ const char* name_;
base::debug::TraceEventHandle event_handle_;
};
« no previous file with comments | « no previous file | base/debug/trace_event_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698