| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 <ctype.h> | 8 #include <ctype.h> |
| 9 | 9 |
| 10 #include "nanobench.h" | 10 #include "nanobench.h" |
| (...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 cleanup_run(target); | 1165 cleanup_run(target); |
| 1166 continue; | 1166 continue; |
| 1167 } | 1167 } |
| 1168 | 1168 |
| 1169 Stats stats(samples); | 1169 Stats stats(samples); |
| 1170 log->config(config); | 1170 log->config(config); |
| 1171 log->configOption("name", bench->getName()); | 1171 log->configOption("name", bench->getName()); |
| 1172 benchStream.fillCurrentOptions(log.get()); | 1172 benchStream.fillCurrentOptions(log.get()); |
| 1173 target->fillOptions(log.get()); | 1173 target->fillOptions(log.get()); |
| 1174 log->metric("min_ms", stats.min); | 1174 log->metric("min_ms", stats.min); |
| 1175 log->metric("median_ms", stats.median); |
| 1175 #if SK_SUPPORT_GPU | 1176 #if SK_SUPPORT_GPU |
| 1176 if (gpuStatsDump) { | 1177 if (gpuStatsDump) { |
| 1177 // dump to json, only SKPBench currently returns valid keys / va
lues | 1178 // dump to json, only SKPBench currently returns valid keys / va
lues |
| 1178 SkASSERT(keys.count() == values.count()); | 1179 SkASSERT(keys.count() == values.count()); |
| 1179 for (int i = 0; i < keys.count(); i++) { | 1180 for (int i = 0; i < keys.count(); i++) { |
| 1180 log->metric(keys[i].c_str(), values[i]); | 1181 log->metric(keys[i].c_str(), values[i]); |
| 1181 } | 1182 } |
| 1182 } | 1183 } |
| 1183 #endif | 1184 #endif |
| 1184 | 1185 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 | 1253 |
| 1253 return 0; | 1254 return 0; |
| 1254 } | 1255 } |
| 1255 | 1256 |
| 1256 #if !defined SK_BUILD_FOR_IOS | 1257 #if !defined SK_BUILD_FOR_IOS |
| 1257 int main(int argc, char** argv) { | 1258 int main(int argc, char** argv) { |
| 1258 SkCommandLineFlags::Parse(argc, argv); | 1259 SkCommandLineFlags::Parse(argc, argv); |
| 1259 return nanobench_main(); | 1260 return nanobench_main(); |
| 1260 } | 1261 } |
| 1261 #endif | 1262 #endif |
| OLD | NEW |