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