public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* probing based on kernel source
@ 2008-09-09  4:46 Jun Koi
  2008-09-09  4:51 ` Wenji Huang
  2008-09-09  4:56 ` Ananth N Mavinakayanahalli
  0 siblings, 2 replies; 7+ messages in thread
From: Jun Koi @ 2008-09-09  4:46 UTC (permalink / raw)
  To: SystemTAP

Hi,

Is it possible to probe a place coresponding to a particular line of a
particular file in Linux kernel souce code? If so, what is the syntax?

Thanks a lot,
Jun

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

* Re: probing based on kernel source
  2008-09-09  4:46 probing based on kernel source Jun Koi
@ 2008-09-09  4:51 ` Wenji Huang
  2008-09-09  4:56 ` Ananth N Mavinakayanahalli
  1 sibling, 0 replies; 7+ messages in thread
From: Wenji Huang @ 2008-09-09  4:51 UTC (permalink / raw)
  To: Jun Koi; +Cc: SystemTAP

Jun Koi wrote:
> Hi,
> 
> Is it possible to probe a place coresponding to a particular line of a
> particular file in Linux kernel souce code? If so, what is the syntax?
> 
> Thanks a lot,
> Jun
See reference
http://sourceware.org/systemtap/langref/

4.2.2 kernel.statement, module().statement
The .statement variant places a probe at the exact spot, exposing those 
local variables that are visible there.

General syntax:

     kernel.statement("func@file:linenumber")
     module("modname").statement("func@file:linenumber")

Example:

     # Refers to the statement at line 2917 within the
     # kernel/sched.c file:
     kernel.statement("*@kernel/sched.c:2917")

Regards,
Wenji

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

* Re: probing based on kernel source
  2008-09-09  4:46 probing based on kernel source Jun Koi
  2008-09-09  4:51 ` Wenji Huang
@ 2008-09-09  4:56 ` Ananth N Mavinakayanahalli
  2008-09-09  5:54   ` Jun Koi
  1 sibling, 1 reply; 7+ messages in thread
From: Ananth N Mavinakayanahalli @ 2008-09-09  4:56 UTC (permalink / raw)
  To: Jun Koi; +Cc: SystemTAP

On Tue, Sep 09, 2008 at 01:46:13PM +0900, Jun Koi wrote:
> Hi,
> 
> Is it possible to probe a place coresponding to a particular line of a
> particular file in Linux kernel souce code? If so, what is the syntax?

See
http://sourceware.org/systemtap/langref/node6.html#SECTION00062200000000000000

If the particular line you are trying to probe can't be probed due to
compiler optimizations, etc., stap will give you alternatives too.

Ananth

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

* Re: probing based on kernel source
  2008-09-09  4:56 ` Ananth N Mavinakayanahalli
@ 2008-09-09  5:54   ` Jun Koi
  2008-09-09  6:07     ` Ananth N Mavinakayanahalli
  0 siblings, 1 reply; 7+ messages in thread
From: Jun Koi @ 2008-09-09  5:54 UTC (permalink / raw)
  To: ananth; +Cc: SystemTAP

On Tue, Sep 9, 2008 at 1:55 PM, Ananth N Mavinakayanahalli
<ananth@in.ibm.com> wrote:
> On Tue, Sep 09, 2008 at 01:46:13PM +0900, Jun Koi wrote:
>> Hi,
>>
>> Is it possible to probe a place coresponding to a particular line of a
>> particular file in Linux kernel souce code? If so, what is the syntax?
>
> See
> http://sourceware.org/systemtap/langref/node6.html#SECTION00062200000000000000
>
> If the particular line you are trying to probe can't be probed due to
> compiler optimizations, etc., stap will give you alternatives too.

So I suppose that stap returns a list of (kernel) addresses that might
be suitable to put the probe? If so, how can we know which one is
correct??

Thanks,
Jun

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

* Re: probing based on kernel source
  2008-09-09  5:54   ` Jun Koi
@ 2008-09-09  6:07     ` Ananth N Mavinakayanahalli
  2008-09-09 14:49       ` Theodore Tso
  0 siblings, 1 reply; 7+ messages in thread
From: Ananth N Mavinakayanahalli @ 2008-09-09  6:07 UTC (permalink / raw)
  To: Jun Koi; +Cc: SystemTAP

On Tue, Sep 09, 2008 at 02:54:06PM +0900, Jun Koi wrote:
> On Tue, Sep 9, 2008 at 1:55 PM, Ananth N Mavinakayanahalli
> <ananth@in.ibm.com> wrote:
> > On Tue, Sep 09, 2008 at 01:46:13PM +0900, Jun Koi wrote:
> >> Hi,
> >>
> >> Is it possible to probe a place coresponding to a particular line of a
> >> particular file in Linux kernel souce code? If so, what is the syntax?
> >
> > See
> > http://sourceware.org/systemtap/langref/node6.html#SECTION00062200000000000000
> >
> > If the particular line you are trying to probe can't be probed due to
> > compiler optimizations, etc., stap will give you alternatives too.
> 
> So I suppose that stap returns a list of (kernel) addresses that might
> be suitable to put the probe? If so, how can we know which one is
> correct??

Please try the suggestion.. it returns alternative line numbers not
virtual addresses, and that, only if your specified line number can't be
probed. In that case, you'll need to take the call which one of the
alternatives is appropriate.

Ananth

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

* Re: probing based on kernel source
  2008-09-09  6:07     ` Ananth N Mavinakayanahalli
@ 2008-09-09 14:49       ` Theodore Tso
  2008-09-09 15:13         ` Masami Hiramatsu
  0 siblings, 1 reply; 7+ messages in thread
From: Theodore Tso @ 2008-09-09 14:49 UTC (permalink / raw)
  To: Ananth N Mavinakayanahalli; +Cc: Jun Koi, SystemTAP

On Tue, Sep 09, 2008 at 11:36:29AM +0530, Ananth N Mavinakayanahalli wrote:
> > So I suppose that stap returns a list of (kernel) addresses that might
> > be suitable to put the probe? If so, how can we know which one is
> > correct??
> 
> Please try the suggestion.. it returns alternative line numbers not
> virtual addresses, and that, only if your specified line number can't be
> probed. In that case, you'll need to take the call which one of the
> alternatives is appropriate.

When did stap started doing this?  I don't recall it providing
alternate line numbers the last time I tried it.  Just as a gentle
reminder, if something requires using a development snapshot of stap,
it's good to mention that.  Some poeple are still using whatever
version of stap was packaged with their distribution.  (Remember, it
wasn't *all* that long ago that people could easily build stap at
least on some distributions, and when pressed, the party line was that
was the distribution's responsibility and users should use whatever
their distribution packaged up for them --- or switch to another
distribution.)

	   	    	     	  	- Ted

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

* Re: probing based on kernel source
  2008-09-09 14:49       ` Theodore Tso
@ 2008-09-09 15:13         ` Masami Hiramatsu
  0 siblings, 0 replies; 7+ messages in thread
From: Masami Hiramatsu @ 2008-09-09 15:13 UTC (permalink / raw)
  To: Theodore Tso; +Cc: Ananth N Mavinakayanahalli, Jun Koi, SystemTAP

Theodore Tso wrote:
> On Tue, Sep 09, 2008 at 11:36:29AM +0530, Ananth N Mavinakayanahalli wrote:
>>> So I suppose that stap returns a list of (kernel) addresses that might
>>> be suitable to put the probe? If so, how can we know which one is
>>> correct??
>> Please try the suggestion.. it returns alternative line numbers not
>> virtual addresses, and that, only if your specified line number can't be
>> probed. In that case, you'll need to take the call which one of the
>> alternatives is appropriate.
> 
> When did stap started doing this?  I don't recall it providing
> alternate line numbers the last time I tried it.  Just as a gentle
> reminder, if something requires using a development snapshot of stap,
> it's good to mention that.  Some poeple are still using whatever
> version of stap was packaged with their distribution.  (Remember, it
> wasn't *all* that long ago that people could easily build stap at
> least on some distributions, and when pressed, the party line was that
> was the distribution's responsibility and users should use whatever
> their distribution packaged up for them --- or switch to another
> distribution.)

Hi Ted,

According to systemtap/Changelog,
---
2007-08-24  Frank Ch. Eigler  <fche@redhat.com>

        PR 4899
        * tapsets.cxx (dwflpp::has_single_line_record): Extended,
        abstraction violated.
        (iterate_over_srcfile_lines): Remove exactly line number match
        logic.  Improve error message to offered better-checked alternative
        line numbers.
        (query_srcfile_line): Whoops, pass scope_die down for statement("...")
        probes, to enable $target var processing.
---
From here, maybe that feature was merged. And also,
---
2007-08-14  David Smith  <dsmith@redhat.com>
[...]
        * configure.ac: Version increase to 0.6 and checks for libcap
        availability.  Removed stp_check reference.
        * configure: Regenerated.
        * stp_check.in: Removed.
---
So, you can use it with stap version 0.6 or later.

Thank you,


-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com

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

end of thread, other threads:[~2008-09-09 15:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-09  4:46 probing based on kernel source Jun Koi
2008-09-09  4:51 ` Wenji Huang
2008-09-09  4:56 ` Ananth N Mavinakayanahalli
2008-09-09  5:54   ` Jun Koi
2008-09-09  6:07     ` Ananth N Mavinakayanahalli
2008-09-09 14:49       ` Theodore Tso
2008-09-09 15:13         ` Masami Hiramatsu

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).