All of lore.kernel.org
 help / color / mirror / Atom feed
* Maximum size of record over perf ring buffer?
@ 2020-07-17 14:23 Kevin Sheldrake
  2020-07-20  4:35 ` Andrii Nakryiko
  0 siblings, 1 reply; 11+ messages in thread
From: Kevin Sheldrake @ 2020-07-17 14:23 UTC (permalink / raw)
  To: bpf

Hello

I'm building a tool using EBPF/libbpf/C and I've run into an issue that I'd like to ask about.  I haven't managed to find documentation for the maximum size of a record that can be sent over the perf ring buffer, but experimentation (on kernel 5.3 (x64) with latest libbpf from github) suggests it is just short of 64KB.  Please could someone confirm if that's the case or not?  My experiments suggest that sending a record that is greater than 64KB results in the size reported in the callback being correct but the records overlapping, causing corruption if they are not serviced as quickly as they arrive.  Setting the record to exactly 64KB results in no records being received at all.

For reference, I'm using perf_buffer__new() and perf_buffer__poll() on the userland side; and bpf_perf_event_output(ctx, &event_map, BPF_F_CURRENT_CPU, event, sizeof(event_s)) on the EBPF side.

Additionally, is there a better architecture for sending large volumes of data (>64KB) back from the EBPF program to userland, such as a different ring buffer, a map, some kind of shared mmaped segment, etc, other than simply fragmenting the data?  Please excuse my naivety as I'm relatively new to the world of EBPF.

Thank you in anticipation

Kevin Sheldrake


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-10-29 22:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17 14:23 Maximum size of record over perf ring buffer? Kevin Sheldrake
2020-07-20  4:35 ` Andrii Nakryiko
2020-07-20 11:39   ` [EXTERNAL] " Kevin Sheldrake
2020-07-23 19:05     ` Andrii Nakryiko
2020-07-24  9:40       ` Kevin Sheldrake
2020-10-26 17:10         ` Kevin Sheldrake
2020-10-26 22:01           ` Andrii Nakryiko
2020-10-27  1:07             ` KP Singh
2020-10-27  3:43               ` Andrii Nakryiko
2020-10-28 19:03                 ` Kevin Sheldrake
2020-10-29 22:48                   ` Andrii Nakryiko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.