diff mbox series

[bpf-next,v6,1/5] selftests/bpf: Use producer_cnt to allocate local counter array

Message ID 20230613080921.1623219-2-houtao@huaweicloud.com (mailing list archive)
State Superseded
Headers show
Series Add benchmark for bpf memory allocator | expand

Commit Message

Hou Tao June 13, 2023, 8:09 a.m. UTC
From: Hou Tao <houtao1@huawei.com>

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

Signed-off-by: Hou Tao <houtao1@huawei.com>
---
 tools/testing/selftests/bpf/benchs/bench_count.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/benchs/bench_count.c b/tools/testing/selftests/bpf/benchs/bench_count.c
index 078972ce208e..3768945ad08e 100644
--- a/tools/testing/selftests/bpf/benchs/bench_count.c
+++ b/tools/testing/selftests/bpf/benchs/bench_count.c
@@ -40,7 +40,7 @@  static void count_local_setup(void)
 {
 	struct count_local_ctx *ctx = &count_local_ctx;
 
-	ctx->hits = calloc(env.consumer_cnt, sizeof(*ctx->hits));
+	ctx->hits = calloc(env.producer_cnt, sizeof(*ctx->hits));
 	if (!ctx->hits)
 		exit(1);
 }