summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-22 00:29:39 +0000
committerwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-22 00:29:39 +0000
commit80778e816b8242d469bd8a0ee71266972bb93f04 (patch)
tree80830ed325fef8044293935ccc92d1c566c3f5b0 /base
parentbf947acb008a645641c3d8eff65d6f1f260052e9 (diff)
downloadchromium_src-80778e816b8242d469bd8a0ee71266972bb93f04.zip
chromium_src-80778e816b8242d469bd8a0ee71266972bb93f04.tar.gz
chromium_src-80778e816b8242d469bd8a0ee71266972bb93f04.tar.bz2
Don't enable atrace for disabled-by-default categories.
For now we don't have a way to specify chromium categories because our ATrace path is enabled when Android systrace 'view' tag is enabled, so just use the default categories. Now exclude the disabled-by-default categories. *category_group_enabled &= ~ATRACE_ENABLED is not needed because we always apply the flag in TraceLog::SetCategoryGroupEnabled(). BUG=242371 Review URL: https://chromiumcodereview.appspot.com/15587003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201403 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/debug/trace_event_android.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/base/debug/trace_event_android.cc b/base/debug/trace_event_android.cc
index 224eb8b..2869416 100644
--- a/base/debug/trace_event_android.cc
+++ b/base/debug/trace_event_android.cc
@@ -142,10 +142,16 @@ void TraceLog::SendToATrace(
// Must be called with lock_ locked.
void TraceLog::ApplyATraceEnabledFlag(unsigned char* category_group_enabled) {
- if (g_atrace_fd != -1)
- *category_group_enabled |= ATRACE_ENABLED;
- else
- *category_group_enabled &= ~ATRACE_ENABLED;
+ if (g_atrace_fd == -1)
+ return;
+
+ // Don't enable disabled-by-default categories for atrace.
+ const char* category_group = GetCategoryGroupName(category_group_enabled);
+ if (strncmp(category_group, TRACE_DISABLED_BY_DEFAULT(""),
+ strlen(TRACE_DISABLED_BY_DEFAULT(""))) == 0)
+ return;
+
+ *category_group_enabled |= ATRACE_ENABLED;
}
} // namespace debug