lkml.org 
[lkml]   [2015]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Trying to use 'perf probe' to debug perf itself
Em Wed, Feb 25, 2015 at 11:53:16AM +0900, Masami Hiramatsu escreveu:
> (2015/02/25 3:49), Arnaldo Carvalho de Melo wrote:
> > Available variables at thread__get
> > @<thread__get+0>
> > struct thread* thread
> > [root@ssdandy ~]#

> > cool, so I thought it would be just a matter of asking to put the probes
> > and get the value of 'thread', then match things, but:

> > [root@ssdandy ~]# perf probe -v ~/bin/perf thread__put thread
<SNIP>
> > Writing event: p:probe_perf/thread__put /root/bin/perf:0xd03d2 thread=-32(%sp):u64
> > Failed to write event: Invalid argument
> > Error: Failed to add events. Reason: Invalid argument (Code: -22)
> > [root@ssdandy ~]#

> > Not possible :-\

> Hmm, strange. Could you tell me the version of your kernel?

[root@ssdandy ~]# uname -r
3.10.0-210.el7.x86_64

> It seems that the kernel newer than 3.14 supports uprobes with
> memory dereference (e.g. -32(%sp) )feature.

Right, that must be the case, will test, but then, would it be possible
for the kernel, in such cases, return something line EOPNOTSUP?

I will try to figure out a better error message on the tooling side,
something like:

. Realize we're asking for memory dereference in uprobes
. If it fails with EINVAL, check the kernel version and say something
like:

Please upgrade your kernel to at least x.y.z to have access to feature
FOO_BAR.

- Arnaldo

> (it was actually introduced by 5baaa59e, and git-describe told
> it was v3.13-rc4-22-g5baaa59)
>
> And also, could you try to write the result command to uprobe_event as
> below?
>
> # echo "p:probe_perf/thread__put /root/bin/perf:0xd03d2 thread=-32(%sp):u64" >> \
> /sys/kernel/debug/tracing/uprobe_events

Well, I'll try that if it fails after I upgrade to 3.14.

> > please let me know if you need some file, here is the readelf -wi for
> > those two routines:
>
> This should not be the problem of dwarf-analysis. It seems kernel-side
> (uprobe) problem.

Thanks a lot!

- Arnaldo


\
 
 \ /
  Last update: 2015-02-25 14:41    [W:0.104 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site