Dwarves debugging tools
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Jiri Olsa <jolsa@kernel.org>,
	dwarves@vger.kernel.org, bpf <bpf@vger.kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andriin@fb.com>, Yonghong Song <yhs@fb.com>,
	Hao Luo <haoluo@google.com>
Subject: Re: [RFC/PATCH 3/3] btf_encoder: Func generation fix
Date: Fri, 13 Nov 2020 08:52:31 -0300	[thread overview]
Message-ID: <20201113115231.GC394182@kernel.org> (raw)
In-Reply-To: <20201113105923.GC753418@krava>

Em Fri, Nov 13, 2020 at 11:59:23AM +0100, Jiri Olsa escreveu:
> On Thu, Nov 12, 2020 at 04:08:02PM -0800, Andrii Nakryiko wrote:
> > On Thu, Nov 12, 2020 at 1:14 PM Jiri Olsa <jolsa@redhat.com> wrote:
> > > On Thu, Nov 12, 2020 at 11:54:41AM -0800, Andrii Nakryiko wrote:
> > > > So I can't unfortunately reproduce that GCC bug with DWARF info. What
> > > > was exactly the symptom? Maybe you can also share readelf -wi dump for
> > > > your problematic vmlinux?

> > > hum, can't see -wi working for readelf, however I placed my vmlinux
> > > in here:
> > >   http://people.redhat.com/~jolsa/vmlinux.gz

> > > the symptom is that resolve_btfids will fail kernel build:

> > >   BTFIDS  vmlinux
> > > FAILED unresolved symbol vfs_getattr

> > > because BTF data contains multiple FUNC records for same function

> > > and the problem is that declaration tag itself is missing:
> > >   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97060
> > > so pahole won't skip them

> > > the first workaround was to workaround that and go for function
> > > records that have code address attached, but that's buggy as well:
> > >   https://bugzilla.redhat.com/show_bug.cgi?id=1890107

> > > then after some discussions we ended up using ftrace addresses
> > > as filter for what we want to display.. plus we got static functions
> > > as well

> > > however for this way we failed to get proper arguments ;-)

> > Right, I followed along overall, but forgot the details of the initial
> > problem. Thanks for the refresher. See below for my current thoughts
> > on dealing with all this.

I'll add this to the set of regression tests I use with pahole:

[acme@five vfs_gettattr.multiple.btf.entries.jolsa]$ bpftool btf dump file vmlinux | grep -w FUNC | cut -d\' -f2 | sort | uniq -c | sort -nr | head
      3 __x64_sys_userfaultfd
      3 __x64_sys_timerfd_settime
      3 __x64_sys_timerfd_gettime
      3 __x64_sys_timerfd_create
      3 __x64_sys_syslog
      3 __x64_sys_sysfs
      3 __x64_sys_swapon
      3 __x64_sys_swapoff
      3 __x64_sys_socketpair
      3 __x64_sys_socket
[acme@five vfs_gettattr.multiple.btf.entries.jolsa]$ pfunct -F btf vmlinux | sort | uniq -c | sort -nr | head
      3 __x64_sys_userfaultfd
      3 __x64_sys_timerfd_settime
      3 __x64_sys_timerfd_gettime
      3 __x64_sys_timerfd_create
      3 __x64_sys_syslog
      3 __x64_sys_sysfs
      3 __x64_sys_swapon
      3 __x64_sys_swapoff
      3 __x64_sys_socketpair
      3 __x64_sys_socket
[acme@five vfs_gettattr.multiple.btf.entries.jolsa]$

I.e. the output of those tools need to match and all functions need to
appear only once.

I'll also use pfunct with -F dwarf to get the same results, probably
will add these to the 'btfdiff' tool that is in the pahole git repo.

- Arnaldo

      reply	other threads:[~2020-11-13 12:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12 15:05 [RFC 0/3] btf_encoder: Fix functions BTF data generation Jiri Olsa
2020-11-12 15:05 ` [RFC/PATCH 1/3] btf_encoder: Generate also .init functions Jiri Olsa
2020-11-12 19:37   ` Andrii Nakryiko
2020-11-12 15:05 ` [RFC/PATCH 2/3] btf_encoder: Put function generation code to generate_func Jiri Olsa
2020-11-12 19:39   ` Andrii Nakryiko
2020-11-12 15:05 ` [RFC/PATCH 3/3] btf_encoder: Func generation fix Jiri Olsa
2020-11-12 19:54   ` Andrii Nakryiko
2020-11-12 21:14     ` Jiri Olsa
2020-11-13  0:08       ` Andrii Nakryiko
2020-11-13  0:18         ` Alexei Starovoitov
2020-11-13  0:30           ` Andrii Nakryiko
2020-11-13  1:00             ` Yonghong Song
2020-11-13  1:12               ` Andrii Nakryiko
2020-11-13 10:59         ` Jiri Olsa
2020-11-13 11:52           ` 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=20201113115231.GC394182@kernel.org \
    --to=acme@kernel.org \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=dwarves@vger.kernel.org \
    --cc=haoluo@google.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=yhs@fb.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