[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b4fdeac8-ea95-9bcd-3761-65b08f2d5bf5@mageia.org>
Date: Sun, 29 Dec 2019 20:37:04 +0200
From: Thomas Backlund <tmb@...eia.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
<linux-kernel@...r.kernel.org>
CC: <stable@...r.kernel.org>, Masami Hiramatsu <mhiramat@...nel.org>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 5.4 250/434] perf probe: Fix to show inlined function
callsite without entry_pc
Den 29-12-2019 kl. 19:25, skrev Greg Kroah-Hartman:
> From: Masami Hiramatsu <mhiramat@...nel.org>
>
> [ Upstream commit 18e21eb671dc87a4f0546ba505a89ea93598a634 ]
>
> 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@...co ~]# perf probe -L amd_put_event_constraints
> <amd_put_event_constraints@...r/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@...co ~]#
>
> After:
>
> [root@...co ~]# perf probe -L amd_put_event_constraints
> <amd_put_event_constraints@...r/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@...co ~]# 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@...co ~]#
>
> [root@...co ~]# perf probe -l
> probe:amd_put_event_constraints (on amd_put_event_constraints:4@...h/x86/events/amd/core.c)
> probe:clear_tasks_mm_cpumask (on clear_tasks_mm_cpumask@...nel/cpu.c)
> [root@...co ~]#
>
> Using it:
>
> [root@...co ~]# perf trace -e probe:*
> ^C[root@...co ~]#
>
> Ok, Intel system here... :-)
>
> Fixes: 4cc9cec636e7 ("perf probe: Introduce lines walker interface")
> Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
> Tested-by: Arnaldo Carvalho de Melo <acme@...hat.com>
> Cc: Jiri Olsa <jolsa@...hat.com>
> Cc: Namhyung Kim <namhyung@...nel.org>
> Link: http://lore.kernel.org/lkml/157199322107.8075.12659099000567865708.stgit@devnote2
> Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
> Signed-off-by: Sasha Levin <sashal@...nel.org>
> ---
> 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 4b1890204e99..08aba015e072 100644
> --- a/tools/perf/util/dwarf-aux.c
> +++ b/tools/perf/util/dwarf-aux.c
> @@ -673,7 +673,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;
>
Still broken...
util/dwarf-aux.c: In function '__die_walk_funclines_cb':
util/dwarf-aux.c:683:30: warning: implicit declaration of function
'die_entrypc'; did you mean 'dwarf_entrypc'?
[-Wimplicit-function-declaration]
683 | if (fname && lineno > 0 && die_entrypc(in_die, &addr) == 0) {
--
Thomas
Powered by blists - more mailing lists