On Mon, Aug 26, 2024 at 11:52:13AM -0300, Arnaldo Carvalho de Melo wrote: > On Fri, Aug 23, 2024 at 05:28:30PM -0400, Will Hawkins wrote: > > First, > > > > I am a huge fan of pahole (and friends). I volunteered to work on > > helping to edit the BTF spec for the IETF and so I've started to look > > more deeply at BTF and the tools. > > > > Second, I hope that what I am offering is being sent to the right place > > and is in the right format. I tried to follow what seems to be the > > "right thing" by looking at mailing list archives. > > > > This patch add supports to the btf_loader for subprogram (BTF_KIND_FUNC) > > linkages. For example, > > > > ``` > > $ cat a.c > > static int x() { > > return 5; > > } > > $ gcc -gbtf -g -O0 -c a.c > > $ ~/code/pahole/build/pfunct -Fbtf --compile a.o > > int x(void) /* linkage=static */ > > { > > return 0; > > } > > ``` > > So, I'm changing this to become: > > $ ~/code/pahole/build/pfunct -Fbtf --compile a.o > static int x(void) > { > return 0; > } > > As --compile is supposed to generate compileable code that is as much as > possible from the type information similar to the original code, ok? I see, your patch isn't the one adding that linkage comment, you're just collecting it from BTF, I'll then add a followup patch to get to the output I described. - Arnaldo