xref: /openbmc/linux/tools/testing/selftests/bpf/progs/test_link_pinning.c (revision ead5d1f4d877e92c051e1a1ade623d0d30e71619)
1*6489b8e1SAndrii Nakryiko // SPDX-License-Identifier: GPL-2.0
2*6489b8e1SAndrii Nakryiko /* Copyright (c) 2020 Facebook */
3*6489b8e1SAndrii Nakryiko 
4*6489b8e1SAndrii Nakryiko #include <stdbool.h>
5*6489b8e1SAndrii Nakryiko #include <linux/bpf.h>
6*6489b8e1SAndrii Nakryiko #include <bpf/bpf_helpers.h>
7*6489b8e1SAndrii Nakryiko 
8*6489b8e1SAndrii Nakryiko int in = 0;
9*6489b8e1SAndrii Nakryiko int out = 0;
10*6489b8e1SAndrii Nakryiko 
11*6489b8e1SAndrii Nakryiko SEC("raw_tp/sys_enter")
raw_tp_prog(const void * ctx)12*6489b8e1SAndrii Nakryiko int raw_tp_prog(const void *ctx)
13*6489b8e1SAndrii Nakryiko {
14*6489b8e1SAndrii Nakryiko 	out = in;
15*6489b8e1SAndrii Nakryiko 	return 0;
16*6489b8e1SAndrii Nakryiko }
17*6489b8e1SAndrii Nakryiko 
18*6489b8e1SAndrii Nakryiko SEC("tp_btf/sys_enter")
tp_btf_prog(const void * ctx)19*6489b8e1SAndrii Nakryiko int tp_btf_prog(const void *ctx)
20*6489b8e1SAndrii Nakryiko {
21*6489b8e1SAndrii Nakryiko 	out = in;
22*6489b8e1SAndrii Nakryiko 	return 0;
23*6489b8e1SAndrii Nakryiko }
24*6489b8e1SAndrii Nakryiko 
25*6489b8e1SAndrii Nakryiko char _license[] SEC("license") = "GPL";
26