dwarves/pahole testing
Hello Dwarves community,
I have a set of changes that add support for "btf_type_tag" attached to the hosting type, as discussed in [1]. I'd like to test these changes before submitting via this mailing list. I have some local tests for the feature itself and I checked that kernel build / BPF selftests work as expected. Are there any additional tests I can run?
Maybe some manual testing procedures?
Thanks,
Eduard
[1] https://github.com/eddyz87/dwarves
Dwarves update to support btf_type_tag:v2
[2] https://lore.kernel.org/bpf/[email protected]/
Discussion about update for btf_type_tag encoding in DWARF
Em Thu, Feb 23, 2023 at 10:47:55PM +0200, Eduard Zingerman escreveu:
Quoted 8 lines
Hello Dwarves community,
I have a set of changes that add support for "
btf_type_tag" attached to the hosting type, as discussed in [1]. I'd like to test these changes before submitting via this mailing list. I have some local tests for the feature itself and I checked that kernel build / BPF selftests work as expected. Are there any additional tests I can run?
Maybe some manual testing procedures?
You may want to test using 'btfdiff vmlinux' after encoding BTF from DWARF.
Quoted 8 lines
Thanks,
Eduard[1] https://github.com/eddyz87/dwarves
Dwarves update to support btf_type_tag:v2
[2] https://lore.kernel.org/bpf/[email protected]/
Discussion about update forbtf_type_tagencoding in DWARF
Quoted 10 lines · Arnaldo Carvalho de Melo
Em Thu, Feb 23, 2023 at 10:47:55PM +0200, Eduard Zingerman escreveu:
Quoted 8 lines
Hello Dwarves community,
I have a set of changes that add support for "
btf_type_tag" attached to the hosting type, as discussed in [1]. I'd like to test these changes before submitting via this mailing list. I have some local tests for the feature itself and I checked that kernel build / BPF selftests work as expected. Are there any additional tests I can run?
Maybe some manual testing procedures?
Quoted 2 lines
You may want to test using 'btfdiff vmlinux' after encoding BTF from DWARF.
Hi Arnaldo,
Thank you for the recommendation.
I've noticed that with my config this method might get a bit non-deterministic because of the following two data structures:
drivers/net/ethernet/intel/e1000/e1000_param.c:
struct e1000_option {
...
union {
...
struct {
int nr;
const struct e1000_opt_list { int i; char *str; } *p;
^^^^^
this const is not present below
} l;
} arg;
};drivers/net/ethernet/intel/e1000e/param.c:
struct e1000_option {
...
union {
...
struct {
int nr;
struct e1000_opt_list { int i; char *str; } *p;
} l;
} arg;
};Both are present in the BTF.
As far as I understand, which one would be picked by "pahole -F btf --sort" depends on exact order of types in the BTF, because:
- pahole.c:type__compare_members_types() does not compare fields for inline structures;
- pahole.c:type__compare_members_types() ignores qualifiers;
- hence, pahole.c:resort_add() considers these types identical.
I can try to modify the comparison function to address both points and thus generate both versions of the struct e1000_option in the output. Is it worth doing?
Thanks,
Eduard
Quoted 9 lines
Quoted 9 lines
Thanks,
Eduard[1] https://github.com/eddyz87/dwarves
Dwarves update to support btf_type_tag:v2
[2] https://lore.kernel.org/bpf/[email protected]/
Discussion about update forbtf_type_tagencoding in DWARF
Em Sat, Mar 04, 2023 at 03:31:16AM +0200, Eduard Zingerman escreveu:
Quoted 47 lines · Arnaldo Carvalho de Melo
Quoted 10 lines
Em Thu, Feb 23, 2023 at 10:47:55PM +0200, Eduard Zingerman escreveu:
Quoted 8 lines
Hello Dwarves community,
I have a set of changes that add support for "
btf_type_tag" attached to the hosting type, as discussed in [1]. I'd like to test these changes before submitting via this mailing list. I have some local tests for the feature itself and I checked that kernel build / BPF selftests work as expected. Are there any additional tests I can run?
Maybe some manual testing procedures?Quoted 2 lines
You may want to test using 'btfdiff vmlinux' after encoding BTF from DWARF.
Hi Arnaldo,
Thank you for the recommendation.
I've noticed that with my config this method might get a bit non-deterministic because of the following two data structures:
drivers/net/ethernet/intel/e1000/e1000_param.c:struct e1000_option { ... union { ... struct { int nr; const struct e1000_opt_list { int i; char *str; } *p; ^^^^^ this const is not present below } l; } arg; };
drivers/net/ethernet/intel/e1000e/param.c:struct e1000_option { ... union { ... struct { int nr; struct e1000_opt_list { int i; char *str; } *p; } l; } arg; };
Quoted 1 line
Both are present in the BTF.
Ok, and you are linking those two drivers statically, so it gets into vmlinux, which is something I had never tried.
Quoted 11 lines
As far as I understand, which one would be picked by "pahole -F btf --sort" depends on exact order of types in the BTF, because:
-pahole.c:type__compare_members_types()does not compare fields for inline structures;
-pahole.c:type__compare_members_types()ignores qualifiers;
- hence,pahole.c:resort_add()considers these types identical.I can try to modify the comparison function to address both points and thus generate both versions of the
struct e1000_optionin the output. Is it worth doing?
I think so, comparing what we get from DWARF with what we get from BTF showed to be useful so far, even with some insurmountable differences, those options in btfdiff to change the output.
- Arnaldo