public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* How to express in systemtap?
@ 2005-12-09  1:08 Keshavamurthy, Anil S
  2005-12-09  3:23 ` Roland McGrath
       [not found] ` <cd09bdd10512081724w78e3832ak6bf957022a6bda9e@mail.gmail.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Keshavamurthy, Anil S @ 2005-12-09  1:08 UTC (permalink / raw)
  To: systemtap

I am trying to insert probes on all functions belonging to a particular
section.

For example, say I want to insert the probes on all functions in the
address range
__sched_text_start and __sched_text_end range.

How can I express this in systemtap?

Thanks,

-Anil Keshavamurthy
Sr. Software Engineer
Open Source Technology Center/SSG
Intel Corp.
(w) 503-712-4476

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

* Re: How to express in systemtap?
  2005-12-09  1:08 How to express in systemtap? Keshavamurthy, Anil S
@ 2005-12-09  3:23 ` Roland McGrath
       [not found] ` <cd09bdd10512081724w78e3832ak6bf957022a6bda9e@mail.gmail.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Roland McGrath @ 2005-12-09  3:23 UTC (permalink / raw)
  To: Keshavamurthy, Anil S; +Cc: systemtap

> I am trying to insert probes on all functions belonging to a particular
> section.

We do not have any selectors like this at the moment, unless I missed some.
The expressive probe selectors we have are mostly in terms of source code
rather than binary level details.  (There is "literal PC", but that is not
very expressive.)

> For example, say I want to insert the probes on all functions in the
> address range
> __sched_text_start and __sched_text_end range.
>
> How can I express this in systemtap?

AFAIK the best you can do at the moment is either to approximate it by hand
with source-based selectors (i.e., know that they are all in *sched*.c or
the functions are all named *sched* or whatever), or approximate it by hand
by finding the functions in that range by external means and supplying
those function names or addresses.

Here's an idea for an extension to let you express this easily:

	probe kernel.function("*").pc(__sched_text_start .. __sched_text_end)

That is, an optional subclause on probe types that yield PC addresses for
probe locations:

	.pc(RANGE [, RANGE ...])

where RANGE can be: PC or PC .. PC, and PC can be an integer literal
address, or can be an identifier taken as an ELF symbol name in the module
that contains a candidate PC address.  I don't actually care what the
syntax is and I'll let Frank et al decide what's easy to parse and so
forth.  This example syntax is to illustrate the exact semantics I have in
mind.  (There may not be any need to support multiple ranges and such in
the syntax.)  The subclause applies a filtering predicate to the list of PC
addresses chosen for probes by the existing clause like foo.function(...).

It probably makes sense to build in a similar predicate as a special case
applied to all kprobes, that gives a helpful diagnostic about any probe
requested in __kprobes_text_start .. __kprobes_text_end, which will not be
permitted by kprobes at stap module load time anyway.

I suspect the elfutils support to facilitate the translator doing the
symbol name translation is already adequate.  I'll happily assist anyone
working on the translator to use it or improve it as necessary.  Unless
there is already a similar item or someone sees a reason not to have a
translator feature aimed at your request, Anil, please file a bugzilla
enhancement item about this.


Thanks,
Roland

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

* Re: How to express in systemtap?
       [not found] ` <cd09bdd10512081724w78e3832ak6bf957022a6bda9e@mail.gmail.com>
@ 2005-12-09  4:52   ` Keshavamurthy Anil S
  0 siblings, 0 replies; 4+ messages in thread
From: Keshavamurthy Anil S @ 2005-12-09  4:52 UTC (permalink / raw)
  To: James Dickens; +Cc: Keshavamurthy, Anil S, systemtap

On Thu, Dec 08, 2005 at 07:24:14PM -0600, James Dickens wrote:
> 
> 
>    well while its not what you want i used this
>    global i
>    probe module("nfs").function("*")
>    {
>    i++;
>    }
James, 
 I am aware of the above wild start syntax, but I 
am specifically looking at feature to insert probes
based on section name or based on the adress range.
If you see the way code is packed, supporting probes
based on section names or address range makes sense.

I will open a bugzilla for this feature request.

Cheers,
Anil

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

* RE: How to express in systemtap?
@ 2005-12-09  1:56 Mao, Bibo
  0 siblings, 0 replies; 4+ messages in thread
From: Mao, Bibo @ 2005-12-09  1:56 UTC (permalink / raw)
  To: Keshavamurthy, Anil S, systemtap


By "man stapprobes" command, there is syntax:
	probe kernel function("@kernel/sched.c")
It will probe all the function in sched.c, but I never use this syntax. And I will try it.

Regards
Bibo,mao

>-----Original Message-----
>From: systemtap-owner@sourceware.org [mailto:systemtap-owner@sourceware.org]
>On Behalf Of Keshavamurthy, Anil S
>Sent: 2005年12月9日 9:04
>To: systemtap@sources.redhat.com
>Subject: How to express in systemtap?
>
>I am trying to insert probes on all functions belonging to a particular
>section.
>
>For example, say I want to insert the probes on all functions in the
>address range
>__sched_text_start and __sched_text_end range.
>
>How can I express this in systemtap?
>
>Thanks,
>
>-Anil Keshavamurthy
>Sr. Software Engineer
>Open Source Technology Center/SSG
>Intel Corp.
>(w) 503-712-4476

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

end of thread, other threads:[~2005-12-09  4:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-09  1:08 How to express in systemtap? Keshavamurthy, Anil S
2005-12-09  3:23 ` Roland McGrath
     [not found] ` <cd09bdd10512081724w78e3832ak6bf957022a6bda9e@mail.gmail.com>
2005-12-09  4:52   ` Keshavamurthy Anil S
2005-12-09  1:56 Mao, Bibo

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