public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Using perf probe with arguments throws a fatal error.
       [not found]       ` <20100824095658.GC14431@linux.vnet.ibm.com>
@ 2010-08-25  5:47         ` Masami Hiramatsu
  2010-08-25  6:55           ` Srikar Dronamraju
  0 siblings, 1 reply; 2+ messages in thread
From: Masami Hiramatsu @ 2010-08-25  5:47 UTC (permalink / raw)
  To: Srikar Dronamraju
  Cc: Arnaldo Carvalho de Melo, Ananth N Mavinakayanahalli,
	Steven Rostedt, Fr?d?ric Weisbecker, 2nddept-manager, Ingo Molnar,
	linux-kernel

(2010/08/24 18:56), Srikar Dronamraju wrote:
>>>
>>> 1000 [srikar@llm69 uprobesv3.git]$  cat
>>> /sys/kernel/debug/tracing/events/probe/do_fork/format
>>> name: do_fork
>>> ID: 817
>>> format:
>>>         field:unsigned short common_type;       offset:0; size:2; signed:0;
>>>         field:unsigned char common_flags;       offset:2; size:1; signed:0;
>>>         field:unsigned char common_preempt_count;       offset:3; size:1; signed:0;
>>>         field:int common_pid;   offset:4;       size:4; signed:1;
>>>         field:int common_lock_depth;    offset:8;       size:4; signed:1;
>>>
>>>         field:unsigned long __probe_ip; offset:16;      size:8; signed:0;
>>>         field:u64 %ip;  offset:24;      size:8; signed:0;
>>
>> Hmm, it could be caused by "u64"...
>> OK, maybe I should update perf to support those.
>>
>> BTW, let me check that you use perf for the latest kernel?
>>
> 
> 
> Yes, I am using perf from latest kernel and this happens on both x86
> and x86_64 boxes.
> 
> Just for curiosity I tried printing the format for perf probe
> do_fork ip=%ip and here it is 
> 
> 1001 [srikar@llm69 uprobesv3.git]$ sudo perf probe do_fork ip=%ip 
> 1001 [srikar@llm69 uprobesv3.git]$ cat /sys/kernel/debug/tracing/events/probe/do_fork/format 
> name: do_fork
> ID: 818
> format:
>         field:unsigned short common_type;       offset:0; size:2; signed:0;
>         field:unsigned char common_flags;       offset:2; size:1; signed:0;
>         field:unsigned char common_preempt_count;       offset:3; size:1; signed:0;
>         field:int common_pid;   offset:4;       size:4; signed:1;
>         field:int common_lock_depth;    offset:8;       size:4; signed:1;
> 
>         field:unsigned long __probe_ip; offset:16;      size:8; signed:0;
>         field:u64 ip;   offset:24;      size:8; signed:0;
> 	          ^^
> 
> print fmt: "(%lx) ip=%llx", REC->__probe_ip, REC->ip
>                   ^^				 ^^
> 
> The differences I see when a name is given we refer the name, while in
> the previous case we refer the register %ip.

Ah, I remembered that, yeah, perf doesn't support those raw regsiters,
dereferences, etc.
Hmm, this should be solved, but not so simple as just removing "%",
because there are also special variables ($retval, $stack) and
dereferences(+8(+10(%sp)), etc).

I think the simplest solution is just setting "argX" name for each
argument (if user omitted its name) in kprobe-tracer (because
trace-cmd will face same problem).
e.g.
 # echo "p do_fork %ip" > tracing/kprobe_events
will be translated as below
 # echo "p do_fork arg1=%ip" > tracing/kprobe_events

Thank you,


-- 
Masami HIRAMATSU
2nd Dept. Linux Technology Center
Hitachi, Ltd., Systems Development Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com

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

* Re: Using perf probe with arguments throws a fatal error.
  2010-08-25  5:47         ` Using perf probe with arguments throws a fatal error Masami Hiramatsu
@ 2010-08-25  6:55           ` Srikar Dronamraju
  0 siblings, 0 replies; 2+ messages in thread
From: Srikar Dronamraju @ 2010-08-25  6:55 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: Arnaldo Carvalho de Melo, Ananth N Mavinakayanahalli,
	Steven Rostedt, Fr?d?ric Weisbecker, 2nddept-manager, Ingo Molnar,
	linux-kernel

> > 
> > The differences I see when a name is given we refer the name, while in
> > the previous case we refer the register %ip.
> 
> Ah, I remembered that, yeah, perf doesn't support those raw regsiters,
> dereferences, etc.
> Hmm, this should be solved, but not so simple as just removing "%",
> because there are also special variables ($retval, $stack) and
> dereferences(+8(+10(%sp)), etc).
> 
> I think the simplest solution is just setting "argX" name for each
> argument (if user omitted its name) in kprobe-tracer (because
> trace-cmd will face same problem).
> e.g.
>  # echo "p do_fork %ip" > tracing/kprobe_events
> will be translated as below
>  # echo "p do_fork arg1=%ip" > tracing/kprobe_events
> 

Okay, I will follow the same and fix the argX name in uprobe-tracer.

--
Thanks and Regards
Srikar

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

end of thread, other threads:[~2010-08-25  7:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20100824045758.GA14431@linux.vnet.ibm.com>
     [not found] ` <4C738411.8080602@hitachi.com>
     [not found]   ` <20100824085401.GB14431@linux.vnet.ibm.com>
     [not found]     ` <4C738F09.3080108@hitachi.com>
     [not found]       ` <20100824095658.GC14431@linux.vnet.ibm.com>
2010-08-25  5:47         ` Using perf probe with arguments throws a fatal error Masami Hiramatsu
2010-08-25  6:55           ` Srikar Dronamraju

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox