1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2021 Facebook */
3 
4 #include "vmlinux.h"
5 
6 #include <bpf/bpf_helpers.h>
7 
8 extern const int bpf_testmod_ksym_percpu __ksym;
9 
10 int out_mod_ksym_global = 0;
11 bool triggered = false;
12 
13 SEC("raw_tp/sys_enter")
14 int handler(const void *ctx)
15 {
16 	int *val;
17 	__u32 cpu;
18 
19 	val = (int *)bpf_this_cpu_ptr(&bpf_testmod_ksym_percpu);
20 	out_mod_ksym_global = *val;
21 	triggered = true;
22 
23 	return 0;
24 }
25 
26 char LICENSE[] SEC("license") = "GPL";
27