This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: stap -x option


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]