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


Will,
Thanks for the reply. However I have a  one question. 

" It checks to see if a kernel module has been previously
generated for a script, if so it reuses the module. If you attempt to use
multiple instances of a script, systemtap may indicate that it can't load
the module. "

a)
As per your above comments , if systemtap does reuse pre-existing modules for the same script , why should it even try loading module for one more such script ? Is there any threshold on the no of scripts that can reuse the same module ? And having crossed it systemtap tries to load a module ? 


b) I believe that the kernel module that is being loaded is the final outcome that will do the tracing activity. Even if I am running the same script multiple number of times but if I am using a different target , how is this info about different target getting passed , provided systemtap will reuse already loaded module ?  

Thanks ,
Sanket.


> 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 .
>> 
>> 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 ).
>> 
>> Looking forward to hear from you ,
>> 
>> Thanks , Sanket
>> 
> 
> It seems like one could have a begin probe parse a string argument with
> the list of pid interested in and enter them into a associative array
> using strtol and tokenize functions in a begin probe. Then have the probe
> check the associative array each time it fires. Maybe something like the
> attached script. This will need a newer version of systemtap that include
> the tokenize() function. The comment for syscall.read show how to check
> the associative array. Running the example something like this:
> 
> stap pids2watch.stp "124 456" watching pids: 124 456
> 
> 
> There are two issues with multiple probes. One is there will be
> additional overhead if there are more probes to run at a probe point. The
> other issue is that systemtap avoids recompiling the scripts when
> possible. It checks to see if a kernel module has been previously
> generated for a script, if so it reuses the module. If you attempt to use
> multiple instances of a script, systemtap may indicate that it can't load
> the module. The kernel only allow one instance of a module to be loaded
> into the kernel. You may need to resort to using the "-m" option to
> produce different modules to load.
> 
> -Will
> 
> 


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