From ed6c642f98a25e576463a2557c6b522157341fad Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sun, 2 Jul 2017 11:49:34 +1000 Subject: [PATCH] Strip the "bench_" from "Benchmarkbench_etc". --- test/c/testlib/testlib.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/c/testlib/testlib.c b/test/c/testlib/testlib.c index c037ab5b..dbcd345e 100644 --- a/test/c/testlib/testlib.c +++ b/test/c/testlib/testlib.c @@ -52,12 +52,17 @@ void bench_finish(uint64_t reps, uint64_t n_bytes) { nanos = (uint64_t)(micros)*1000; } uint64_t kb_per_s = n_bytes * 1000000 / nanos; + + const char* name = proc_funcname; + if (!strncmp(name, "bench_", 6)) { + name += 6; + } if (bench_warm_up) { - printf("# (warm up) %s/%s\t%8" PRIu64 ".%06" PRIu64 " seconds\n", - proc_funcname, cc, nanos / 1000000000, (nanos % 1000000000) / 1000); + printf("# (warm up) %s/%s\t%8" PRIu64 ".%06" PRIu64 " seconds\n", name, cc, + nanos / 1000000000, (nanos % 1000000000) / 1000); } else { printf("Benchmark%s/%s\t%8" PRIu64 "\t%8" PRIu64 " ns/op\t%8d.%03d MB/s\n", - proc_funcname, cc, reps, nanos / reps, (int)(kb_per_s / 1000), + name, cc, reps, nanos / reps, (int)(kb_per_s / 1000), (int)(kb_per_s % 1000)); } }