Do not try to time kFailedLoops
Move the check for kFailedLoops above code that times the benchmark. This matches the comment ("Can't be timed") and prevents an infinite loop. Bug: skia:6774 Change-Id: Iacdc1ca1d11afcf05afac60e4eb0d8d9a12f800e Reviewed-on: https://skia-review.googlesource.com/53803 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
This commit is contained in:
parent
29f642a952
commit
b30d11319b
@ -1284,6 +1284,12 @@ int main(int argc, char** argv) {
|
||||
? setup_gpu_bench(target, bench.get(), maxFrameLag)
|
||||
: setup_cpu_bench(overhead, target, bench.get());
|
||||
|
||||
if (kFailedLoops == loops) {
|
||||
// Can't be timed. A warning note has already been printed.
|
||||
cleanup_run(target);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (runs == 0 && FLAGS_ms < 1000) {
|
||||
// Run the first bench for 1000ms to warm up the nanobench if FLAGS_ms < 1000.
|
||||
// Otherwise, the first few benches' measurements will be inaccurate.
|
||||
@ -1326,12 +1332,6 @@ int main(int argc, char** argv) {
|
||||
write_canvas_png(target, pngFilename);
|
||||
}
|
||||
|
||||
if (kFailedLoops == loops) {
|
||||
// Can't be timed. A warning note has already been printed.
|
||||
cleanup_run(target);
|
||||
continue;
|
||||
}
|
||||
|
||||
Stats stats(samples);
|
||||
log->config(config);
|
||||
log->configOption("name", bench->getName());
|
||||
|
Loading…
Reference in New Issue
Block a user