From: Henry Castro <hcvcastro@gmail.com>
To: namhyung@kernel.org
Cc: Henry Castro <hcvcastro@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] perf: fix the probe finder location (.dwo files)
Date: Thu, 29 Sep 2022 16:59:57 -0400 [thread overview]
Message-ID: <20220929205958.22225-1-hcvcastro@gmail.com> (raw)
If the file object is compiled using -gsplit-dwarf,
the probe finder location will fail.
Signed-off-by: Henry Castro <hcvcastro@gmail.com>
---
tools/perf/util/probe-finder.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 50d861a80f57..6d7c5461251d 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -1161,7 +1161,8 @@ static int debuginfo__find_probe_location(struct debuginfo *dbg,
struct perf_probe_point *pp = &pf->pev->point;
Dwarf_Off off, noff;
size_t cuhl;
- Dwarf_Die *diep;
+ Dwarf_Die *diep, cudie, subdie;
+ uint8_t unit_type;
int ret = 0;
off = 0;
@@ -1200,6 +1201,14 @@ static int debuginfo__find_probe_location(struct debuginfo *dbg,
continue;
}
+ /* Check separate debug information file. */
+ if (dwarf_cu_info(pf->cu_die.cu, NULL, &unit_type, &cudie,
+ &subdie, NULL, NULL, NULL))
+ continue;
+
+ if (unit_type == DW_UT_skeleton)
+ pf->cu_die = subdie;
+
/* Check if target file is included. */
if (pp->file)
pf->fname = cu_find_realpath(&pf->cu_die, pp->file);
--
2.20.1
next reply other threads:[~2022-09-29 21:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-29 20:59 Henry Castro [this message]
2022-09-30 17:19 ` [PATCH] perf: fix the probe finder location (.dwo files) Namhyung Kim
2022-10-03 18:16 ` [PATCH v2] " Henry Castro
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=20220929205958.22225-1-hcvcastro@gmail.com \
--to=hcvcastro@gmail.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/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 NNTP newsgroup(s).