From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: linux-perf-users@vger.kernel.org
Subject: perf probe: Trying to read a 'ctx' named local variable
Date: Mon, 17 Jul 2023 15:06:10 -0300 [thread overview]
Message-ID: <ZLWDEjvFjrrEJODp@kernel.org> (raw)
Hi Masami,
Trying to use perf to debug perf I stumbled on this:
[root@quaco ~]# perf probe -x ~/bin/perf -L sigtrap_handler
<sigtrap_handler@/home/acme/git/perf-tools/tools/perf/tests/sigtrap.c:0>
0 sigtrap_handler(int signum __maybe_unused, siginfo_t *info, void *ucontext __maybe_unused)
{
if (!__atomic_fetch_add(&ctx.signal_count, 1, __ATOMIC_RELAXED))
3 ctx.first_siginfo = *info;
4 __atomic_fetch_sub(&ctx.tids_want_signal, syscall(SYS_gettid), __ATOMIC_RELAXED);
}
static void *test_thread(void *arg)
[root@quaco ~]# perf probe -x ~/bin/perf sigtrap_handler:4 "ctx.signal_count"
Failed to write event: Invalid argument
Please upgrade your kernel to at least 3.14 to have access to feature @ctx
Error: Failed to add events.
[root@quaco ~]#
[root@quaco ~]# uname -a
Linux quaco 6.3.8-100.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jun 15 01:51:54 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
[root@quaco ~]# rpm -qa | grep kernel-debuginfo
kernel-debuginfo-common-x86_64-6.3.8-100.fc37.x86_64
kernel-debuginfo-6.3.8-100.fc37.x86_64
[root@quaco ~]#
--
- Arnaldo
next reply other threads:[~2023-07-17 18:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-17 18:06 Arnaldo Carvalho de Melo [this message]
2023-07-17 23:54 ` perf probe: Trying to read a 'ctx' named local variable Masami Hiramatsu
2023-07-20 14:40 ` Arnaldo Carvalho de Melo
2023-07-21 0:38 ` 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=ZLWDEjvFjrrEJODp@kernel.org \
--to=acme@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mhiramat@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).