dwarves.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv4 0/3] pahole/kernel: Workaround dwarf bug for function encoding
@ 2020-11-06 22:25 Jiri Olsa
  2020-11-06 22:25 ` [PATCH 1/3] bpf: Move iterator functions into special init section Jiri Olsa
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Jiri Olsa @ 2020-11-06 22:25 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: dwarves, bpf, Alexei Starovoitov, Andrii Nakryiko, Yonghong Song,
	Hao Luo, Frank Ch. Eigler, Mark Wielaard

hi,
because of gcc bug [1] we can no longer rely on DW_AT_declaration
attribute to filter out declarations and end up with just
one copy of the function in the BTF data.

It seems this bug is not easy to fix, but regardless if the
it's coming soon, it's probably good idea not to depend so
much only on dwarf data and make some extra checks.

Thus for function encoding we are now doing following checks:
  - argument names are defined for the function
  - there's symbol and address defined for the function
  - function address belongs to ftrace locations (new in v2)
  - function is generated only once

v4 changes:
  - added acks
  - renames and change functions_valid to be local var [Andrii]
  - fixed error path (return err) of collect_symbols

v3 changes:
  - added Hao's ack for patch 1
  - fixed realloc memory leak [Andrii]
  - fixed addrs_cmp function [Andrii]
  - removed SET_SYMBOL macro [Andrii]
  - fixed the 'valid' function logic
  - added .init.bpf.preserve_type check
  - added iterator functions to new kernel section
    .init.bpf.preserve_type [Yonghong]

v2 changes:
  - add check ensuring functions belong to ftrace's mcount
    locations, this way we ensure to have in BTF only
    functions available for ftrace - patch 2 changelog
    describes all details
  - use collect* function names [Andrii]
  - use conventional size increase in realloc [Andrii]
  - drop elf_sym__is_function check
  - drop patch 3, it's not needed, because we follow ftrace
    locations

thanks,
jirka


[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97060


^ permalink raw reply	[flat|nested] 20+ messages in thread
* [PATCHv3 0/3] pahole/kernel: Workaround dwarf bug for function encoding
@ 2020-11-04 21:59 Jiri Olsa
  2020-11-04 21:59 ` [PATCH 1/3] bpf: Move iterator functions into special init section Jiri Olsa
  0 siblings, 1 reply; 20+ messages in thread
From: Jiri Olsa @ 2020-11-04 21:59 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: dwarves, bpf, Alexei Starovoitov, Andrii Nakryiko, Yonghong Song,
	Hao Luo, Frank Ch. Eigler, Mark Wielaard

hi,
because of gcc bug [1] we can no longer rely on DW_AT_declaration
attribute to filter out declarations and end up with just
one copy of the function in the BTF data.

It seems this bug is not easy to fix, but regardless if the
it's coming soon, it's probably good idea not to depend so
much only on dwarf data and make some extra checks.

Thus for function encoding we are now doing following checks:
  - argument names are defined for the function
  - there's symbol and address defined for the function
  - function address belongs to ftrace locations (new in v2)
  - function is generated only once

v3 changes:
  - added Hao's ack for patch 1
  - fixed realloc memory leak [Andrii]
  - fixed addrs_cmp function [Andrii]
  - removed SET_SYMBOL macro [Andrii]
  - fixed the 'valid' function logic
  - added .init.bpf.preserve_type check
  - added iterator functions to new kernel section
    .init.bpf.preserve_type [Yonghong]

v2 changes:
  - add check ensuring functions belong to ftrace's mcount
    locations, this way we ensure to have in BTF only
    functions available for ftrace - patch 2 changelog
    describes all details
  - use collect* function names [Andrii]
  - use conventional size increase in realloc [Andrii]
  - drop elf_sym__is_function check
  - drop patch 3, it's not needed, because we follow ftrace
    locations

thanks,
jirka


[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97060


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-11-12  1:34 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-06 22:25 [PATCHv4 0/3] pahole/kernel: Workaround dwarf bug for function encoding Jiri Olsa
2020-11-06 22:25 ` [PATCH 1/3] bpf: Move iterator functions into special init section Jiri Olsa
2020-11-09 18:05   ` Arnaldo Carvalho de Melo
2020-11-09 18:06     ` Arnaldo Carvalho de Melo
2020-11-09 18:10       ` Arnaldo Carvalho de Melo
2020-11-09 18:49       ` Jiri Olsa
2020-11-06 22:25 ` [PATCH 2/3] btf_encoder: Move find_all_percpu_vars in generic collect_symbols Jiri Olsa
2020-11-06 22:25 ` [PATCH 3/3] btf_encoder: Change functions check due to broken dwarf Jiri Olsa
2020-11-11 19:59   ` Andrii Nakryiko
2020-11-11 20:19     ` Jiri Olsa
2020-11-11 20:26       ` Andrii Nakryiko
2020-11-11 20:49         ` Jiri Olsa
2020-11-11 20:31       ` Jiri Olsa
2020-11-11 20:36         ` Andrii Nakryiko
2020-11-12  0:36           ` Arnaldo Carvalho de Melo
2020-11-06 22:56 ` [PATCHv4 0/3] pahole/kernel: Workaround dwarf bug for function encoding Andrii Nakryiko
2020-11-09 17:29   ` Arnaldo Carvalho de Melo
2020-11-09 19:11     ` Arnaldo Carvalho de Melo
  -- strict thread matches above, loose matches on Subject: below --
2020-11-04 21:59 [PATCHv3 " Jiri Olsa
2020-11-04 21:59 ` [PATCH 1/3] bpf: Move iterator functions into special init section Jiri Olsa
2020-11-05  1:01   ` Song Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).