1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (c) 2019 Facebook
4 #include <linux/ptrace.h>
6 #include <bpf/bpf_helpers.h>
7 #include <bpf/bpf_tracing.h>
10 __uint(type
, BPF_MAP_TYPE_PERF_EVENT_ARRAY
);
11 __uint(key_size
, sizeof(int));
12 __uint(value_size
, sizeof(int));
13 } perf_buf_map
SEC(".maps");
15 SEC("tp/raw_syscalls/sys_enter")
16 int handle_sys_enter(void *ctx
)
18 int cpu
= bpf_get_smp_processor_id();
20 bpf_perf_event_output(ctx
, &perf_buf_map
, BPF_F_CURRENT_CPU
,
25 char _license
[] SEC("license") = "GPL";