public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Can kernel.statement access the function argument?
@ 2011-04-08  3:52 voyager1983
  2011-04-08 15:51 ` William Cohen
  0 siblings, 1 reply; 5+ messages in thread
From: voyager1983 @ 2011-04-08  3:52 UTC (permalink / raw)
  To: systemtap


Hi, All

I am trying to access the argument of kernel function in kernel.statement
probe point. But I get the error message:

semantic error: not accessible at this address (0xc01a82e0): identifier
'$irq' at question.stp:2:38
        source:         printf("irq number is %d\n", $irq)
                                                     ^
Pass 2: analysis failed.  Try again with another '--vp 01' option.

The question.stp file is as below:

probe kernel.statement("handle_IRQ_event@kernel/irq/handle.c:376"){
        printf("irq number is %d\n", $irq)
}

I am using SystemTap 1.3 on Ubuntu10.10 to trace the kernel 2.6.35.9.

Are we allowed to access the function argument in kernel.statement probe
point? If not, is there any walk around solution?

Thanks!
Joey



-- 
View this message in context: http://old.nabble.com/Can-kernel.statement-access-the-function-argument--tp31348406p31348406.html
Sent from the Sourceware - systemtap mailing list archive at Nabble.com.

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

* Re: Can kernel.statement access the function argument?
  2011-04-08  3:52 Can kernel.statement access the function argument? voyager1983
@ 2011-04-08 15:51 ` William Cohen
  2011-04-09  0:37   ` voyager1983
  0 siblings, 1 reply; 5+ messages in thread
From: William Cohen @ 2011-04-08 15:51 UTC (permalink / raw)
  To: voyager1983; +Cc: systemtap

On 04/07/2011 11:52 PM, voyager1983 wrote:
> 
> Hi, All
> 
> I am trying to access the argument of kernel function in kernel.statement
> probe point. But I get the error message:
> 
> semantic error: not accessible at this address (0xc01a82e0): identifier
> '$irq' at question.stp:2:38
>         source:         printf("irq number is %d\n", $irq)
>                                                      ^
> Pass 2: analysis failed.  Try again with another '--vp 01' option.
> 
> The question.stp file is as below:
> 
> probe kernel.statement("handle_IRQ_event@kernel/irq/handle.c:376"){
>         printf("irq number is %d\n", $irq)
> }
> 
> I am using SystemTap 1.3 on Ubuntu10.10 to trace the kernel 2.6.35.9.
> 
> Are we allowed to access the function argument in kernel.statement probe
> point? If not, is there any walk around solution?
> 
> Thanks!
> Joey
> 
> 
> 

Hi Joey,

SystemTap's ability to obtain target variables depends on whether the argument is available at that location and whether the compiler has include debuginfo that describe where to get the value. To see what target variables systemtap can find at that location you could do:
 
stap -L 'kernel.statement("handle_IRQ_event@kernel/irq/handle.c:376")'

Is the place you probing the same as like 376 in:

http://lxr.linux.no/#linux+v2.6.35.9/kernel/irq/handle.c#L376

Could you use the following probe point?

kernel.trace("irq_handler_exit") $irq:int $action:struct irqaction* $ret:int

-Will

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

* Re: Can kernel.statement access the function argument?
  2011-04-08 15:51 ` William Cohen
@ 2011-04-09  0:37   ` voyager1983
  2011-04-11 17:40     ` Frank Ch. Eigler
  0 siblings, 1 reply; 5+ messages in thread
From: voyager1983 @ 2011-04-09  0:37 UTC (permalink / raw)
  To: systemtap


Hi, William

What I am about to probe is actually the statement   

ret = action->handler(irq, action->dev_id);

located in 

http://lxr.linux.no/linux+v2.6.35.9/kernel/irq/handle.c#L375

I want to selective do the probe according to the value of argument irq
(such as only probe interrupt issued by the keyboard).
 
kernel.trace("irq_handler_exit") works for me. But how can I do in some
other functions if the tracing line doesn't surrounded by the function like 
trace_irq_handler_entry and trace_irq_handler_exit. 

BTW, when I execute the command

stap -L 'kernel.statement("handle_IRQ_event@kernel/irq/handle.c:376")'

It returns nothing.

Best regards,
Joey




William Cohen wrote:
> 
> On 04/07/2011 11:52 PM, voyager1983 wrote:
>> 
>> Hi, All
>> 
>> I am trying to access the argument of kernel function in kernel.statement
>> probe point. But I get the error message:
>> 
>> semantic error: not accessible at this address (0xc01a82e0): identifier
>> '$irq' at question.stp:2:38
>>         source:         printf("irq number is %d\n", $irq)
>>                                                      ^
>> Pass 2: analysis failed.  Try again with another '--vp 01' option.
>> 
>> The question.stp file is as below:
>> 
>> probe kernel.statement("handle_IRQ_event@kernel/irq/handle.c:376"){
>>         printf("irq number is %d\n", $irq)
>> }
>> 
>> I am using SystemTap 1.3 on Ubuntu10.10 to trace the kernel 2.6.35.9.
>> 
>> Are we allowed to access the function argument in kernel.statement probe
>> point? If not, is there any walk around solution?
>> 
>> Thanks!
>> Joey
>> 
>> 
>> 
> 
> Hi Joey,
> 
> SystemTap's ability to obtain target variables depends on whether the
> argument is available at that location and whether the compiler has
> include debuginfo that describe where to get the value. To see what target
> variables systemtap can find at that location you could do:
>  
> stap -L 'kernel.statement("handle_IRQ_event@kernel/irq/handle.c:376")'
> 
> Is the place you probing the same as like 376 in:
> 
> http://lxr.linux.no/#linux+v2.6.35.9/kernel/irq/handle.c#L376
> 
> Could you use the following probe point?
> 
> kernel.trace("irq_handler_exit") $irq:int $action:struct irqaction*
> $ret:int
> 
> -Will
> 
> 

-- 
View this message in context: http://old.nabble.com/Can-kernel.statement-access-the-function-argument--tp31348406p31356706.html
Sent from the Sourceware - systemtap mailing list archive at Nabble.com.

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

* Re: Can kernel.statement access the function argument?
  2011-04-09  0:37   ` voyager1983
@ 2011-04-11 17:40     ` Frank Ch. Eigler
  2011-04-20 12:34       ` voyager1983
  0 siblings, 1 reply; 5+ messages in thread
From: Frank Ch. Eigler @ 2011-04-11 17:40 UTC (permalink / raw)
  To: voyager1983; +Cc: systemtap

voyager1983 <wang.yongzhi2009@gmail.com> writes:

> What I am about to probe is actually the statement   
> ret = action->handler(irq, action->dev_id);
> [...]
> stap -L 'kernel.statement("handle_IRQ_event@kernel/irq/handle.c:376")'
> It returns nothing.

That's partly because the handle_IRQ_event function is blacklisted due
to some historical incompatibility with kernel kprobes.  You may try
again with stap -g ...

- FChE

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

* Re: Can kernel.statement access the function argument?
  2011-04-11 17:40     ` Frank Ch. Eigler
@ 2011-04-20 12:34       ` voyager1983
  0 siblings, 0 replies; 5+ messages in thread
From: voyager1983 @ 2011-04-20 12:34 UTC (permalink / raw)
  To: systemtap


I see. Many thanks!

Joey

Frank Ch. Eigler wrote:
> 
> voyager1983 <wang.yongzhi2009@gmail.com> writes:
> 
>> What I am about to probe is actually the statement   
>> ret = action->handler(irq, action->dev_id);
>> [...]
>> stap -L 'kernel.statement("handle_IRQ_event@kernel/irq/handle.c:376")'
>> It returns nothing.
> 
> That's partly because the handle_IRQ_event function is blacklisted due
> to some historical incompatibility with kernel kprobes.  You may try
> again with stap -g ...
> 
> - FChE
> 
> 

-- 
View this message in context: http://old.nabble.com/Can-kernel.statement-access-the-function-argument--tp31348406p31440858.html
Sent from the Sourceware - systemtap mailing list archive at Nabble.com.

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

end of thread, other threads:[~2011-04-20 12:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-08  3:52 Can kernel.statement access the function argument? voyager1983
2011-04-08 15:51 ` William Cohen
2011-04-09  0:37   ` voyager1983
2011-04-11 17:40     ` Frank Ch. Eigler
2011-04-20 12:34       ` voyager1983

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 read-only IMAP folder(s) and NNTP newsgroup(s).