Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(783)

Unified Diff: bench/nanobench.cpp

Issue 490683002: Add --options to nanobench, similar to --key but for non-identifying options. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/nanobench.cpp
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index c8c9c6f6ac669da1900762a32c3f2beca9a78ca8..a1fea22a85334feac58641407360c315de105772 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));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698