Add selftest for the fill_link_info of uprobe, kprobe and tracepoint. The result: $ tools/testing/selftests/bpf/test_progs --name=fill_link_info #79/1 fill_link_info/kprobe_link_info:OK #79/2 fill_link_info/kretprobe_link_info:OK #79/3 fill_link_info/kprobe_invalid_ubuff:OK #79/4 fill_link_info/tracepoint_link_info:OK #79/5 fill_link_info/uprobe_link_info:OK #79/6 fill_link_info/uretprobe_link_info:OK #79/7 fill_link_info/kprobe_multi_link_info:OK #79/8 fill_link_info/kretprobe_multi_link_info:OK #79/9 fill_link_info/kprobe_multi_invalid_ubuff:OK #79 fill_link_info:OK Summary: 1/9 PASSED, 0 SKIPPED, 0 FAILED The test case for kprobe_multi won't be run on aarch64, as it is not supported. Signed-off-by: Yafang Shao <laoar.shao@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Yonghong Song <yonghong.song@linux.dev> Acked-by: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/bpf/20230813141900.1268-3-laoar.shao@gmail.com
42 lines
641 B
C
42 lines
641 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/* Copyright (C) 2023 Yafang Shao <laoar.shao@gmail.com> */
|
|
|
|
#include "vmlinux.h"
|
|
#include <bpf/bpf_tracing.h>
|
|
#include <stdbool.h>
|
|
|
|
extern bool CONFIG_X86_KERNEL_IBT __kconfig __weak;
|
|
|
|
/* This function is here to have CONFIG_X86_KERNEL_IBT
|
|
* used and added to object BTF.
|
|
*/
|
|
int unused(void)
|
|
{
|
|
return CONFIG_X86_KERNEL_IBT ? 0 : 1;
|
|
}
|
|
|
|
SEC("kprobe")
|
|
int BPF_PROG(kprobe_run)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
SEC("uprobe")
|
|
int BPF_PROG(uprobe_run)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
SEC("tracepoint")
|
|
int BPF_PROG(tp_run)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
SEC("kprobe.multi")
|
|
int BPF_PROG(kmulti_run)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
char _license[] SEC("license") = "GPL";
|