dwarves.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [question] dwarves/pahole testing
@ 2023-02-23 20:47 Eduard Zingerman
  2023-02-28 20:24 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: Eduard Zingerman @ 2023-02-23 20:47 UTC (permalink / raw)
  To: dwarves; +Cc: arnaldo.melo

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/87r0w9jjoq.fsf@oracle.com/
    Discussion about update for btf_type_tag encoding in DWARF


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

* Re: [question] dwarves/pahole testing
  2023-02-23 20:47 [question] dwarves/pahole testing Eduard Zingerman
@ 2023-02-28 20:24 ` Arnaldo Carvalho de Melo
  2023-03-04  1:31   ` Eduard Zingerman
  0 siblings, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-02-28 20:24 UTC (permalink / raw)
  To: Eduard Zingerman; +Cc: dwarves, arnaldo.melo

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

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

* Re: [question] dwarves/pahole testing
  2023-02-28 20:24 ` Arnaldo Carvalho de Melo
@ 2023-03-04  1:31   ` Eduard Zingerman
  2023-03-04  2:13     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: Eduard Zingerman @ 2023-03-04  1:31 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: dwarves

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@oracle.com/
> >     Discussion about update for btf_type_tag encoding in DWARF
> > 


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

* Re: [question] dwarves/pahole testing
  2023-03-04  1:31   ` Eduard Zingerman
@ 2023-03-04  2:13     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-03-04  2:13 UTC (permalink / raw)
  To: Eduard Zingerman; +Cc: Arnaldo Carvalho de Melo, dwarves

Em Sat, Mar 04, 2023 at 03:31:16AM +0200, Eduard Zingerman escreveu:
> 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.

Ok, and you are linking those two drivers statically, so it gets into
vmlinux, which is something I had never tried.
 
> 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?

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

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

end of thread, other threads:[~2023-03-04  2:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23 20:47 [question] dwarves/pahole testing Eduard Zingerman
2023-02-28 20:24 ` Arnaldo Carvalho de Melo
2023-03-04  1:31   ` Eduard Zingerman
2023-03-04  2:13     ` Arnaldo Carvalho de Melo

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).