Dwarves Archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Eduard Zingerman <eddyz87@gmail.com>
Cc: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>,
	dwarves@vger.kernel.org
Subject: Re: [question] dwarves/pahole testing
Date: Fri, 3 Mar 2023 23:13:56 -0300	[thread overview]
Message-ID: <ZAKpZGSHTvsS4r8E@kernel.org> (raw)
In-Reply-To: <62cd4979a4080f3529f1bdf61639c6feb490af01.camel@gmail.com>

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

      reply	other threads:[~2023-03-04  2:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZAKpZGSHTvsS4r8E@kernel.org \
    --to=acme@kernel.org \
    --cc=arnaldo.melo@gmail.com \
    --cc=dwarves@vger.kernel.org \
    --cc=eddyz87@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).