bcc: powerpc: libbpf: failed to find BTF for extern 'PT_REGS_PARM1': -2
(I try to package libbpf-tools
from bcc
for ALT Linux.) On ppc64le and aarch64 architectures libbpf-tools
fail to compile in GEN-SKEL
, because of bpftool
error. Actual cause seems to be the clang compilation warnings shown below:
builder@powerpc64le:~/RPM/BUILD/bcc-0.18.0/libbpf-tools$ clang -g -O2 -target bpf -D__TARGET_ARCH_ppc64le -I.output -c biosnoop.bpf.c -o .output/biosnoop.bpf.o
biosnoop.bpf.c:65:5: warning: implicit declaration of function 'PT_REGS_PARM1' is invalid in C99 [-Wimplicit-function-declaration]
int BPF_KPROBE(blk_account_io_merge_bio, struct request *rq)
^
.output/bpf/bpf_tracing.h:385:20: note: expanded from macro 'BPF_KPROBE'
return ____##name(___bpf_kprobe_args(args)); \
^
.output/bpf/bpf_tracing.h:365:2: note: expanded from macro '___bpf_kprobe_args'
___bpf_apply(___bpf_kprobe_args, ___bpf_narg(args))(args)
^
.output/bpf/bpf_tracing.h:299:29: note: expanded from macro '___bpf_apply'
#define ___bpf_apply(fn, n) ___bpf_concat(fn, n)
^
.output/bpf/bpf_tracing.h:298:29: note: expanded from macro '___bpf_concat'
#define ___bpf_concat(a, b) a ## b
^
<scratch space>:18:1: note: expanded from here
___bpf_kprobe_args1
^
.output/bpf/bpf_tracing.h:355:33: note: expanded from macro '___bpf_kprobe_args1'
___bpf_kprobe_args0(), (void *)PT_REGS_PARM1(ctx)
^
biosnoop.bpf.c:65:5: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
.output/bpf/bpf_tracing.h:385:20: note: expanded from macro 'BPF_KPROBE'
return ____##name(___bpf_kprobe_args(args)); \
^
.output/bpf/bpf_tracing.h:365:2: note: expanded from macro '___bpf_kprobe_args'
___bpf_apply(___bpf_kprobe_args, ___bpf_narg(args))(args)
^
.output/bpf/bpf_tracing.h:299:29: note: expanded from macro '___bpf_apply'
#define ___bpf_apply(fn, n) ___bpf_concat(fn, n)
^
.output/bpf/bpf_tracing.h:298:29: note: expanded from macro '___bpf_concat'
#define ___bpf_concat(a, b) a ## b
^
<scratch space>:18:1: note: expanded from here
___bpf_kprobe_args1
^
.output/bpf/bpf_tracing.h:355:25: note: expanded from macro '___bpf_kprobe_args1'
___bpf_kprobe_args0(), (void *)PT_REGS_PARM1(ctx)
^
2 warnings generated.
builder@powerpc64le:~/RPM/BUILD/bcc-0.18.0/libbpf-tools$ /usr/sbin/bpftool gen skeleton .output/biosnoop.bpf.o > .output/biosnoop.skel.h
libbpf: failed to find BTF for extern 'PT_REGS_PARM1': -2
Error: failed to open BPF object file: No such file or directory
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 22 (22 by maintainers)
@vt-alt, would you mind submitting a PR to update https://github.com/libbpf/libbpf#bpf-co-re-compile-once--run-everywhere to mention these details? Thanks!
It would be great if you could coordinate with @olsajiri on location and naming (see https://github.com/iovisor/bcc/pull/3263#issuecomment-774301083).
@vt-alt, thanks, that’s what’s needed, I hope. Please give https://github.com/iovisor/bcc/pull/3265 a go and see if it works on your architectures. Thanks!