xref: /linux/tools/testing/selftests/bpf/progs/uprobe_multi_consumers.c (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/bpf.h>
3 #include <bpf/bpf_helpers.h>
4 #include <bpf/bpf_tracing.h>
5 #include <stdbool.h>
6 #include "bpf_kfuncs.h"
7 #include "bpf_misc.h"
8 
9 char _license[] SEC("license") = "GPL";
10 
11 __u64 uprobe_result[4];
12 
13 SEC("uprobe.multi")
14 int uprobe_0(struct pt_regs *ctx)
15 {
16 	uprobe_result[0]++;
17 	return 0;
18 }
19 
20 SEC("uprobe.multi")
21 int uprobe_1(struct pt_regs *ctx)
22 {
23 	uprobe_result[1]++;
24 	return 0;
25 }
26 
27 SEC("uprobe.multi")
28 int uprobe_2(struct pt_regs *ctx)
29 {
30 	uprobe_result[2]++;
31 	return 0;
32 }
33 
34 SEC("uprobe.multi")
35 int uprobe_3(struct pt_regs *ctx)
36 {
37 	uprobe_result[3]++;
38 	return 0;
39 }
40