aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-07-26 15:50:37 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-26 20:12:22 +0000
commit1e0968684065b39dfe3ea8b7fac05e37b712ef61 (patch)
treea3f4c9d46fcdf4db2584bc92a60dbee9a4aaadec /tools
parentf695b63841fb4c55353bcf98932985e0deea3112 (diff)
Add --traceMatch argument to filter tracing categories
Bug: skia: Change-Id: I1449f0f4d7d9ab6225d98c601eafa7461a2a7dde Reviewed-on: https://skia-review.googlesource.com/27120 Commit-Queue: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/trace/SkEventTracingPriv.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/trace/SkEventTracingPriv.cpp b/tools/trace/SkEventTracingPriv.cpp
index 7a9ca2ee80..a7b3a827e6 100644
--- a/tools/trace/SkEventTracingPriv.cpp
+++ b/tools/trace/SkEventTracingPriv.cpp
@@ -22,6 +22,10 @@ DEFINE_string(trace, "",
" trace events to specified file as JSON, for viewing\n"
" with chrome://tracing");
+DEFINE_string(traceMatch, "",
+ "Filter which categories are traced.\n"
+ "Uses same format as --match\n");
+
void initializeEventTracingForTools(const char* traceFlag) {
if (!traceFlag) {
if (FLAGS_trace.isEmpty()) {
@@ -65,8 +69,9 @@ uint8_t* SkEventTracingCategories::getCategoryGroupEnabled(const char* name) {
return reinterpret_cast<uint8_t*>(&fCategories[0]);
}
- fCategories[fNumCategories].fEnabled =
- SkEventTracer::kEnabledForRecording_CategoryGroupEnabledFlags;
+ fCategories[fNumCategories].fEnabled = SkCommandLineFlags::ShouldSkip(FLAGS_traceMatch, name)
+ ? 0 : SkEventTracer::kEnabledForRecording_CategoryGroupEnabledFlags;
+
fCategories[fNumCategories].fName = name;
return reinterpret_cast<uint8_t*>(&fCategories[fNumCategories++]);
}