aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-08-19 12:41:53 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-19 12:41:56 -0700
commit94e51567dd691c3e1e8dfa6005a301d72cecf48e (patch)
tree6325bae639a2f698db4d26511ff34e8e75f76df5 /bench
parent8ab362e6e5f9eddacd2a713fa69c3c0e48cc465c (diff)
Add --options to nanobench, similar to --key but for non-identifying options.
Friends with https://codereview.chromium.org/487233003/ Example of out/Release/nanobench --options build_number 12374 --match patch_grid_texs_small { "gitHash":"unknown-revision", "options":{ "build_number":"12374", "system":"UNIX" }, "results":{ "patch_grid_texs_small_640_480":{ "565":{ "max_ms":0.268116, "mean_ms":0.2318529, "median_ms":0.235337, "min_ms":0.219158, "options":{ "source_type":"bench" }, "stddev_ms":0.01491263917658814 }, "8888":{ "max_ms":0.231881, "mean_ms":0.2214668, "median_ms":0.219356, "min_ms":0.218887, "options":{ "source_type":"bench" }, "stddev_ms":0.004595541070791701 }, "gpu":{ "max_ms":0.1398304782608696, "mean_ms":0.128833402173913, "median_ms":0.1316798695652174, "min_ms":0.1111915434782609, "options":{ "GL_RENDERER":"Quadro 600/PCIe/SSE2", "GL_SHADING_LANGUAGE_VERSION":"4.40 NVIDIA via Cg compiler", "GL_VENDOR":"NVIDIA Corporation", "GL_VERSION":"4.4.0 NVIDIA 331.79", "source_type":"bench" }, "stddev_ms":0.008923738937837156 } } } } BUG=skia: R=jcgregorio@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/490683002
Diffstat (limited to 'bench')
-rw-r--r--bench/nanobench.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index c8c9c6f6ac..a1fea22a85 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -63,7 +63,10 @@ DEFINE_string(outResultsFile, "", "If given, write results here as JSON.");
DEFINE_int32(maxCalibrationAttempts, 3,
"Try up to this many times to guess loops for a bench, or skip the bench.");
DEFINE_int32(maxLoops, 1000000, "Never run a bench more times than this.");
-DEFINE_string(key, "", "Space-separated key/value pairs to add to JSON.");
+DEFINE_string(key, "",
+ "Space-separated key/value pairs to add to JSON identifying this bench config.");
+DEFINE_string(options, "",
+ "Space-separated option/value pairs to add to JSON, logging extra info.");
DEFINE_string(gitHash, "", "Git hash to add to JSON.");
DEFINE_string(clip, "0,0,1000,1000", "Clip for SKPs.");
@@ -565,7 +568,15 @@ int nanobench_main() {
for (int i = 1; i < FLAGS_key.count(); i += 2) {
log.key(FLAGS_key[i-1], FLAGS_key[i]);
}
+
fill_static_options(&log);
+ if (1 == FLAGS_options.count() % 2) {
+ SkDebugf("ERROR: --options must be passed with an even number of arguments.\n");
+ return 1;
+ }
+ for (int i = 1; i < FLAGS_options.count(); i += 2) {
+ log.option(FLAGS_options[i-1], FLAGS_options[i]);
+ }
const double overhead = estimate_timer_overhead();
SkDebugf("Timer overhead: %s\n", HUMANIZE(overhead));