summaryrefslogtreecommitdiffstats
path: root/base/debug/trace_event.h
diff options
context:
space:
mode:
authorwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-15 19:34:10 +0000
committerwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-15 19:34:10 +0000
commit33efd5500785993e3badada4fea7b8318b85c774 (patch)
treec83c9b768eed2dda5634c2ff326399611987f47d /base/debug/trace_event.h
parentf0c49a89b1b6b7abf7a93a265af978f00ff221f6 (diff)
downloadchromium_src-33efd5500785993e3badada4fea7b8318b85c774.zip
chromium_src-33efd5500785993e3badada4fea7b8318b85c774.tar.gz
chromium_src-33efd5500785993e3badada4fea7b8318b85c774.tar.bz2
Put Android systrace calls in trace_event_impl only.
http://codereview.chromium.org/11345019/ added code in both trace_event.h/cc and trace_event_impl.h/cc to support Android systrace. However, to make TRACE_EVENT in Webkit work, we would also need to change the TraceEvent.h in WebKit. This change removes Android systrace calls from trace_event.h/cc and put all ATrace specific code into trace_event_impl.h/cc so that trace_event for Android can work for WebKit without changing WebKit and/or webkit glue code. TBR=brettw BUG= Review URL: https://chromiumcodereview.appspot.com/11360208 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167983 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/debug/trace_event.h')
-rw-r--r--base/debug/trace_event.h21
1 files changed, 4 insertions, 17 deletions
diff --git a/base/debug/trace_event.h b/base/debug/trace_event.h
index f78bb3c..07863ad 100644
--- a/base/debug/trace_event.h
+++ b/base/debug/trace_event.h
@@ -597,14 +597,6 @@
#define TRACE_EVENT_API_ADD_TRACE_EVENT \
base::debug::TraceLog::GetInstance()->AddTraceEvent
-// Checks if Android ATrace is enabled.
-#if defined(OS_ANDROID)
-#define TRACE_EVENT_API_IS_ATRACE_ENABLED() \
- base::debug::TraceLog::IsATraceEnabled()
-#else
-#define TRACE_EVENT_API_IS_ATRACE_ENABLED() false
-#endif
-
////////////////////////////////////////////////////////////////////////////////
// Implementation detail: trace event macros create temporary variables
@@ -634,17 +626,12 @@
INTERNAL_TRACE_EVENT_UID(catstatic))); \
}
-// Implementation detail: internal macro to check if Android ATrace or the
-// current category (using the current static category variable) is enabled.
-#define INTERNAL_TRACE_EVENT_IS_ATRACE_OR_CATEGORY_ENABLED() \
- TRACE_EVENT_API_IS_ATRACE_ENABLED() || *INTERNAL_TRACE_EVENT_UID(catstatic)
-
// Implementation detail: internal macro to create static category and add
// event if the category is enabled.
#define INTERNAL_TRACE_EVENT_ADD(phase, category, name, flags, ...) \
do { \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category); \
- if (INTERNAL_TRACE_EVENT_IS_ATRACE_OR_CATEGORY_ENABLED()) { \
+ if (*INTERNAL_TRACE_EVENT_UID(catstatic)) { \
trace_event_internal::AddTraceEvent( \
phase, INTERNAL_TRACE_EVENT_UID(catstatic), name, \
trace_event_internal::kNoEventId, flags, ##__VA_ARGS__); \
@@ -658,7 +645,7 @@
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category); \
trace_event_internal::TraceEndOnScopeClose \
INTERNAL_TRACE_EVENT_UID(profileScope); \
- if (INTERNAL_TRACE_EVENT_IS_ATRACE_OR_CATEGORY_ENABLED()) { \
+ if (*INTERNAL_TRACE_EVENT_UID(catstatic)) { \
trace_event_internal::AddTraceEvent( \
TRACE_EVENT_PHASE_BEGIN, \
INTERNAL_TRACE_EVENT_UID(catstatic), \
@@ -676,7 +663,7 @@
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category); \
trace_event_internal::TraceEndOnScopeCloseThreshold \
INTERNAL_TRACE_EVENT_UID(profileScope); \
- if (INTERNAL_TRACE_EVENT_IS_ATRACE_OR_CATEGORY_ENABLED()) { \
+ if (*INTERNAL_TRACE_EVENT_UID(catstatic)) { \
int INTERNAL_TRACE_EVENT_UID(begin_event_id) = \
trace_event_internal::AddTraceEvent( \
TRACE_EVENT_PHASE_BEGIN, \
@@ -694,7 +681,7 @@
...) \
do { \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category); \
- if (INTERNAL_TRACE_EVENT_IS_ATRACE_OR_CATEGORY_ENABLED()) { \
+ if (*INTERNAL_TRACE_EVENT_UID(catstatic)) { \
unsigned char trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \
trace_event_internal::TraceID trace_event_trace_id( \
id, &trace_event_flags); \