staging: rtl8192u: remove redundant assignment to pointer crypt
[linux/fpc-iii.git] / tools / testing / selftests / bpf / progs / test_perf_buffer.c
blob876c27deb65a3333e1cdfb460c8e4c6dda16cd03
1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (c) 2019 Facebook
4 #include <linux/ptrace.h>
5 #include <linux/bpf.h>
6 #include "bpf_helpers.h"
8 struct {
9 __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY);
10 __uint(key_size, sizeof(int));
11 __uint(value_size, sizeof(int));
12 } perf_buf_map SEC(".maps");
14 SEC("kprobe/sys_nanosleep")
15 int handle_sys_nanosleep_entry(struct pt_regs *ctx)
17 int cpu = bpf_get_smp_processor_id();
19 bpf_perf_event_output(ctx, &perf_buf_map, BPF_F_CURRENT_CPU,
20 &cpu, sizeof(cpu));
21 return 0;
24 char _license[] SEC("license") = "GPL";
25 __u32 _version SEC("version") = 1;