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

libbpf: Remove sample_period init in perf_buffer

It seems that sample_period is not used in perf buffer. Actually, only
wakeup_events are meaningful to enable events aggregation for wakeup notification.
Remove sample_period setting code to avoid confusion.

Fixes: fb84b8224655 ("libbpf: add perf buffer API")
Signed-off-by: Tao Chen <chen.dylane@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/bpf/20250423163901.2983689-1-chen.dylane@linux.dev

authored by

Tao Chen and committed by
Andrii Nakryiko
64821d25 46eb0126

-1
-1
tools/lib/bpf/libbpf.c
··· 13375 13375 attr.config = PERF_COUNT_SW_BPF_OUTPUT; 13376 13376 attr.type = PERF_TYPE_SOFTWARE; 13377 13377 attr.sample_type = PERF_SAMPLE_RAW; 13378 - attr.sample_period = sample_period; 13379 13378 attr.wakeup_events = sample_period; 13380 13379 13381 13380 p.attr = &attr;