Re: [PATCH dwarves 2/3] pahole: add reproducible_build to --btf_features

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 16, 2024 at 03:37:17PM +0100, Alan Maguire wrote:
> ...as a non-standard feature, so it will not be enabled for
> "--btf_features=all"

How did you test this?

⬢[acme@toolbox pahole]$ pahole --btf_features_strict=bgasd
Feature 'bgasd' in 'bgasd' is not supported.  Supported BTF features are:
encode_force,var,float,decl_tag,type_tag,enum64,optimized_func,consistent_func,reproducible_build
⬢[acme@toolbox pahole]$ pahole -j --btf_features=all,reproducible_build --btf_encode_detached=vmlinux.btf.parallel.reproducible_build-via-btf_features vmlinux
⬢[acme@toolbox pahole]$ bpftool btf dump file vmlinux.btf.parallel.reproducible_build-via-btf_features > output.vmlinux.btf.parallel.reproducible_build-via-btf_features
⬢[acme@toolbox pahole]$ diff -u output.vmlinux.btf.serial output.vmlinux.btf.parallel.reproducible
⬢[acme@toolbox pahole]$ diff -u output.vmlinux.btf.parallel.reproducible_build output.vmlinux.btf.parallel.reproducible_build-via-btf_features | head
--- output.vmlinux.btf.parallel.reproducible_build	2024-04-16 12:20:28.513462223 -0300
+++ output.vmlinux.btf.parallel.reproducible_build-via-btf_features	2024-04-16 12:23:37.792962930 -0300
@@ -265,7 +265,7 @@
 	'target' type_id=33 bits_offset=32
 	'key' type_id=43 bits_offset=64
 [164] PTR '(anon)' type_id=163
-[165] PTR '(anon)' type_id=35751
+[165] PTR '(anon)' type_id=14983
 [166] STRUCT 'static_key' size=16 vlen=2
 	'enabled' type_id=88 bits_offset=0
⬢[acme@toolbox pahole]$

I'm double checking things now...

- Arnaldo
 
> Signed-off-by: Alan Maguire <alan.maguire@xxxxxxxxxx>
> ---
>  man-pages/pahole.1 | 8 ++++++++
>  pahole.c           | 1 +
>  2 files changed, 9 insertions(+)
> 
> diff --git a/man-pages/pahole.1 b/man-pages/pahole.1
> index 2c08e97..64de343 100644
> --- a/man-pages/pahole.1
> +++ b/man-pages/pahole.1
> @@ -310,6 +310,14 @@ Encode BTF using the specified feature list, or specify 'all' for all standard f
>  	                   in different CUs.
>  .fi
>  
> +Supported non-standard features (not enabled for 'all')
> +
> +.nf
> +	reproducible_build Ensure generated BTF is consistent every time;
> +	                   without this parallel BTF encoding can result in
> +	                   inconsistent BTF ids.
> +.fi
> +
>  So for example, specifying \-\-btf_encode=var,enum64 will result in a BTF encoding that (as well as encoding basic BTF information) will contain variables and enum64 values.
>  
>  .TP
> diff --git a/pahole.c b/pahole.c
> index 890ef81..38cc636 100644
> --- a/pahole.c
> +++ b/pahole.c
> @@ -1286,6 +1286,7 @@ struct btf_feature {
>  	BTF_FEATURE(enum64, skip_encoding_btf_enum64, true, true),
>  	BTF_FEATURE(optimized_func, btf_gen_optimized, false, true),
>  	BTF_FEATURE(consistent_func, skip_encoding_btf_inconsistent_proto, false, true),
> +	BTF_FEATURE(reproducible_build, reproducible_build, false, false),
>  };
>  
>  #define BTF_MAX_FEATURE_STR	1024






[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux