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

Unified Diff: base/debug/trace_event.h

Issue 109933006: Implement sampling profiler (chromium side change) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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') | base/debug/trace_event_impl.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 18feb33f3d0754897156a84c5027a7a64e9441dc..6d33243fe26ae4c9a15017e6416f839e28e041c2 100644
--- a/base/debug/trace_event.h
+++ b/base/debug/trace_event.h
@@ -730,7 +730,8 @@
#define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \
do { \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
- if (*INTERNAL_TRACE_EVENT_UID(category_group_enabled)) { \
+ if (*INTERNAL_TRACE_EVENT_UID(category_group_enabled) & \
+ base::debug::TraceLog::ENABLED_FOR_RECORDING) { \
haraken 2013/12/19 00:19:14 I'll land the same fix to TraceEvent.h in Blink.
Xianzhu 2013/12/19 00:39:57 We also need to check ENABLED_FOR_EVENT_CALLBACK h
haraken 2013/12/19 00:53:59 Done.
*ret = true; \
} else { \
*ret = false; \
@@ -870,7 +871,8 @@ TRACE_EVENT_API_CLASS_EXPORT extern \
#define INTERNAL_TRACE_EVENT_ADD(phase, category_group, name, flags, ...) \
do { \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
- if (*INTERNAL_TRACE_EVENT_UID(category_group_enabled)) { \
+ if (*INTERNAL_TRACE_EVENT_UID(category_group_enabled) & \
+ base::debug::TraceLog::ENABLED_FOR_RECORDING) { \
trace_event_internal::AddTraceEvent( \
phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
trace_event_internal::kNoEventId, flags, ##__VA_ARGS__); \
@@ -883,7 +885,8 @@ TRACE_EVENT_API_CLASS_EXPORT extern \
#define INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name, ...) \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
trace_event_internal::ScopedTracer INTERNAL_TRACE_EVENT_UID(tracer); \
- if (*INTERNAL_TRACE_EVENT_UID(category_group_enabled)) { \
+ if (*INTERNAL_TRACE_EVENT_UID(category_group_enabled) & \
+ base::debug::TraceLog::ENABLED_FOR_RECORDING) { \
base::debug::TraceEventHandle h = trace_event_internal::AddTraceEvent( \
TRACE_EVENT_PHASE_COMPLETE, \
INTERNAL_TRACE_EVENT_UID(category_group_enabled), \
@@ -899,7 +902,8 @@ TRACE_EVENT_API_CLASS_EXPORT extern \
flags, ...) \
do { \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
- if (*INTERNAL_TRACE_EVENT_UID(category_group_enabled)) { \
+ if (*INTERNAL_TRACE_EVENT_UID(category_group_enabled) & \
+ base::debug::TraceLog::ENABLED_FOR_RECORDING) { \
unsigned char trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \
trace_event_internal::TraceID trace_event_trace_id( \
id, &trace_event_flags); \
@@ -916,7 +920,8 @@ TRACE_EVENT_API_CLASS_EXPORT extern \
category_group, name, id, thread_id, timestamp, flags, ...) \
do { \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
- if (*INTERNAL_TRACE_EVENT_UID(category_group_enabled)) { \
+ if (*INTERNAL_TRACE_EVENT_UID(category_group_enabled) & \
+ base::debug::TraceLog::ENABLED_FOR_RECORDING) { \
unsigned char trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \
trace_event_internal::TraceID trace_event_trace_id( \
id, &trace_event_flags); \
« no previous file with comments | « no previous file | base/debug/trace_event_impl.h » ('j') | base/debug/trace_event_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698