Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Use producer_cnt to allocate local counter array

For count-local benchmark, use producer_cnt instead of consumer_cnt when
allocating local counter array.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20230613080921.1623219-2-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Hou Tao and committed by
Alexei Starovoitov
8ad663d3 e2fa5c20

+1 -1
+1 -1
tools/testing/selftests/bpf/benchs/bench_count.c
··· 40 40 { 41 41 struct count_local_ctx *ctx = &count_local_ctx; 42 42 43 - ctx->hits = calloc(env.consumer_cnt, sizeof(*ctx->hits)); 43 + ctx->hits = calloc(env.producer_cnt, sizeof(*ctx->hits)); 44 44 if (!ctx->hits) 45 45 exit(1); 46 46 }