diff mbox series

[dwarves,v4,1/2] pahole: Add --btf_feature=decl_tag_kfuncs feature

Message ID bd8f705a5c11b14571563a63045416233f9d06f1.1707071969.git.dxu@dxuuu.xyz (mailing list archive)
State Not Applicable
Delegated to: BPF
Headers show
Series pahole: Inject kfunc decl tags into BTF | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch
bpf/vmtest-bpf-PR fail merge-conflict
bpf/vmtest-bpf-VM_Test-3 success Logs for Validate matrix.py
bpf/vmtest-bpf-VM_Test-2 success Logs for Unittests
bpf/vmtest-bpf-VM_Test-12 success Logs for s390x-gcc / build-release
bpf/vmtest-bpf-VM_Test-9 success Logs for aarch64-gcc / test (test_verifier, false, 360) / test_verifier on aarch64 with gcc
bpf/vmtest-bpf-VM_Test-17 success Logs for s390x-gcc / veristat
bpf/vmtest-bpf-VM_Test-7 success Logs for aarch64-gcc / test (test_progs, false, 360) / test_progs on aarch64 with gcc
bpf/vmtest-bpf-VM_Test-14 success Logs for s390x-gcc / test (test_progs, false, 360) / test_progs on s390x with gcc
bpf/vmtest-bpf-VM_Test-15 success Logs for s390x-gcc / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on s390x with gcc
bpf/vmtest-bpf-VM_Test-1 success Logs for ShellCheck
bpf/vmtest-bpf-VM_Test-5 success Logs for aarch64-gcc / build-release
bpf/vmtest-bpf-VM_Test-21 success Logs for x86_64-gcc / test (test_maps, false, 360) / test_maps on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-27 fail Logs for x86_64-gcc / veristat / veristat on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-16 success Logs for s390x-gcc / test (test_verifier, false, 360) / test_verifier on s390x with gcc
bpf/vmtest-bpf-VM_Test-4 success Logs for aarch64-gcc / build / build for aarch64 with gcc
bpf/vmtest-bpf-VM_Test-18 success Logs for set-matrix
bpf/vmtest-bpf-VM_Test-10 success Logs for aarch64-gcc / veristat
bpf/vmtest-bpf-VM_Test-19 success Logs for x86_64-gcc / build / build for x86_64 with gcc
bpf/vmtest-bpf-VM_Test-11 success Logs for s390x-gcc / build / build for s390x with gcc
bpf/vmtest-bpf-VM_Test-41 success Logs for x86_64-llvm-18 / test (test_verifier, false, 360) / test_verifier on x86_64 with llvm-18
bpf/vmtest-bpf-VM_Test-31 success Logs for x86_64-llvm-17 / test (test_progs, false, 360) / test_progs on x86_64 with llvm-17
bpf/vmtest-bpf-VM_Test-40 success Logs for x86_64-llvm-18 / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with llvm-18
bpf/vmtest-bpf-VM_Test-23 success Logs for x86_64-gcc / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-24 success Logs for x86_64-gcc / test (test_progs_no_alu32_parallel, true, 30) / test_progs_no_alu32_parallel on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-25 success Logs for x86_64-gcc / test (test_progs_parallel, true, 30) / test_progs_parallel on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-32 success Logs for x86_64-llvm-17 / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with llvm-17
bpf/vmtest-bpf-VM_Test-34 success Logs for x86_64-llvm-17 / veristat
bpf/vmtest-bpf-VM_Test-26 success Logs for x86_64-gcc / test (test_verifier, false, 360) / test_verifier on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-20 success Logs for x86_64-gcc / build-release
bpf/vmtest-bpf-VM_Test-8 success Logs for aarch64-gcc / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on aarch64 with gcc
bpf/vmtest-bpf-VM_Test-33 success Logs for x86_64-llvm-17 / test (test_verifier, false, 360) / test_verifier on x86_64 with llvm-17
bpf/vmtest-bpf-VM_Test-37 success Logs for x86_64-llvm-18 / test (test_maps, false, 360) / test_maps on x86_64 with llvm-18
bpf/vmtest-bpf-VM_Test-42 success Logs for x86_64-llvm-18 / veristat
bpf/vmtest-bpf-VM_Test-36 success Logs for x86_64-llvm-18 / build-release / build for x86_64 with llvm-18 and -O2 optimization
bpf/vmtest-bpf-VM_Test-29 success Logs for x86_64-llvm-17 / build-release / build for x86_64 with llvm-17 and -O2 optimization
bpf/vmtest-bpf-VM_Test-22 success Logs for x86_64-gcc / test (test_progs, false, 360) / test_progs on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-6 success Logs for aarch64-gcc / test (test_maps, false, 360) / test_maps on aarch64 with gcc
bpf/vmtest-bpf-VM_Test-35 success Logs for x86_64-llvm-18 / build / build for x86_64 with llvm-18
bpf/vmtest-bpf-VM_Test-30 success Logs for x86_64-llvm-17 / test (test_maps, false, 360) / test_maps on x86_64 with llvm-17
bpf/vmtest-bpf-VM_Test-39 success Logs for x86_64-llvm-18 / test (test_progs_cpuv4, false, 360) / test_progs_cpuv4 on x86_64 with llvm-18
bpf/vmtest-bpf-VM_Test-38 success Logs for x86_64-llvm-18 / test (test_progs, false, 360) / test_progs on x86_64 with llvm-18
bpf/vmtest-bpf-VM_Test-0 success Logs for Lint
bpf/vmtest-bpf-VM_Test-28 success Logs for x86_64-llvm-17 / build / build for x86_64 with llvm-17
bpf/vmtest-bpf-VM_Test-13 success Logs for s390x-gcc / test (test_maps, false, 360) / test_maps on s390x with gcc

Commit Message

Daniel Xu Feb. 4, 2024, 6:40 p.m. UTC
Add a feature flag to guard tagging of kfuncs. The next commit will
implement the actual tagging.

Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
---
 btf_encoder.c | 2 ++
 dwarves.h     | 1 +
 pahole.c      | 1 +
 3 files changed, 4 insertions(+)

Comments

Jiri Olsa Feb. 6, 2024, 12:47 p.m. UTC | #1
On Sun, Feb 04, 2024 at 11:40:37AM -0700, Daniel Xu wrote:
> Add a feature flag to guard tagging of kfuncs. The next commit will
> implement the actual tagging.
> 
> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
> ---
>  btf_encoder.c | 2 ++
>  dwarves.h     | 1 +
>  pahole.c      | 1 +
>  3 files changed, 4 insertions(+)

we should update man page as well

also we need to update the kernel's scripts/Makefile.btf with
the new option for the next pahole version (1.26 I guess)

jirka

> 
> diff --git a/btf_encoder.c b/btf_encoder.c
> index fd04008..e325f66 100644
> --- a/btf_encoder.c
> +++ b/btf_encoder.c
> @@ -77,6 +77,7 @@ struct btf_encoder {
>  			  verbose,
>  			  force,
>  			  gen_floats,
> +			  tag_kfuncs,
>  			  is_rel;
>  	uint32_t	  array_index_id;
>  	struct {
> @@ -1642,6 +1643,7 @@ struct btf_encoder *btf_encoder__new(struct cu *cu, const char *detached_filenam
>  		encoder->force		 = conf_load->btf_encode_force;
>  		encoder->gen_floats	 = conf_load->btf_gen_floats;
>  		encoder->skip_encoding_vars = conf_load->skip_encoding_btf_vars;
> +		encoder->tag_kfuncs	 = conf_load->btf_decl_tag_kfuncs;
>  		encoder->verbose	 = verbose;
>  		encoder->has_index_type  = false;
>  		encoder->need_index_type = false;
> diff --git a/dwarves.h b/dwarves.h
> index 857b37c..996eb70 100644
> --- a/dwarves.h
> +++ b/dwarves.h
> @@ -87,6 +87,7 @@ struct conf_load {
>  	bool			skip_encoding_btf_vars;
>  	bool			btf_gen_floats;
>  	bool			btf_encode_force;
> +	bool			btf_decl_tag_kfuncs;
>  	uint8_t			hashtable_bits;
>  	uint8_t			max_hashtable_bits;
>  	uint16_t		kabi_prefix_len;
> diff --git a/pahole.c b/pahole.c
> index 768a2fe..48c19b7 100644
> --- a/pahole.c
> +++ b/pahole.c
> @@ -1278,6 +1278,7 @@ struct btf_feature {
>  	BTF_FEATURE(enum64, skip_encoding_btf_enum64, true),
>  	BTF_FEATURE(optimized_func, btf_gen_optimized, false),
>  	BTF_FEATURE(consistent_func, skip_encoding_btf_inconsistent_proto, false),
> +	BTF_FEATURE(decl_tag_kfuncs, btf_decl_tag_kfuncs, false),
>  };
>  
>  #define BTF_MAX_FEATURE_STR	1024
> -- 
> 2.42.1
>
Alan Maguire Feb. 6, 2024, 2:14 p.m. UTC | #2
On 06/02/2024 12:47, Jiri Olsa wrote:
> On Sun, Feb 04, 2024 at 11:40:37AM -0700, Daniel Xu wrote:
>> Add a feature flag to guard tagging of kfuncs. The next commit will
>> implement the actual tagging.
>>
>> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>

Reviewed-by: Alan Maguire <alan.maguire@oracle.com>

Thanks for adding this!

>> ---
>>  btf_encoder.c | 2 ++
>>  dwarves.h     | 1 +
>>  pahole.c      | 1 +
>>  3 files changed, 4 insertions(+)
> 
> we should update man page as well
> 
> also we need to update the kernel's scripts/Makefile.btf with
> the new option for the next pahole version (1.26 I guess)
>

Yep, something like this added to scripts/Makefile.btf
should do it:

pahole-flags-$(call test-ge, $(pahole-ver), 126)       = -j
--lang_exclude=rust
--btf_features=encode_force,var,float,decl_tag,type_tag,enum64,optimized_func,consistent_func,tag_kfuncs

This should hopefully be the last version check we need - we can
just add features to the list as required, and pahole will apply the
ones it knows about. Thanks!

Alan

> jirka
> 
>>
>> diff --git a/btf_encoder.c b/btf_encoder.c
>> index fd04008..e325f66 100644
>> --- a/btf_encoder.c
>> +++ b/btf_encoder.c
>> @@ -77,6 +77,7 @@ struct btf_encoder {
>>  			  verbose,
>>  			  force,
>>  			  gen_floats,
>> +			  tag_kfuncs,
>>  			  is_rel;
>>  	uint32_t	  array_index_id;
>>  	struct {
>> @@ -1642,6 +1643,7 @@ struct btf_encoder *btf_encoder__new(struct cu *cu, const char *detached_filenam
>>  		encoder->force		 = conf_load->btf_encode_force;
>>  		encoder->gen_floats	 = conf_load->btf_gen_floats;
>>  		encoder->skip_encoding_vars = conf_load->skip_encoding_btf_vars;
>> +		encoder->tag_kfuncs	 = conf_load->btf_decl_tag_kfuncs;
>>  		encoder->verbose	 = verbose;
>>  		encoder->has_index_type  = false;
>>  		encoder->need_index_type = false;
>> diff --git a/dwarves.h b/dwarves.h
>> index 857b37c..996eb70 100644
>> --- a/dwarves.h
>> +++ b/dwarves.h
>> @@ -87,6 +87,7 @@ struct conf_load {
>>  	bool			skip_encoding_btf_vars;
>>  	bool			btf_gen_floats;
>>  	bool			btf_encode_force;
>> +	bool			btf_decl_tag_kfuncs;
>>  	uint8_t			hashtable_bits;
>>  	uint8_t			max_hashtable_bits;
>>  	uint16_t		kabi_prefix_len;
>> diff --git a/pahole.c b/pahole.c
>> index 768a2fe..48c19b7 100644
>> --- a/pahole.c
>> +++ b/pahole.c
>> @@ -1278,6 +1278,7 @@ struct btf_feature {
>>  	BTF_FEATURE(enum64, skip_encoding_btf_enum64, true),
>>  	BTF_FEATURE(optimized_func, btf_gen_optimized, false),
>>  	BTF_FEATURE(consistent_func, skip_encoding_btf_inconsistent_proto, false),
>> +	BTF_FEATURE(decl_tag_kfuncs, btf_decl_tag_kfuncs, false),
>>  };
>>  
>>  #define BTF_MAX_FEATURE_STR	1024
>> -- 
>> 2.42.1
>>
diff mbox series

Patch

diff --git a/btf_encoder.c b/btf_encoder.c
index fd04008..e325f66 100644
--- a/btf_encoder.c
+++ b/btf_encoder.c
@@ -77,6 +77,7 @@  struct btf_encoder {
 			  verbose,
 			  force,
 			  gen_floats,
+			  tag_kfuncs,
 			  is_rel;
 	uint32_t	  array_index_id;
 	struct {
@@ -1642,6 +1643,7 @@  struct btf_encoder *btf_encoder__new(struct cu *cu, const char *detached_filenam
 		encoder->force		 = conf_load->btf_encode_force;
 		encoder->gen_floats	 = conf_load->btf_gen_floats;
 		encoder->skip_encoding_vars = conf_load->skip_encoding_btf_vars;
+		encoder->tag_kfuncs	 = conf_load->btf_decl_tag_kfuncs;
 		encoder->verbose	 = verbose;
 		encoder->has_index_type  = false;
 		encoder->need_index_type = false;
diff --git a/dwarves.h b/dwarves.h
index 857b37c..996eb70 100644
--- a/dwarves.h
+++ b/dwarves.h
@@ -87,6 +87,7 @@  struct conf_load {
 	bool			skip_encoding_btf_vars;
 	bool			btf_gen_floats;
 	bool			btf_encode_force;
+	bool			btf_decl_tag_kfuncs;
 	uint8_t			hashtable_bits;
 	uint8_t			max_hashtable_bits;
 	uint16_t		kabi_prefix_len;
diff --git a/pahole.c b/pahole.c
index 768a2fe..48c19b7 100644
--- a/pahole.c
+++ b/pahole.c
@@ -1278,6 +1278,7 @@  struct btf_feature {
 	BTF_FEATURE(enum64, skip_encoding_btf_enum64, true),
 	BTF_FEATURE(optimized_func, btf_gen_optimized, false),
 	BTF_FEATURE(consistent_func, skip_encoding_btf_inconsistent_proto, false),
+	BTF_FEATURE(decl_tag_kfuncs, btf_decl_tag_kfuncs, false),
 };
 
 #define BTF_MAX_FEATURE_STR	1024