aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Protopopov <aspsk@isovalent.com>2023-02-13 09:15:18 +0000
committerAndrii Nakryiko <andrii@kernel.org>2023-02-15 16:29:31 -0800
commita237dda05e9101404a634ac53ee65c8f8c8fce58 (patch)
treefe6a5bc3f38610434e067675cd39882021349ed1
parent90c22503cd8910c54a8cd4bfe5bb6873d9ba8e0b (diff)
downloadwpan-next-a237dda05e9101404a634ac53ee65c8f8c8fce58.tar.gz
selftest/bpf/benchs: Print less if the quiet option is set
The bench utility will print Setting up benchmark '<bench-name>'... Benchmark '<bench-name>' started. on startup to stdout. Suppress this output if --quiet option if given. This makes it simpler to parse benchmark output by a script. Signed-off-by: Anton Protopopov <aspsk@isovalent.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20230213091519.1202813-7-aspsk@isovalent.com
-rw-r--r--tools/testing/selftests/bpf/bench.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/bench.c b/tools/testing/selftests/bpf/bench.c
index 23c24c34613076..767ca679ee6769 100644
--- a/tools/testing/selftests/bpf/bench.c
+++ b/tools/testing/selftests/bpf/bench.c
@@ -577,7 +577,8 @@ static void setup_benchmark(void)
{
int i, err;
- printf("Setting up benchmark '%s'...\n", bench->name);
+ if (!env.quiet)
+ printf("Setting up benchmark '%s'...\n", bench->name);
state.producers = calloc(env.producer_cnt, sizeof(*state.producers));
state.consumers = calloc(env.consumer_cnt, sizeof(*state.consumers));
@@ -623,7 +624,8 @@ static void setup_benchmark(void)
next_cpu(&env.prod_cpus));
}
- printf("Benchmark '%s' started.\n", bench->name);
+ if (!env.quiet)
+ printf("Benchmark '%s' started.\n", bench->name);
}
static pthread_mutex_t bench_done_mtx = PTHREAD_MUTEX_INITIALIZER;