linux/tools/testing/selftests/bpf/progs/test_btf_ext.c
Mykyta Yatsenko b8390dd1e0 selftests/bpf: Add BTF.ext line/func info getter tests
Add selftests checking that line and func info retrieved by newly added
libbpf APIs are the same as returned by kernel via bpf_prog_get_info_by_fd.

Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250408234417.452565-3-mykyta.yatsenko5@gmail.com
2025-04-09 16:16:56 -07:00

22 lines
345 B
C

// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2025 Meta Platforms Inc. */
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
#include "bpf_misc.h"
char _license[] SEC("license") = "GPL";
__noinline static void f0(void)
{
__u64 a = 1;
__sink(a);
}
SEC("xdp")
__u64 global_func(struct xdp_md *xdp)
{
f0();
return XDP_DROP;
}