mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 14:42:08 +02:00
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: Menglong Dong <dongml2@chinatelecom.cn> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20251116014242.151110-1-dongml2@chinatelecom.cn
This commit is contained in:
parent
44bf461182
commit
f2cb0660ac
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user