On Wed, Oct 02, 2024 at 04:11:23PM +0100, Alan Maguire wrote: SNIP > >> diff --git a/man-pages/pahole.1 b/man-pages/pahole.1 > >> index 0a9d8ac..4bc2d03 100644 > >> --- a/man-pages/pahole.1 > >> +++ b/man-pages/pahole.1 > >> @@ -230,7 +230,10 @@ the debugging information. > >> > >> .TP > >> .B \-\-skip_encoding_btf_vars > >> -Do not encode VARs in BTF. > >> +.TQ > >> +.B \-\-encode_btf_global_vars > >> +By default, VARs are encoded only for percpu variables. These options allow > >> +to skip encoding them, or alternatively to encode all global variables too. > >> > >> .TP > >> .B \-\-skip_encoding_btf_decl_tag > >> @@ -296,7 +299,8 @@ Encode BTF using the specified feature list, or specify 'default' for all standa > >> encode_force Ignore invalid symbols when encoding BTF; for example > >> if a symbol has an invalid name, it will be ignored > >> and BTF encoding will continue. > >> - var Encode variables using BTF_KIND_VAR in BTF. > >> + var Encode percpu variables using BTF_KIND_VAR in BTF. > >> + global_var Encode all global variables in the same way. > > > > hi, > > I tried to test this but I'm not getting DATASEC sections in the BTF, > > is the change below enough to enable this in kernel build? > > > > Yep, that looks right to me and it's what I did to test with kernel > builds. For me that was enough to get datasecs and all global variables, > but if it doesn't work at your end we can take a look. Thanks! I managed to get all that by running pahole directly, will check it closely with the new version of that patchset thanks, jirka > > Stephen, maybe for the respun patches we could add a note to the cover > letter on how to test with kernel builds? Thanks! > > Alan > > > thanks, > > jirka > > > > > > --- > > diff --git a/scripts/Makefile.btf b/scripts/Makefile.btf > > index b75f09f3f424..c88d9e526426 100644 > > --- a/scripts/Makefile.btf > > +++ b/scripts/Makefile.btf > > @@ -19,7 +19,7 @@ pahole-flags-$(call test-ge, $(pahole-ver), 125) += --skip_encoding_btf_inconsis > > else > > > > # Switch to using --btf_features for v1.26 and later. > > -pahole-flags-$(call test-ge, $(pahole-ver), 126) = -j --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func,decl_tag_kfuncs > > +pahole-flags-$(call test-ge, $(pahole-ver), 126) = -j --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func,decl_tag_kfuncs,global_var > > > > ifneq ($(KBUILD_EXTMOD),) > > module-pahole-flags-$(call test-ge, $(pahole-ver), 126) += --btf_features=distilled_base >