Remove unused TimerData that generates errors
As far as I can tell all uses of TimerData::appendTimes were stripped out in https://chromiumcodereview.appspot.com/23121002 but the surrounding code was left in, causing it to print errors when there are none.
BUG=skia:2242
R=sglez@google.com, tomhudson@chromium.org, mtklein@google.com, tomhudson@google.com
Author: iancottrell@google.com
Review URL: https://codereview.chromium.org/187643002
git-svn-id: http://skia.googlecode.com/svn/trunk@13672 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/bbh_shootout.cpp b/tools/bbh_shootout.cpp
index 8f445d8..fa1739c 100644
--- a/tools/bbh_shootout.cpp
+++ b/tools/bbh_shootout.cpp
@@ -296,18 +296,12 @@
/**
* Takes argc,argv along with one of the benchmark functions defined above.
* Will loop along all skp files and perform measurments.
- *
- * Returns a SkScalar representing CPU time taken during benchmark.
- * As a side effect, it spits the timer result to stdout.
- * Will return -1.0 on error.
*/
-static bool benchmark_loop(
+static void benchmark_loop(
int argc,
char **argv,
const BenchmarkControl& benchControl,
SkTArray<Histogram>& histogram) {
- static const SkString timeFormat("%f");
- TimerData timerData(argc - 1);
for (int index = 1; index < argc; ++index) {
BenchTimer timer;
SkString path(argv[index]);
@@ -317,30 +311,9 @@
continue;
}
benchControl.fFunction(benchControl, path, pic, &timer);
-
histogram[index - 1].fPath = path;
histogram[index - 1].fCpuTime = SkDoubleToScalar(timer.fCpu);
}
-
- const SkString timerResult = timerData.getResult(
- /*doubleFormat = */ timeFormat.c_str(),
- /*result = */ TimerData::kAvg_Result,
- /*configName = */ benchControl.fName.c_str(),
- /*timerFlags = */ TimerData::kCpu_Flag);
-
- const char findStr[] = "= ";
- int pos = timerResult.find(findStr);
- if (-1 == pos) {
- SkDebugf("Unexpected output from TimerData::getResult(...). Unable to parse.\n");
- return false;
- }
-
- SkScalar cpuTime = SkDoubleToScalar(atof(timerResult.c_str() + pos + sizeof(findStr) - 1));
- if (cpuTime == 0) { // atof returns 0.0 on error.
- SkDebugf("Unable to read value from timer result.\n");
- return false;
- }
- return true;
}
int tool_main(int argc, char** argv);
@@ -358,13 +331,7 @@
for (size_t i = 0; i < kNumBenchmarks; ++i) {
histograms[i].reset(argc - 1);
- bool success = benchmark_loop(
- argc, argv,
- BenchmarkControl::Make(i),
- histograms[i]);
- if (!success) {
- SkDebugf("benchmark_loop failed at index %d\n", i);
- }
+ benchmark_loop(argc, argv, BenchmarkControl::Make(i), histograms[i]);
}
// Output gnuplot readable histogram data..