1 // SPDX-License-Identifier: GPL-2.0-only
3 #include <bpf/bpf_helpers.h>
4 #include <bpf/bpf_endian.h>
6 #define TEST_COMM_LEN 16
9 __uint(type, BPF_MAP_TYPE_CGROUP_ARRAY);
10 __uint(max_entries, 1);
13 } cgroup_map SEC(".maps");
15 char _license[] SEC("license") = "GPL";
18 int test_skb_helpers(struct __sk_buff *skb)
20 struct task_struct *task;
21 char comm[TEST_COMM_LEN];
24 task = (struct task_struct *)bpf_get_current_task();
25 bpf_probe_read_kernel(&tpid , sizeof(tpid), &task->tgid);
26 bpf_probe_read_kernel_str(&comm, sizeof(comm), &task->comm);