xref: /aosp_15_r20/external/linux-kselftest/tools/testing/selftests/bpf/progs/test_autoattach.c (revision 053f45be4e351dfd5e965df293cd45b779f579ee)
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")
prog1(const void * ctx)11 int prog1(const void *ctx)
12 {
13 	prog1_called = true;
14 	return 0;
15 }
16 
17 SEC("raw_tp/sys_exit")
prog2(const void * ctx)18 int prog2(const void *ctx)
19 {
20 	prog2_called = true;
21 	return 0;
22 }
23 
24