| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "VisualLightweightBenchModule.h" | 8 #include "VisualLightweightBenchModule.h" |
| 9 | 9 |
| 10 #include "ProcStats.h" | 10 #include "ProcStats.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 static SkString humanize(double ms) { | 35 static SkString humanize(double ms) { |
| 36 if (FLAGS_verbose) { | 36 if (FLAGS_verbose) { |
| 37 return SkStringPrintf("%llu", (uint64_t)(ms*1e6)); | 37 return SkStringPrintf("%llu", (uint64_t)(ms*1e6)); |
| 38 } | 38 } |
| 39 return HumanizeMs(ms); | 39 return HumanizeMs(ms); |
| 40 } | 40 } |
| 41 | 41 |
| 42 #define HUMANIZE(time) humanize(time).c_str() | 42 #define HUMANIZE(time) humanize(time).c_str() |
| 43 | 43 |
| 44 VisualLightweightBenchModule::VisualLightweightBenchModule(VisualBench* owner) | 44 VisualLightweightBenchModule::VisualLightweightBenchModule(VisualBench* owner) |
| 45 : INHERITED(owner, true) | 45 : INHERITED(owner) |
| 46 , fCurrentSample(0) | 46 , fCurrentSample(0) |
| 47 , fResults(new ResultsWriter) { | 47 , fResults(new ResultsWriter) { |
| 48 // Print header | 48 // Print header |
| 49 SkDebugf("curr/maxrss\tloops\tmin\tmedian\tmean\tmax\tstddev\t%-*s\tbench\n"
, FLAGS_samples, | 49 SkDebugf("curr/maxrss\tloops\tmin\tmedian\tmean\tmax\tstddev\t%-*s\tbench\n"
, FLAGS_samples, |
| 50 "samples"); | 50 "samples"); |
| 51 | 51 |
| 52 // setup json logging if required | 52 // setup json logging if required |
| 53 if (!FLAGS_outResultsFile.isEmpty()) { | 53 if (!FLAGS_outResultsFile.isEmpty()) { |
| 54 fResults.reset(new NanoJSONResultsWriter(FLAGS_outResultsFile[0])); | 54 fResults.reset(new NanoJSONResultsWriter(FLAGS_outResultsFile[0])); |
| 55 } | 55 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 fRecords.push_back(); | 130 fRecords.push_back(); |
| 131 fCurrentSample = 0; | 131 fCurrentSample = 0; |
| 132 return true; | 132 return true; |
| 133 } | 133 } |
| 134 return false; | 134 return false; |
| 135 } | 135 } |
| 136 | 136 |
| 137 bool VisualLightweightBenchModule::onHandleChar(SkUnichar c) { | 137 bool VisualLightweightBenchModule::onHandleChar(SkUnichar c) { |
| 138 return true; | 138 return true; |
| 139 } | 139 } |
| OLD | NEW |