diff mbox series

[dwarves] btf_encoder: ensure elf function representation is fully initialized

Message ID 1675896868-26339-1-git-send-email-alan.maguire@oracle.com (mailing list archive)
State Not Applicable
Delegated to: BPF
Headers show
Series [dwarves] btf_encoder: ensure elf function representation is fully initialized | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch
bpf/vmtest-bpf-PR success PR summary
bpf/vmtest-bpf-VM_Test-1 success Logs for ShellCheck
bpf/vmtest-bpf-VM_Test-2 success Logs for build for aarch64 with gcc
bpf/vmtest-bpf-VM_Test-3 success Logs for build for aarch64 with llvm-16
bpf/vmtest-bpf-VM_Test-4 success Logs for build for s390x with gcc
bpf/vmtest-bpf-VM_Test-5 success Logs for build for x86_64 with gcc
bpf/vmtest-bpf-VM_Test-6 success Logs for build for x86_64 with llvm-16
bpf/vmtest-bpf-VM_Test-7 success Logs for llvm-toolchain
bpf/vmtest-bpf-VM_Test-8 success Logs for set-matrix
bpf/vmtest-bpf-VM_Test-9 success Logs for test_maps on aarch64 with gcc
bpf/vmtest-bpf-VM_Test-10 success Logs for test_maps on aarch64 with llvm-16
bpf/vmtest-bpf-VM_Test-11 success Logs for test_maps on s390x with gcc
bpf/vmtest-bpf-VM_Test-12 success Logs for test_maps on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-13 success Logs for test_maps on x86_64 with llvm-16
bpf/vmtest-bpf-VM_Test-14 success Logs for test_progs on aarch64 with gcc
bpf/vmtest-bpf-VM_Test-15 success Logs for test_progs on aarch64 with llvm-16
bpf/vmtest-bpf-VM_Test-16 success Logs for test_progs on s390x with gcc
bpf/vmtest-bpf-VM_Test-17 success Logs for test_progs on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-18 success Logs for test_progs on x86_64 with llvm-16
bpf/vmtest-bpf-VM_Test-19 success Logs for test_progs_no_alu32 on aarch64 with gcc
bpf/vmtest-bpf-VM_Test-20 success Logs for test_progs_no_alu32 on aarch64 with llvm-16
bpf/vmtest-bpf-VM_Test-21 success Logs for test_progs_no_alu32 on s390x with gcc
bpf/vmtest-bpf-VM_Test-22 success Logs for test_progs_no_alu32 on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-23 success Logs for test_progs_no_alu32 on x86_64 with llvm-16
bpf/vmtest-bpf-VM_Test-24 success Logs for test_progs_no_alu32_parallel on aarch64 with gcc
bpf/vmtest-bpf-VM_Test-25 success Logs for test_progs_no_alu32_parallel on aarch64 with llvm-16
bpf/vmtest-bpf-VM_Test-26 success Logs for test_progs_no_alu32_parallel on s390x with gcc
bpf/vmtest-bpf-VM_Test-27 success Logs for test_progs_no_alu32_parallel on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-28 success Logs for test_progs_no_alu32_parallel on x86_64 with llvm-16
bpf/vmtest-bpf-VM_Test-29 success Logs for test_progs_parallel on aarch64 with gcc
bpf/vmtest-bpf-VM_Test-30 success Logs for test_progs_parallel on aarch64 with llvm-16
bpf/vmtest-bpf-VM_Test-31 success Logs for test_progs_parallel on s390x with gcc
bpf/vmtest-bpf-VM_Test-32 success Logs for test_progs_parallel on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-33 success Logs for test_progs_parallel on x86_64 with llvm-16
bpf/vmtest-bpf-VM_Test-34 success Logs for test_verifier on aarch64 with gcc
bpf/vmtest-bpf-VM_Test-35 success Logs for test_verifier on aarch64 with llvm-16
bpf/vmtest-bpf-VM_Test-36 success Logs for test_verifier on s390x with gcc
bpf/vmtest-bpf-VM_Test-37 success Logs for test_verifier on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-38 success Logs for test_verifier on x86_64 with llvm-16

Commit Message

Alan Maguire Feb. 8, 2023, 10:54 p.m. UTC
new fields in BTF encoder state (used to support save and later
addition of function) of ELF function representation need to
be initialized.  No need to set parameter names to NULL as
got_parameter_names guards their use.

A follow-on patch intended to be applied after the series [1].

[1] https://lore.kernel.org/bpf/1675790102-23037-1-git-send-email-alan.maguire@oracle.com/

Suggested-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
---
 btf_encoder.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jiri Olsa Feb. 9, 2023, 9:36 a.m. UTC | #1
On Wed, Feb 08, 2023 at 10:54:28PM +0000, Alan Maguire wrote:
> new fields in BTF encoder state (used to support save and later
> addition of function) of ELF function representation need to
> be initialized.  No need to set parameter names to NULL as
> got_parameter_names guards their use.
> 
> A follow-on patch intended to be applied after the series [1].
> 
> [1] https://lore.kernel.org/bpf/1675790102-23037-1-git-send-email-alan.maguire@oracle.com/
> 
> Suggested-by: Jiri Olsa <jolsa@kernel.org>
> Signed-off-by: Alan Maguire <alan.maguire@oracle.com>

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka

> ---
>  btf_encoder.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/btf_encoder.c b/btf_encoder.c
> index 35fb60a..ea5b47b 100644
> --- a/btf_encoder.c
> +++ b/btf_encoder.c
> @@ -1020,6 +1020,8 @@ static int btf_encoder__collect_function(struct btf_encoder *encoder, GElf_Sym *
>  	}
>  	encoder->functions.entries[encoder->functions.cnt].generated = false;
>  	encoder->functions.entries[encoder->functions.cnt].function = NULL;
> +	encoder->functions.entries[encoder->functions.cnt].state.got_parameter_names = false;
> +	encoder->functions.entries[encoder->functions.cnt].state.type_id_off = 0;
>  	encoder->functions.cnt++;
>  	return 0;
>  }
> -- 
> 1.8.3.1
>
Arnaldo Carvalho de Melo Feb. 9, 2023, 11:59 a.m. UTC | #2
Em Thu, Feb 09, 2023 at 10:36:39AM +0100, Jiri Olsa escreveu:
> On Wed, Feb 08, 2023 at 10:54:28PM +0000, Alan Maguire wrote:
> > new fields in BTF encoder state (used to support save and later
> > addition of function) of ELF function representation need to
> > be initialized.  No need to set parameter names to NULL as
> > got_parameter_names guards their use.
> > 
> > A follow-on patch intended to be applied after the series [1].
> > 
> > [1] https://lore.kernel.org/bpf/1675790102-23037-1-git-send-email-alan.maguire@oracle.com/
> > 
> > Suggested-by: Jiri Olsa <jolsa@kernel.org>
> > Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
> 
> Acked-by: Jiri Olsa <jolsa@kernel.org>

Thanks, applied.

- Arnaldo

 
> thanks,
> jirka
> 
> > ---
> >  btf_encoder.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/btf_encoder.c b/btf_encoder.c
> > index 35fb60a..ea5b47b 100644
> > --- a/btf_encoder.c
> > +++ b/btf_encoder.c
> > @@ -1020,6 +1020,8 @@ static int btf_encoder__collect_function(struct btf_encoder *encoder, GElf_Sym *
> >  	}
> >  	encoder->functions.entries[encoder->functions.cnt].generated = false;
> >  	encoder->functions.entries[encoder->functions.cnt].function = NULL;
> > +	encoder->functions.entries[encoder->functions.cnt].state.got_parameter_names = false;
> > +	encoder->functions.entries[encoder->functions.cnt].state.type_id_off = 0;
> >  	encoder->functions.cnt++;
> >  	return 0;
> >  }
> > -- 
> > 1.8.3.1
> >
diff mbox series

Patch

diff --git a/btf_encoder.c b/btf_encoder.c
index 35fb60a..ea5b47b 100644
--- a/btf_encoder.c
+++ b/btf_encoder.c
@@ -1020,6 +1020,8 @@  static int btf_encoder__collect_function(struct btf_encoder *encoder, GElf_Sym *
 	}
 	encoder->functions.entries[encoder->functions.cnt].generated = false;
 	encoder->functions.entries[encoder->functions.cnt].function = NULL;
+	encoder->functions.entries[encoder->functions.cnt].state.got_parameter_names = false;
+	encoder->functions.entries[encoder->functions.cnt].state.type_id_off = 0;
 	encoder->functions.cnt++;
 	return 0;
 }