linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* perf probe: Trying to read a 'ctx' named local variable
@ 2023-07-17 18:06 Arnaldo Carvalho de Melo
  2023-07-17 23:54 ` Masami Hiramatsu
  0 siblings, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-07-17 18:06 UTC (permalink / raw)
  To: Masami Hiramatsu; +Cc: linux-perf-users

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-21  0:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-17 18:06 perf probe: Trying to read a 'ctx' named local variable Arnaldo Carvalho de Melo
2023-07-17 23:54 ` Masami Hiramatsu
2023-07-20 14:40   ` Arnaldo Carvalho de Melo
2023-07-21  0:38     ` Masami Hiramatsu

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).