stap -x option

Martin Hunt hunt@redhat.com
Fri Jul 27 19:14:00 GMT 2007


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




More information about the Systemtap mailing list