public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Vara Prasad <prasadav@us.ibm.com>
To: Benjamin Thery <benjamin.thery@bull.net>,
	        SystemTAP <systemtap@sources.redhat.com>
Subject: Re: Systemtap
Date: Fri, 20 Oct 2006 22:34:00 -0000	[thread overview]
Message-ID: <45394EF9.2000108@us.ibm.com> (raw)
In-Reply-To: <4536208E.1010109@bull.net>

Benjamin Thery wrote:

> [..]
> I'm trying to use Systemtap to trace some network events in order to 
> find a bug. I have a very basic knowledge of stap and there is a 
> couple of points I'd like to clarify:

Thanks for using SystemTap and we will try our best to help you.

>
> Placing a probe at the beginning of a given function always work, but 
> when I try to set the probe on the return statement of a function it 
> sometime fails. Stap says the probe can't be set.

Just to be sure i understand correctly, you are putting probes on a 
return statement to find when the function is returning, is it possible 
you could use return probes for the same. Return probe guarantees you 
will be able to run the handler at the time function returns no matter 
which of the return paths it takes as long as it is not an inline function.

Coming to not able to set probes on a return statement it could be 
related to compiler optimization. Was the function you are trying to do 
an inline function?

> I also have a problem when I try to set a probe at a given line in a 
> source file: sometimes it seems the probe isn't where I supposed it 
> is. For example, I tried to test if the code executed enters a 
> particular if-statement: stap trace never displayed my probe, whereas 
> I had a printk() trace that suggested the opposite).

It could be related to compiler optimization.

>
> Are these problems possibly due to the kernel being compiled with -O2 
> flag? Is it a side effect of optimization (similarly to debugging an 
> optimized program with gdb)?
>
It could be.  We know of  cases where we are not able to place probes in 
the middle of functions due to compiler optimizations hence we are 
pursuing static markers to address this issue.

> I'm wondering if it is advised to compile the kernel without 
> optimizations to be able to set probes wherever we want.
>
Certainly worth a try.

> Thanks for your help.
>
> Regards,
> Benjamin
>
   
Please let us know your results after trying without optimization.

bye,
Vara Prasad

       reply	other threads:[~2006-10-20 22:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4536208E.1010109@bull.net>
2006-10-20 22:34 ` Vara Prasad [this message]
     [not found] <1cd351fc0911180659k7c49c97fk7e0b6463764f3894@mail.gmail.com>
     [not found] ` <20091118150807.GB12292@redhat.com>
     [not found]   ` <1cd351fc0911180757l128dad05s44a2d689d5489d82@mail.gmail.com>
     [not found]     ` <20091120152420.GD12292@redhat.com>
     [not found]       ` <1cd351fc0911210529p95d3208k35d490d77225d162@mail.gmail.com>
2009-11-21 14:48         ` SystemTap Frank Ch. Eigler
2021-07-09 17:44 systemtap 王秋从

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=45394EF9.2000108@us.ibm.com \
    --to=prasadav@us.ibm.com \
    --cc=benjamin.thery@bull.net \
    --cc=systemtap@sources.redhat.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).