summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/tailcall_poke.c
blob: c78b94b75e83e600e3330f99412b9c6d9339d33b (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
26
27
28
29
30
31
32
// SPDX-License-Identifier: GPL-2.0
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>

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

struct {
	__uint(type, BPF_MAP_TYPE_PROG_ARRAY);
	__uint(max_entries, 1);
	__uint(key_size, sizeof(__u32));
	__uint(value_size, sizeof(__u32));
} jmp_table SEC(".maps");

SEC("?fentry/bpf_fentry_test1")
int BPF_PROG(test, int a)
{
	bpf_tail_call_static(ctx, &jmp_table, 0);
	return 0;
}

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

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