diff options
author | Brian Osman <brianosman@google.com> | 2017-07-20 15:43:35 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-20 20:11:22 +0000 |
commit | 53136aa93f0d0e72facabb70a7d40ed265e4be0e (patch) | |
tree | 3ae630fda54ade043c357bf80222e06eda6bbef2 /bench/nanobench.cpp | |
parent | 45c16fa82cd2fec010d4cb7763b654a413cabd0c (diff) |
First stab at JSON event tracer
Not yet thread safe (so it forces threading off).
Builds JSON on the fly, so overhead is certainly bad.
Plan to fix all of that, but this at least "works".
There is now one tracing flag: 'trace'.
- 'debugf' installs the SkDebugf tracer.
- 'atrace' installs the Android ATrace tracer.
- Any other value is interpreted as a filename, and
produces a JSON file for chrome://tracing.
All three modes work in DM, nanobench, and Viewer.
Bug: skia:
Change-Id: I3fbc22382b99418a508c670be2770195c0a1c364
Reviewed-on: https://skia-review.googlesource.com/24781
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'bench/nanobench.cpp')
-rw-r--r-- | bench/nanobench.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp index 7148bc26fd..05c475a391 100644 --- a/bench/nanobench.cpp +++ b/bench/nanobench.cpp @@ -33,6 +33,7 @@ #include "SkCommonFlagsPathRenderer.h" #include "SkData.h" #include "SkDebugfTracer.h" +#include "SkEventTracingPriv.h" #include "SkGraphics.h" #include "SkLeanWindows.h" #include "SkOSFile.h" @@ -1104,9 +1105,9 @@ static void start_keepalive() { int main(int argc, char** argv) { SkCommandLineFlags::Parse(argc, argv); - if (FLAGS_trace) { - SkEventTracer::SetInstance(new SkDebugfTracer); - } + + initializeEventTracingForTools(&FLAGS_threads); + #if defined(SK_BUILD_FOR_IOS) cd_Documents(); #endif |