This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: stap -x option
- From: Martin Hunt <hunt at redhat dot com>
- To: Sanket Somnath Hase <sanket at cmu dot edu>
- Cc: systemtap at sourceware dot org
- Date: Fri, 27 Jul 2007 14:23:32 -0400
- Subject: Re: stap -x option
- Organization: Red Hat Inc.
- References: <9056.148.87.1.170.1185559171.squirrel@148.87.1.170>
On Fri, 2007-07-27 at 13:59 -0400, Sanket Somnath Hase wrote:
> Hi folks,
>
> a ) I was curious to know if we can provide more than one target to stap.
> Say I want to run the same script for more than one processes .
-x is probably not needed now that we handle command line args. However
it is a nice complement to -c.
Anyway, what you want is easy to do use command line args. For example,
probe begin {
printf("tracing pids %d and %d\n", $1, $2)
}
probe syscall.open {
p = pid()
if (p == $1 || p == $2)
printf("%d: open (%s)\n", p, argstr)
}
Save the above as trace.stp and then
> stap trace.stp 123 456
>
> b) Is there any benefit in running single script ( effectively single kernel module )
> for all the processes under consideration against running same script for each process
> individually ( and effectively having many kernel modules which look for same set of
> events but for different targets ).
Obviously multiple scripts will use more system resources. Other than
that, it is really up to you. If you are doing the same for all
processes then it makes the most sense to have one script.
Martin