Loading...
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright (C) 2023 Yafang Shao <laoar.shao@gmail.com> */
3
4#include "vmlinux.h"
5#include <bpf/bpf_tracing.h>
6#include <stdbool.h>
7
8extern bool CONFIG_X86_KERNEL_IBT __kconfig __weak;
9extern bool CONFIG_PPC_FTRACE_OUT_OF_LINE __kconfig __weak;
10extern bool CONFIG_KPROBES_ON_FTRACE __kconfig __weak;
11extern bool CONFIG_PPC64 __kconfig __weak;
12
13/* This function is here to have CONFIG_X86_KERNEL_IBT,
14 * CONFIG_PPC_FTRACE_OUT_OF_LINE, CONFIG_KPROBES_ON_FTRACE,
15 * CONFIG_PPC6 used and added to object BTF.
16 */
17int unused(void)
18{
19 return CONFIG_X86_KERNEL_IBT ||
20 CONFIG_PPC_FTRACE_OUT_OF_LINE ||
21 CONFIG_KPROBES_ON_FTRACE ||
22 CONFIG_PPC64 ? 0 : 1;
23}
24
25SEC("kprobe")
26int BPF_PROG(kprobe_run)
27{
28 return 0;
29}
30
31SEC("uprobe")
32int BPF_PROG(uprobe_run)
33{
34 return 0;
35}
36
37SEC("tracepoint")
38int BPF_PROG(tp_run)
39{
40 return 0;
41}
42
43SEC("perf_event")
44int event_run(void *ctx)
45{
46 return 0;
47}
48
49SEC("kprobe.multi")
50int BPF_PROG(kmulti_run)
51{
52 return 0;
53}
54
55SEC("uprobe.multi")
56int BPF_PROG(umulti_run)
57{
58 return 0;
59}
60
61char _license[] SEC("license") = "GPL";
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright (C) 2023 Yafang Shao <laoar.shao@gmail.com> */
3
4#include "vmlinux.h"
5#include <bpf/bpf_tracing.h>
6#include <stdbool.h>
7
8extern bool CONFIG_X86_KERNEL_IBT __kconfig __weak;
9
10/* This function is here to have CONFIG_X86_KERNEL_IBT
11 * used and added to object BTF.
12 */
13int unused(void)
14{
15 return CONFIG_X86_KERNEL_IBT ? 0 : 1;
16}
17
18SEC("kprobe")
19int BPF_PROG(kprobe_run)
20{
21 return 0;
22}
23
24SEC("uprobe")
25int BPF_PROG(uprobe_run)
26{
27 return 0;
28}
29
30SEC("tracepoint")
31int BPF_PROG(tp_run)
32{
33 return 0;
34}
35
36SEC("kprobe.multi")
37int BPF_PROG(kmulti_run)
38{
39 return 0;
40}
41
42SEC("uprobe.multi")
43int BPF_PROG(umulti_run)
44{
45 return 0;
46}
47
48char _license[] SEC("license") = "GPL";