From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: namhyung@kernel.org, adrian.hunter@intel.com,
james.clark@linaro.org, jolsa@kernel.org,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
mingo@redhat.com, peterz@infradead.org, tmricht@linux.ibm.com
Subject: Re: [PATCH v3 0/3] perf srcline: Fix addr2line cache and fallback bugs
Date: Fri, 18 Sep 2026 17:25:43 -0300 [thread overview]
Message-ID: <aq2eR9pezbRheQgR@x2> (raw)
In-Reply-To: <20260916234402.437113-1-irogers@google.com>
On Wed, Sep 16, 2026 at 04:43:59PM -0700, Ian Rogers wrote:
> Three fixes to source line resolution, all on the addr2line paths.
>
> 1) libdw is pointed at the wrong file. dso__libdw_dwfl() opens the Dwfl
> with the name of the file the samples came from, but when the debug
> information is in a separate file, symbol loading records that as the
> dso's symsrc filename and the Dwfl is left referring to a file with
> no DWARF in it.
>
> 2) The dso addr2line cache is shared between implementations. The libbfd
> reader caches a struct a2l_data and the command line fallback caches
> a struct child_process through the same pointer, so once a dso has
> fallen back from one to the other the cached object is read back as
> the wrong type.
>
> 3) libbfd only reports success when the caller asked for a file name.
> addr2inlines() doesn't, so srcline.c treats a resolved address as a
> failure and tries the next implementation, which appends its own
> frames to the ones libbfd already appended. Every frame that isn't
> inlined is then reported twice. This is the default when perf is
> built with libbfd but without libdw:
>
> $ perf record --call-graph dwarf -- perf test -w inlineloop 1
> $ perf script --fields +srcline
> ...
> 56051a99503a inlineloop+0x8a (perf)
> inlineloop.c:47
> 56051a99503a inlineloop+0x8a (perf)
> inlineloop.c:47
> ...
>
> With addr2line.style set to "libbfd,addr2line" so the fallback is
> taken, the script output for that workload drops from 288 lines to
> 176, and each repeated frame goes from appearing 16 times to 8.
Thanks, applied to perf-tools-next, for v7.4.
- Arnaldo
prev parent reply other threads:[~2026-09-18 20:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 17:07 [PATCH v1 1/2] perf libdw: Fix Dwfl discovery with split files Ian Rogers
2026-09-14 17:07 ` [PATCH v1 2/2] perf dso: Separate libbfd and cmd addr2line caches to fix confusion Ian Rogers
2026-09-16 6:35 ` [PATCH v2 0/3] perf srcline: Fix addr2line cache and fallback bugs Ian Rogers
2026-09-16 6:35 ` [PATCH v2 1/3] perf libdw: Fix Dwfl discovery with split files Ian Rogers
2026-09-16 6:35 ` [PATCH v2 2/3] perf dso: Separate libbfd and cmd addr2line caches to fix confusion Ian Rogers
2026-09-16 6:35 ` [PATCH v2 3/3] perf libbfd: Report success when an address is found Ian Rogers
2026-09-16 23:43 ` [PATCH v3 0/3] perf srcline: Fix addr2line cache and fallback bugs Ian Rogers
2026-09-16 23:44 ` [PATCH v3 1/3] perf libdw: Fix Dwfl discovery with split files Ian Rogers
2026-09-16 23:44 ` [PATCH v3 2/3] perf dso: Separate libbfd and cmd addr2line caches to fix confusion Ian Rogers
2026-09-16 23:44 ` [PATCH v3 3/3] perf libbfd: Report success when an address is found Ian Rogers
2026-09-17 5:04 ` [PATCH v4 0/3] perf srcline: Fix addr2line cache and fallback bugs Ian Rogers
2026-09-17 5:04 ` [PATCH v4 1/3] perf libdw: Fix Dwfl discovery with split files Ian Rogers
2026-09-17 5:04 ` [PATCH v4 2/3] perf dso: Separate libbfd and cmd addr2line caches to fix confusion Ian Rogers
2026-09-17 5:04 ` [PATCH v4 3/3] perf libbfd: Report success when an address is found Ian Rogers
2026-09-18 20:25 ` 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=aq2eR9pezbRheQgR@x2 \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=tmricht@linux.ibm.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
all inboxes | Powered by JetHome®