summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/kprobe_multi_sleepable.c
blob: 932e1d9c72e2d0835a862f8be22ca2f69706d326 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// SPDX-License-Identifier: GPL-2.0

#include "vmlinux.h"
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>

void *user_ptr = 0;

SEC("kprobe.multi")
int handle_kprobe_multi_sleepable(struct pt_regs *ctx)
{
	int a, err;

	err = bpf_copy_from_user(&a, sizeof(a), user_ptr);
	barrier_var(a);
	return err;
}

SEC("fentry/bpf_fentry_test1")
int BPF_PROG(fentry)
{
	return 0;
}

char _license[] SEC("license") = "GPL";