On Mon, Feb 13, 2023 at 07:12:33PM -0800, Alexei Starovoitov wrote: > On Thu, Feb 9, 2023 at 5:29 AM Alan Maguire <alan.maguire@xxxxxxxxxx> wrote: > > > > v1.25 of pahole supports filtering out functions with multiple > > inconsistent function prototypes or optimized-out parameters > > from the BTF representation. These present problems because > > there is no additional info in BTF saying which inconsistent > > prototype matches which function instance to help guide > > attachment, and functions with optimized-out parameters can > > lead to incorrect assumptions about register contents. > > > > So for now, filter out such functions while adding BTF > > representations for functions that have "."-suffixes > > (foo.isra.0) but not optimized-out parameters. > > > > This patch assumes changes in [1] land and pahole is bumped > > to v1.25. > > > > [1] https://lore.kernel.org/bpf/1675790102-23037-1-git-send-email-alan.maguire@xxxxxxxxxx/ > > > > Signed-off-by: Alan Maguire <alan.maguire@xxxxxxxxxx> > > Tested-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> > > > > --- > > scripts/pahole-flags.sh | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/scripts/pahole-flags.sh b/scripts/pahole-flags.sh > > index 1f1f1d3..728d551 100755 > > --- a/scripts/pahole-flags.sh > > +++ b/scripts/pahole-flags.sh > > @@ -23,5 +23,8 @@ if [ "${pahole_ver}" -ge "124" ]; then > > # see PAHOLE_HAS_LANG_EXCLUDE > > extra_paholeopt="${extra_paholeopt} --lang_exclude=rust" > > fi > > +if [ "${pahole_ver}" -ge "125" ]; then > > + extra_paholeopt="${extra_paholeopt} --skip_encoding_btf_inconsistent_proto --btf_gen_optimized" > > +fi > > We landed this too soon. > #229 tracing_struct:FAIL > is failing now. > since bpf_testmod.ko is missing a bunch of functions though they're global. > hum, didn't see this one failing.. I'll try that again jirka > I've tried a bunch of different flags and attributes, but none of them > helped. > The only thing that works is: > diff --git a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c > b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c > index 46500636d8cd..5fd0f75d5d20 100644 > --- a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c > +++ b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c > @@ -28,6 +28,7 @@ struct bpf_testmod_struct_arg_2 { > long b; > }; > > +__attribute__((optimize("-O0"))) > noinline int > bpf_testmod_test_struct_arg_1(struct bpf_testmod_struct_arg_2 a, int > b, int c) { > > We cannot do: > --- a/tools/testing/selftests/bpf/bpf_testmod/Makefile > +++ b/tools/testing/selftests/bpf/bpf_testmod/Makefile > @@ -10,7 +10,7 @@ endif > MODULES = bpf_testmod.ko > > obj-m += bpf_testmod.o > -CFLAGS_bpf_testmod.o = -I$(src) > +CFLAGS_bpf_testmod.o = -I$(src) -O0 > > The build fails due to asm stuff. > > Maybe we should make scripts/pahole-flags.sh selective > and don't apply skip_encoding_btf_inconsiste to bpf_testmod ? > > Thoughts?