diff mbox series

[v2,bpf-next,6/9] btf: generate BTF kind layout for vmlinux/module BTF

Message ID 20230616171728.530116-7-alan.maguire@oracle.com (mailing list archive)
State Changes Requested
Delegated to: BPF
Headers show
Series bpf: support BTF kind layout info, CRCs | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for bpf-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers success CCed 12 of 12 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 13 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next-PR success PR summary
bpf/vmtest-bpf-next-VM_Test-1 success Logs for ShellCheck
bpf/vmtest-bpf-next-VM_Test-2 success Logs for build for aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-4 success Logs for build for x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-5 success Logs for build for x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-6 success Logs for set-matrix
bpf/vmtest-bpf-next-VM_Test-3 success Logs for build for s390x with gcc
bpf/vmtest-bpf-next-VM_Test-7 success Logs for test_maps on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-9 success Logs for test_maps on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-10 success Logs for test_maps on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-17 fail Logs for test_progs_no_alu32 on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-19 success Logs for test_progs_no_alu32_parallel on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-20 success Logs for test_progs_no_alu32_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-21 success Logs for test_progs_no_alu32_parallel on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-22 success Logs for test_progs_parallel on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-23 success Logs for test_progs_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-24 success Logs for test_progs_parallel on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-25 success Logs for test_verifier on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-27 success Logs for test_verifier on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-28 success Logs for test_verifier on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-29 success Logs for veristat
bpf/vmtest-bpf-next-VM_Test-11 fail Logs for test_progs on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-13 fail Logs for test_progs on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-14 fail Logs for test_progs on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-15 fail Logs for test_progs_no_alu32 on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-18 fail Logs for test_progs_no_alu32 on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-26 success Logs for test_verifier on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-12 fail Logs for test_progs on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-16 fail Logs for test_progs_no_alu32 on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-8 success Logs for test_maps on s390x with gcc

Commit Message

Alan Maguire June 16, 2023, 5:17 p.m. UTC
Generate BTF kind layout information, crcs for kernel and module BTF
if support is available in pahole.

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
---
 scripts/pahole-flags.sh | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

kernel test robot June 16, 2023, 6:53 p.m. UTC | #1
Hi Alan,

kernel test robot noticed the following build errors:

[auto build test ERROR on bpf-next/master]

url:    https://github.com/intel-lab-lkp/linux/commits/Alan-Maguire/btf-add-kind-layout-encoding-crcs-to-UAPI/20230617-012110
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link:    https://lore.kernel.org/r/20230616171728.530116-7-alan.maguire%40oracle.com
patch subject: [PATCH v2 bpf-next 6/9] btf: generate BTF kind layout for vmlinux/module BTF
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20230617/202306170238.L0eHQOJd-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230617/202306170238.L0eHQOJd-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306170238.L0eHQOJd-lkp@intel.com/

All errors (new ones prefixed by >>):

>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
--
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   loongarch64-linux-gcc: error: unrecognized command-line option '-mexplicit-relocs'
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
>> scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   loongarch64-linux-gcc: error: unrecognized command-line option '-mexplicit-relocs'
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
   scripts/pahole-flags.sh: 29: [[: not found
   scripts/pahole-flags.sh: 32: [[: not found
Jiri Olsa June 18, 2023, 1:07 p.m. UTC | #2
On Fri, Jun 16, 2023 at 06:17:24PM +0100, Alan Maguire wrote:
> Generate BTF kind layout information, crcs for kernel and module BTF
> if support is available in pahole.
> 
> Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
> ---
>  scripts/pahole-flags.sh | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/scripts/pahole-flags.sh b/scripts/pahole-flags.sh
> index 728d55190d97..cb304e0a4434 100755
> --- a/scripts/pahole-flags.sh
> +++ b/scripts/pahole-flags.sh
> @@ -25,6 +25,13 @@ if [ "${pahole_ver}" -ge "124" ]; then
>  fi
>  if [ "${pahole_ver}" -ge "125" ]; then
>  	extra_paholeopt="${extra_paholeopt} --skip_encoding_btf_inconsistent_proto --btf_gen_optimized"
> +	pahole_help="$(${PAHOLE} --help)"

nice ;-)

> +	if [[ "$pahole_help" =~ "btf_gen_kind_layout" ]]; then
> +		extra_paholeopt="${extra_paholeopt} --btf_gen_kind_layout"
> +	fi
> +	if [[ "$pahole_help" =~ "btf_gen_crc" ]]; then
> +		extra_paholeopt="${extra_paholeopt} --btf_gen_crc"
> +	fi

do we need to have an option to enable crc? could it be by default?

it's sort of related to the layout changes and I wonder we will want
'not to have it' if there's support for it in BTF

jirka

>  fi
>  
>  echo ${extra_paholeopt}
> -- 
> 2.39.3
>
Alan Maguire June 20, 2023, 8:46 a.m. UTC | #3
On 18/06/2023 14:07, Jiri Olsa wrote:
> On Fri, Jun 16, 2023 at 06:17:24PM +0100, Alan Maguire wrote:
>> Generate BTF kind layout information, crcs for kernel and module BTF
>> if support is available in pahole.
>>
>> Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
>> ---
>>  scripts/pahole-flags.sh | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/scripts/pahole-flags.sh b/scripts/pahole-flags.sh
>> index 728d55190d97..cb304e0a4434 100755
>> --- a/scripts/pahole-flags.sh
>> +++ b/scripts/pahole-flags.sh
>> @@ -25,6 +25,13 @@ if [ "${pahole_ver}" -ge "124" ]; then
>>  fi
>>  if [ "${pahole_ver}" -ge "125" ]; then
>>  	extra_paholeopt="${extra_paholeopt} --skip_encoding_btf_inconsistent_proto --btf_gen_optimized"
>> +	pahole_help="$(${PAHOLE} --help)"
> 
> nice ;-)
> 
>> +	if [[ "$pahole_help" =~ "btf_gen_kind_layout" ]]; then
>> +		extra_paholeopt="${extra_paholeopt} --btf_gen_kind_layout"
>> +	fi
>> +	if [[ "$pahole_help" =~ "btf_gen_crc" ]]; then
>> +		extra_paholeopt="${extra_paholeopt} --btf_gen_crc"
>> +	fi
> 
> do we need to have an option to enable crc? could it be by default?
> 
> it's sort of related to the layout changes and I wonder we will want
> 'not to have it' if there's support for it in BTF
> 

I'm reluctant to enable by default yet because without CRC and kind
layout the new header format will work on older kernels too.  With
the kind layout len/offset 0 and CRCs 0, the header is just slightly
larger than the original.

I originally combined the two in the metadata section header, but
I think as separate concepts it makes sense to have separate
flags.

Thanks!

Alan

> jirka
> 
>>  fi
>>  
>>  echo ${extra_paholeopt}
>> -- 
>> 2.39.3
>>
diff mbox series

Patch

diff --git a/scripts/pahole-flags.sh b/scripts/pahole-flags.sh
index 728d55190d97..cb304e0a4434 100755
--- a/scripts/pahole-flags.sh
+++ b/scripts/pahole-flags.sh
@@ -25,6 +25,13 @@  if [ "${pahole_ver}" -ge "124" ]; then
 fi
 if [ "${pahole_ver}" -ge "125" ]; then
 	extra_paholeopt="${extra_paholeopt} --skip_encoding_btf_inconsistent_proto --btf_gen_optimized"
+	pahole_help="$(${PAHOLE} --help)"
+	if [[ "$pahole_help" =~ "btf_gen_kind_layout" ]]; then
+		extra_paholeopt="${extra_paholeopt} --btf_gen_kind_layout"
+	fi
+	if [[ "$pahole_help" =~ "btf_gen_crc" ]]; then
+		extra_paholeopt="${extra_paholeopt} --btf_gen_crc"
+	fi
 fi
 
 echo ${extra_paholeopt}