Index: base/debug/trace_event_impl.cc |
diff --git a/base/debug/trace_event_impl.cc b/base/debug/trace_event_impl.cc |
index e8b3083339cb14a72a2e338f2857bbfc8063f9f0..34f26f640e5b5f40327185106dec1c89351b8e75 100644 |
--- a/base/debug/trace_event_impl.cc |
+++ b/base/debug/trace_event_impl.cc |
@@ -836,14 +836,20 @@ void TraceLog::EnableIncludedCategoryGroup(int category_index) { |
} |
void TraceLog::SetCategoryGroupEnabled(int category_index, bool is_enabled) { |
- g_category_group_enabled[category_index] = |
- is_enabled ? TraceLog::CATEGORY_ENABLED : 0; |
+ g_category_group_enabled[category_index] = is_enabled ? CATEGORY_ENABLED : 0; |
#if defined(OS_ANDROID) |
ApplyATraceEnabledFlag(&g_category_group_enabled[category_index]); |
#endif |
} |
+bool TraceLog::IsCategoryGroupEnabled( |
+ const unsigned char* category_group_enabled) { |
+ // On Android, ATrace and normal trace can be enabled independently. |
+ // This function checks if the normal trace is enabled. |
+ return *category_group_enabled & CATEGORY_ENABLED; |
+} |
+ |
void TraceLog::EnableIncludedCategoryGroups() { |
for (int i = 0; i < g_category_index; i++) |
EnableIncludedCategoryGroup(i); |
@@ -1116,7 +1122,7 @@ void TraceLog::AddTraceEventWithThreadIdAndTimestamp( |
do { |
AutoLock lock(lock_); |
- if (*category_group_enabled != CATEGORY_ENABLED) |
+ if (!IsCategoryGroupEnabled(category_group_enabled)) |
return; |
event_callback_copy = event_callback_; |