From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Zechuan Chen <chenzechuan1@huawei.com>,
"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>,
Masami Hiramatsu <mhiramat@kernel.org>
Cc: peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@redhat.com,
namhyung@kernel.org, Jianlin.Lv@arm.com,
ravi.bangoria@linux.ibm.com, yao.jin@linux.intel.com,
yangjihong1@huawei.com, mpe@ellerman.id.au,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc/perf: fix ppc64 perf probe add events failed
Date: Sun, 2 Jan 2022 11:56:09 -0300 [thread overview]
Message-ID: <YdG9CSk9ayoVmBhz@kernel.org> (raw)
In-Reply-To: <20211228111338.218602-1-chenzechuan1@huawei.com>
Em Tue, Dec 28, 2021 at 07:13:38PM +0800, Zechuan Chen escreveu:
> Because of commit bf794bf52a80 ("powerpc/kprobes: Fix kallsyms lookup
> across powerpc ABIv1 and ABIv2"), in ppc64 ABIv1, our perf command
> eliminates the need to use the prefix "." at the symbol name. But when
> the command "perf probe -a schedule" is executed on ppc64 ABIv1, it
> obtains two symbol address information through /proc/kallsyms, for example:
>
> cat /proc/kallsyms | grep -w schedule
> c000000000657020 T .schedule
> c000000000d4fdb8 D schedule
>
> The symbol "D schedule" is not a function symbol, and perf will print:
> "p:probe/schedule _text+13958584"Failed to write event: Invalid argument
>
> Therefore, when searching symbols from map and adding probe point for
> them, a symbol type check is added. If the type of symbol is not a
> function, skip it.
>
> Fixes: bf794bf52a80 ("powerpc/kprobes: Fix kallsyms lookup across powerpc ABIv1 and ABIv2")
>
> Signed-off-by: Zechuan Chen <chenzechuan1@huawei.com>
> ---
> tools/perf/util/probe-event.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index b2a02c9ab8ea..a834918a0a0d 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -3083,6 +3083,9 @@ static int find_probe_trace_events_from_map(struct perf_probe_event *pev,
> for (j = 0; j < num_matched_functions; j++) {
> sym = syms[j];
>
> + if (sym->type != STT_FUNC)
> + continue;
> +
Humm, shouldn't this be handled by find_probe_functions(), i.e. it
shoudn't return data symbols, right? Otherwise other places using this
function may malfunction as well?
Naveen? Masami?
- Arnaldo
> /* There can be duplicated symbols in the map */
> for (i = 0; i < j; i++)
> if (sym->start == syms[i]->start) {
> --
> 2.12.3
next prev parent reply other threads:[~2022-01-02 14:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-28 11:13 [PATCH] powerpc/perf: fix ppc64 perf probe add events failed Zechuan Chen
2022-01-02 14:56 ` Arnaldo Carvalho de Melo [this message]
2022-01-05 2:56 ` chenzechuan
2022-01-06 1:56 ` 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=YdG9CSk9ayoVmBhz@kernel.org \
--to=acme@kernel.org \
--cc=Jianlin.Lv@arm.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=chenzechuan1@huawei.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=namhyung@kernel.org \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=ravi.bangoria@linux.ibm.com \
--cc=yangjihong1@huawei.com \
--cc=yao.jin@linux.intel.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;
as well as URLs for NNTP newsgroup(s).