drm/ssd130x: Set SPI .id_table to prevent an SPI core warning
[drm/drm-misc.git] / samples / bpf / trace_output.bpf.c
blob565a73b51b04a0e05cdca9fe6787b686e75df85a
1 #include "vmlinux.h"
2 #include <linux/version.h>
3 #include <bpf/bpf_helpers.h>
5 struct {
6 __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY);
7 __uint(key_size, sizeof(int));
8 __uint(value_size, sizeof(u32));
9 __uint(max_entries, 2);
10 } my_map SEC(".maps");
12 SEC("ksyscall/write")
13 int bpf_prog1(struct pt_regs *ctx)
15 struct S {
16 u64 pid;
17 u64 cookie;
18 } data;
20 data.pid = bpf_get_current_pid_tgid();
21 data.cookie = 0x12345678;
23 bpf_perf_event_output(ctx, &my_map, 0, &data, sizeof(data));
25 return 0;
28 char _license[] SEC("license") = "GPL";
29 u32 _version SEC("version") = LINUX_VERSION_CODE;