aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/trace
diff options
context:
space:
mode:
Diffstat (limited to 'tools/trace')
-rw-r--r--tools/trace/SkEventTracingPriv.cpp10
-rw-r--r--tools/trace/SkEventTracingPriv.h5
2 files changed, 9 insertions, 6 deletions
diff --git a/tools/trace/SkEventTracingPriv.cpp b/tools/trace/SkEventTracingPriv.cpp
index 783cfeaa32..42d992cb13 100644
--- a/tools/trace/SkEventTracingPriv.cpp
+++ b/tools/trace/SkEventTracingPriv.cpp
@@ -22,12 +22,14 @@ DEFINE_string(trace, "",
" trace events to specified file as JSON, for viewing\n"
" with chrome://tracing");
-void initializeEventTracingForTools() {
- if (FLAGS_trace.isEmpty()) {
- return;
+void initializeEventTracingForTools(const char* traceFlag) {
+ if (!traceFlag) {
+ if (FLAGS_trace.isEmpty()) {
+ return;
+ }
+ traceFlag = FLAGS_trace[0];
}
- const char* traceFlag = FLAGS_trace[0];
SkEventTracer* eventTracer = nullptr;
if (0 == strcmp(traceFlag, "atrace")) {
eventTracer = new SkATrace();
diff --git a/tools/trace/SkEventTracingPriv.h b/tools/trace/SkEventTracingPriv.h
index aa3ee6d4d9..fb7b2f3fa5 100644
--- a/tools/trace/SkEventTracingPriv.h
+++ b/tools/trace/SkEventTracingPriv.h
@@ -11,9 +11,10 @@
#include "SkMutex.h"
/**
- * Construct and install an SkEventTracer, based on the 'trace' command line argument.
+ * Construct and install an SkEventTracer, based on the mode,
+ * defaulting to the --trace command line argument.
*/
-void initializeEventTracingForTools();
+void initializeEventTracingForTools(const char* mode = nullptr);
/**
* Helper class used by internal implementations of SkEventTracer to manage categories.