From: "tip-bot2 for Masami Hiramatsu" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Ingo Molnar <mingo@kernel.org>, Borislav Petkov <bp@alien8.de>,
linux-kernel@vger.kernel.org
Subject: [tip: perf/core] perf probe: Fix to show inlined function callsite without entry_pc
Date: Tue, 12 Nov 2019 11:18:08 -0000 [thread overview]
Message-ID: <157355748875.29376.11117050115980321569.tip-bot2@tip-bot2> (raw)
In-Reply-To: <157199322107.8075.12659099000567865708.stgit@devnote2>
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 18e21eb671dc87a4f0546ba505a89ea93598a634
Gitweb: https://git.kernel.org/tip/18e21eb671dc87a4f0546ba505a89ea93598a634
Author: Masami Hiramatsu <mhiramat@kernel.org>
AuthorDate: Fri, 25 Oct 2019 17:47:01 +09:00
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitterDate: Wed, 06 Nov 2019 15:43:06 -03:00
perf probe: Fix to show inlined function callsite without entry_pc
Fix 'perf probe --line' option to show inlined function callsite lines
even if the function DIE has only ranges.
Without this:
# perf probe -L amd_put_event_constraints
...
2 {
3 if (amd_has_nb(cpuc) && amd_is_nb_event(&event->hw))
__amd_put_nb_event_constraints(cpuc, event);
5 }
With this patch:
# perf probe -L amd_put_event_constraints
...
2 {
3 if (amd_has_nb(cpuc) && amd_is_nb_event(&event->hw))
4 __amd_put_nb_event_constraints(cpuc, event);
5 }
Committer testing:
Before:
[root@quaco ~]# perf probe -L amd_put_event_constraints
<amd_put_event_constraints@/usr/src/debug/kernel-5.2.fc30/linux-5.2.18-200.fc30.x86_64/arch/x86/events/amd/core.c:0>
0 static void amd_put_event_constraints(struct cpu_hw_events *cpuc,
struct perf_event *event)
2 {
3 if (amd_has_nb(cpuc) && amd_is_nb_event(&event->hw))
__amd_put_nb_event_constraints(cpuc, event);
5 }
PMU_FORMAT_ATTR(event, "config:0-7,32-35");
PMU_FORMAT_ATTR(umask, "config:8-15" );
[root@quaco ~]#
After:
[root@quaco ~]# perf probe -L amd_put_event_constraints
<amd_put_event_constraints@/usr/src/debug/kernel-5.2.fc30/linux-5.2.18-200.fc30.x86_64/arch/x86/events/amd/core.c:0>
0 static void amd_put_event_constraints(struct cpu_hw_events *cpuc,
struct perf_event *event)
2 {
3 if (amd_has_nb(cpuc) && amd_is_nb_event(&event->hw))
4 __amd_put_nb_event_constraints(cpuc, event);
5 }
PMU_FORMAT_ATTR(event, "config:0-7,32-35");
PMU_FORMAT_ATTR(umask, "config:8-15" );
[root@quaco ~]# perf probe amd_put_event_constraints:4
Added new event:
probe:amd_put_event_constraints (on amd_put_event_constraints:4)
You can now use it in all perf tools, such as:
perf record -e probe:amd_put_event_constraints -aR sleep 1
[root@quaco ~]#
[root@quaco ~]# perf probe -l
probe:amd_put_event_constraints (on amd_put_event_constraints:4@arch/x86/events/amd/core.c)
probe:clear_tasks_mm_cpumask (on clear_tasks_mm_cpumask@kernel/cpu.c)
[root@quaco ~]#
Using it:
[root@quaco ~]# perf trace -e probe:*
^C[root@quaco ~]#
Ok, Intel system here... :-)
Fixes: 4cc9cec636e7 ("perf probe: Introduce lines walker interface")
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/lkml/157199322107.8075.12659099000567865708.stgit@devnote2
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/dwarf-aux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c
index 063f71d..e0c507d 100644
--- a/tools/perf/util/dwarf-aux.c
+++ b/tools/perf/util/dwarf-aux.c
@@ -695,7 +695,7 @@ static int __die_walk_funclines_cb(Dwarf_Die *in_die, void *data)
if (dwarf_tag(in_die) == DW_TAG_inlined_subroutine) {
fname = die_get_call_file(in_die);
lineno = die_get_call_lineno(in_die);
- if (fname && lineno > 0 && dwarf_entrypc(in_die, &addr) == 0) {
+ if (fname && lineno > 0 && die_entrypc(in_die, &addr) == 0) {
lw->retval = lw->callback(fname, lineno, addr, lw->data);
if (lw->retval != 0)
return DIE_FIND_CB_END;
next prev parent reply other threads:[~2019-11-12 11:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-25 8:46 [BUGFIX PATCH 0/6] perf/probe: Additional fixes for range only functions Masami Hiramatsu
2019-10-25 8:46 ` [BUGFIX PATCH 1/6] perf/probe: Fix wrong address verification Masami Hiramatsu
2019-10-25 12:14 ` Arnaldo Carvalho de Melo
2019-10-25 12:36 ` Masami Hiramatsu
2019-10-25 14:28 ` Arnaldo Carvalho de Melo
2019-11-12 11:18 ` [tip: perf/core] perf probe: " tip-bot2 for Masami Hiramatsu
2019-10-25 8:46 ` [BUGFIX PATCH 2/6] perf/probe: Fix to probe a function which has no entry pc Masami Hiramatsu
2019-11-12 11:18 ` [tip: perf/core] perf probe: " tip-bot2 for Masami Hiramatsu
2019-10-25 8:46 ` [BUGFIX PATCH 3/6] perf/probe: Fix to probe an inline " Masami Hiramatsu
2019-10-25 14:35 ` Arnaldo Carvalho de Melo
2019-10-25 14:39 ` Arnaldo Carvalho de Melo
2019-10-26 8:04 ` Masami Hiramatsu
2019-11-12 11:18 ` [tip: perf/core] perf probe: " tip-bot2 for Masami Hiramatsu
2019-10-25 8:46 ` [BUGFIX PATCH 4/6] perf/probe: Fix to list probe event with correct line number Masami Hiramatsu
2019-11-12 11:18 ` [tip: perf/core] perf probe: " tip-bot2 for Masami Hiramatsu
2019-10-25 8:47 ` [BUGFIX PATCH 5/6] perf/probe: Fix to show inlined function callsite without entry_pc Masami Hiramatsu
2019-11-12 11:18 ` tip-bot2 for Masami Hiramatsu [this message]
2019-10-25 8:47 ` [BUGFIX PATCH 6/6] perf/probe: Fix to show ranges of variables in functions " Masami Hiramatsu
2019-11-12 11:18 ` [tip: perf/core] perf probe: " tip-bot2 for 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=157355748875.29376.11117050115980321569.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=acme@redhat.com \
--cc=bp@alien8.de \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@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;
as well as URLs for NNTP newsgroup(s).