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
This commit is contained in:
mtklein 2014-08-19 12:41:53 -07:00 committed by Commit bot
parent 8ab362e6e5
commit 94e51567dd

View File

@ -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));