public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: William Cohen <wcohen@redhat.com>
To: voyager1983 <wang.yongzhi2009@gmail.com>
Cc: systemtap@sourceware.org
Subject: Re: Can kernel.statement access the function argument?
Date: Fri, 08 Apr 2011 15:51:00 -0000	[thread overview]
Message-ID: <4D9F2EE3.3020505@redhat.com> (raw)
In-Reply-To: <31348406.post@talk.nabble.com>

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

  reply	other threads:[~2011-04-08 15:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-08  3:52 voyager1983
2011-04-08 15:51 ` William Cohen [this message]
2011-04-09  0:37   ` voyager1983
2011-04-11 17:40     ` Frank Ch. Eigler
2011-04-20 12:34       ` voyager1983

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=4D9F2EE3.3020505@redhat.com \
    --to=wcohen@redhat.com \
    --cc=systemtap@sourceware.org \
    --cc=wang.yongzhi2009@gmail.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).