Commit f2cb0660 authored by Menglong Dong's avatar Menglong Dong Committed by Andrii Nakryiko
Browse files

selftests/bpf: Call bpf_get_numa_node_id() in trigger_count()



The bench test "trig-kernel-count" can be used as a baseline comparison
for fentry and other benchmarks, and the calling to bpf_get_numa_node_id()
should be considered as composition of the baseline. So, let's call it in
trigger_count(). Meanwhile, rename trigger_count() to
trigger_kernel_count() to make it easier understand.

Signed-off-by: default avatarMenglong Dong <dongml2@chinatelecom.cn>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20251116014242.151110-1-dongml2@chinatelecom.cn
parent 44bf4611
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -180,10 +180,10 @@ static void trigger_kernel_count_setup(void)
{
	setup_ctx();
	bpf_program__set_autoload(ctx.skel->progs.trigger_driver, false);
	bpf_program__set_autoload(ctx.skel->progs.trigger_count, true);
	bpf_program__set_autoload(ctx.skel->progs.trigger_kernel_count, true);
	load_ctx();
	/* override driver program */
	ctx.driver_prog_fd = bpf_program__fd(ctx.skel->progs.trigger_count);
	ctx.driver_prog_fd = bpf_program__fd(ctx.skel->progs.trigger_kernel_count);
}

static void trigger_kprobe_setup(void)
+4 −2
Original line number Diff line number Diff line
@@ -42,12 +42,14 @@ int bench_trigger_uprobe_multi(void *ctx)
const volatile int batch_iters = 0;

SEC("?raw_tp")
int trigger_count(void *ctx)
int trigger_kernel_count(void *ctx)
{
	int i;

	for (i = 0; i < batch_iters; i++)
	for (i = 0; i < batch_iters; i++) {
		inc_counter();
		bpf_get_numa_node_id();
	}

	return 0;
}