mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [BUGFIX PATCH V2 2/6] perf/probe: Fix to probe a function which has no entry pc
Date: Sat, 26 Oct 2019 18:00:37 +0900	[thread overview]
Message-ID: <157208043728.16551.14171894276497201932.stgit@devnote2> (raw)
In-Reply-To: <157208041894.16551.2733647209130045685.stgit@devnote2>

Fix perf probe to probe a function which has no entry pc or
low pc but only has ranges attribute.

probe_point_search_cb() uses dwarf_entrypc() to get the
probe address, but that doesn't work for the function DIE
which has only ranges attribute. Use die_entrypc() instead.

Without this fix,
  # perf probe -D clear_tasks_mm_cpumask:0
  Probe point 'clear_tasks_mm_cpumask' not found.
    Error: Failed to add events.

With this,
  # perf probe -D clear_tasks_mm_cpumask:0
  p:probe/clear_tasks_mm_cpumask _text+632816

Reported-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Fixes: e1ecbbc3fa83 ("perf probe: Fix to handle optimized not-inlined functions")
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 tools/perf/util/probe-finder.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 2b6513e5725c..71633f55f045 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -982,7 +982,7 @@ static int probe_point_search_cb(Dwarf_Die *sp_die, void *data)
 		param->retval = find_probe_point_by_line(pf);
 	} else if (die_is_func_instance(sp_die)) {
 		/* Instances always have the entry address */
-		dwarf_entrypc(sp_die, &pf->addr);
+		die_entrypc(sp_die, &pf->addr);
 		/* But in some case the entry address is 0 */
 		if (pf->addr == 0) {
 			pr_debug("%s has no entry PC. Skipped\n",


  parent reply	other threads:[~2019-10-26  9:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-26  9:00 [BUGFIX PATCH V2 0/6] perf/probe: Additional fixes for range only functions Masami Hiramatsu
2019-10-26  9:00 ` [BUGFIX PATCH V2 1/6] perf/probe: Fix wrong address verification Masami Hiramatsu
2019-10-26  9:00 ` Masami Hiramatsu [this message]
2019-10-26  9:00 ` [BUGFIX PATCH V2 3/6] perf/probe: Fix to probe an inline function which has no entry pc Masami Hiramatsu
2019-10-26  9:00 ` [BUGFIX PATCH V2 4/6] perf/probe: Fix to list probe event with correct line number Masami Hiramatsu
2019-10-26  9:01 ` [BUGFIX PATCH V2 5/6] perf/probe: Fix to show inlined function callsite without entry_pc Masami Hiramatsu
2019-10-26  9:01 ` [BUGFIX PATCH V2 6/6] perf/probe: Fix to show ranges of variables in functions " Masami Hiramatsu
2019-10-28 14:16 ` [BUGFIX PATCH V2 0/6] perf/probe: Additional fixes for range only functions Arnaldo Carvalho de Melo
2019-10-28 14:53   ` Masami Hiramatsu

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=157208043728.16551.14171894276497201932.stgit@devnote2 \
    --to=mhiramat@kernel.org \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.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

Powered by JetHome