1 // SPDX-License-Identifier: GPL-2.0
7 #include <bpf/bpf_helpers.h>
10 char _license[] SEC("license") = "GPL";
12 #define TASK_COMM_LEN 16
21 __uint(type, BPF_MAP_TYPE_RINGBUF);
22 } ringbuf SEC(".maps");
27 SEC("fentry/" SYS_PREFIX "sys_getpgid")
28 int test_ringbuf_n(void *ctx)
30 int cur_pid = bpf_get_current_pid_tgid() >> 32;
31 struct sample *sample;
36 sample = bpf_ringbuf_reserve(&ringbuf, sizeof(*sample), 0);
41 sample->value = value;
42 bpf_get_current_comm(sample->comm, sizeof(sample->comm));
44 bpf_ringbuf_submit(sample, 0);