fix format of 35 user ring buffer

This commit is contained in:
yunwei37
2023-10-21 12:41:54 +00:00
parent 4602557478
commit 002bcaeaea
3 changed files with 42 additions and 27 deletions

View File

@@ -9,12 +9,14 @@
char _license[] SEC("license") = "GPL";
struct {
struct
{
__uint(type, BPF_MAP_TYPE_USER_RINGBUF);
__uint(max_entries, 256 * 1024);
} user_ringbuf SEC(".maps");
struct {
struct
{
__uint(type, BPF_MAP_TYPE_RINGBUF);
__uint(max_entries, 256 * 1024);
} kernel_ringbuf SEC(".maps");
@@ -48,7 +50,8 @@ int kill_exit(struct trace_event_raw_sys_exit *ctx)
{
long num_samples;
int err = 0;
// receive data from userspace
num_samples = bpf_user_ringbuf_drain(&user_ringbuf, do_nothing_cb, NULL, 0);
return 0;