btf_encoder: ensure elf function representation is fully initialized
PATCH 1/1 btf_encoder: ensure elf function representation is fully initialized
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/[email protected]/
--- btf_encoder.c | 2 ++ 1 file changed, 2 insertions(+)
btf_encoder.c +2 -0
@@ -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 ; }
Signature · 1 line
1.8.3.1
Quoted 11 lines · Alan Maguire
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_namesguards their use.A follow-on patch intended to be applied after the series [1].
[1] https://lore.kernel.org/bpf/[email protected]/
Suggested-by Jiri Olsa <[email protected]>Signed-off-by Alan Maguire <[email protected]>
thanks,
jirka
Quoted 20 lines
--- btf_encoder.c | 2 ++ 1 file changed, 2 insertions(+)btf_encoder.c +2
-0@@ -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 ; }Signature · 1 line
1.8.3.1
Arnaldo Carvalho de Melo
AppliedEm Thu, Feb 09, 2023 at 10:36:39AM +0100, Jiri Olsa escreveu:
Quoted 6 lines · Alan Maguire
Quoted 5 lines
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_namesguards their use.
Quoted 8 lines
Quoted 6 lines
A follow-on patch intended to be applied after the series [1].
[1] https://lore.kernel.org/bpf/[email protected]/
Suggested-by Jiri Olsa <[email protected]>Signed-off-by Alan Maguire <[email protected]>Acked-by Jiri Olsa <[email protected]>
Thanks, applied.
- Arnaldo
Quoted 23 lines
thanks,
jirkaQuoted 20 lines
--- btf_encoder.c | 2 ++ 1 file changed, 2 insertions(+)btf_encoder.c +2
-0@@ -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 ; }Signature · 1 line
1.8.3.1
Signature · 1 line
- Arnaldo