aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/trace/SkEventTracingPriv.cpp
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-07-24 14:27:18 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-24 19:22:05 +0000
commit3bf0042caa550b1f0cd56633ed66174141f2728f (patch)
tree2e3d4e204b66e138114292d8ba98a87a2ba26232 /tools/trace/SkEventTracingPriv.cpp
parent89d9d95570227533e4a87b41e5a7ed9fad4dd04a (diff)
ok, basic tracing support
This doesn't do anything in the default process-per-task mode, because those child tasks exit using _exit(), which doesn't trigger the event tracer destructor to flush. I don't remember exactly why I exit with _exit(), so I'm going to have to follow up on that. But written this way as I think I'm at least initializing the tracing in the right place for each process for the future. In threaded (-j -1) and serial (-j 0) modes, everything seems to work great. I'm also thinking I might add a tracer like the SkDebugf tracer but using ok_log(), which handles interlaced logging from concurrent tasks better than vanilla SkDebugf. Example: ninja -C out ok; and out/ok gm 8888 filter:search=fontmgr_bounds trace -j -1 Change-Id: Ia3cdad930ce65e6fd12fa74f3fb00894e35138d3 Reviewed-on: https://skia-review.googlesource.com/26350 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'tools/trace/SkEventTracingPriv.cpp')
-rw-r--r--tools/trace/SkEventTracingPriv.cpp10
1 files changed, 6 insertions, 4 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();