mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-09 01:59:06 +08:00
libbpf: Add sample_period to creation options
Add option to set when the perf buffer should wake up, by default the perf buffer becomes signaled for every event that is being pushed to it. In case of a high throughput of events it will be more efficient to wake up only once you have X events ready to be read. So your application can wakeup once and drain the entire perf buffer. Signed-off-by: Jon Doron <jond@wiz.io> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20230207081916.3398417-1-arilou@gmail.com
This commit is contained in:
committed by
Andrii Nakryiko
parent
6333ea6a3a
commit
8c8243a409
@@ -1247,8 +1247,10 @@ typedef void (*perf_buffer_lost_fn)(void *ctx, int cpu, __u64 cnt);
|
||||
/* common use perf buffer options */
|
||||
struct perf_buffer_opts {
|
||||
size_t sz;
|
||||
__u32 sample_period;
|
||||
size_t :0;
|
||||
};
|
||||
#define perf_buffer_opts__last_field sz
|
||||
#define perf_buffer_opts__last_field sample_period
|
||||
|
||||
/**
|
||||
* @brief **perf_buffer__new()** creates BPF perfbuf manager for a specified
|
||||
|
||||
Reference in New Issue
Block a user