Re: [question] dwarves/pahole testing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2023-02-28 at 17:24 -0300, Arnaldo Carvalho de Melo wrote:
> Em Thu, Feb 23, 2023 at 10:47:55PM +0200, Eduard Zingerman escreveu:
> > 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.

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

>  
> > Thanks,
> > Eduard
> > 
> > [1] https://github.com/eddyz87/dwarves
> >     Dwarves update to support btf_type_tag:v2
> > [2] https://lore.kernel.org/bpf/87r0w9jjoq.fsf@xxxxxxxxxx/
> >     Discussion about update for btf_type_tag encoding in DWARF
> > 





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux