FILE
test_fill_link_info.c
File preview with syntax highlighting.
linux-6.19.14/tools/testing/selftests/bpf/progs/test_fill_link_info.c
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";
~/
Read-only file preview.