xref: /linux/tools/testing/selftests/bpf/progs/test_autoattach.c (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2022 Google */
3 
4 #include "vmlinux.h"
5 #include <bpf/bpf_tracing.h>
6 
7 bool prog1_called = false;
8 bool prog2_called = false;
9 
10 SEC("raw_tp/sys_enter")
11 int prog1(const void *ctx)
12 {
13 	prog1_called = true;
14 	return 0;
15 }
16 
17 SEC("raw_tp/sys_exit")
18 int prog2(const void *ctx)
19 {
20 	prog2_called = true;
21 	return 0;
22 }
23 
24