ARM: dts: exynos: Add initial gpio setting of MMC2 device for exynos3250-monk
[linux/fpc-iii.git] / samples / bpf / trace_output_kern.c
blob8d8d1ec429eb6761b0d29b30299536ac782779c5
1 #include <linux/ptrace.h>
2 #include <linux/version.h>
3 #include <uapi/linux/bpf.h>
4 #include "bpf_helpers.h"
6 struct bpf_map_def SEC("maps") my_map = {
7 .type = BPF_MAP_TYPE_PERF_EVENT_ARRAY,
8 .key_size = sizeof(int),
9 .value_size = sizeof(u32),
10 .max_entries = 2,
13 SEC("kprobe/sys_write")
14 int bpf_prog1(struct pt_regs *ctx)
16 struct S {
17 u64 pid;
18 u64 cookie;
19 } data;
21 memset(&data, 0, sizeof(data));
22 data.pid = bpf_get_current_pid_tgid();
23 data.cookie = 0x12345678;
25 bpf_perf_event_output(ctx, &my_map, 0, &data, sizeof(data));
27 return 0;
30 char _license[] SEC("license") = "GPL";
31 u32 _version SEC("version") = LINUX_VERSION_CODE;