[dtrace-discuss] Use pid provider probes for a varying number of processes

Chip Bennett cbennett at laurustech.com
Fri Dec 1 08:26:49 PST 2006


It's my understanding that the actual provider name for the pid provider 
(pidnnnn) is static, and is variable before D compilation proper, when 
macros are still being evaluated (i.e. pid$1).  So you could pass a long 
list of PIDs to your D program.

However, that's not very flexible, as you'd have to pass the same number 
of PIDs each time, since the number of probe descriptions is fixed.

The next level would be to generate and invoke your D program from a 
shell script, so that you could generate probe descriptions on the fly.

Chip

Andreas.Haas at Sun.COM wrote:
> Hi all,
>
> I'm curious if there is a means/workaround to use the pid provider 
> probes for event tracking with a varying number of processes.
>
> The case where I would need this is for event tracking with a bunch of 
> concurrently launched processes as I get them when I run a script such as
>
>    #!/bin/sh
>    nsync=$1
>    i=0
>
>    while [ $i -lt $nsync ]; do
>       qsub -sync y -b y /bin/sleep 1 &
>       i=`expr $i + 1`
>    done
>    wait
>
> that script launches me
>
>  - 10 child processes when I pass '10' as argument
>  - 100 child processes when I pass '100' as argument
>  - 1000 child processes when I pass '1000' as argument
>
> now what I would like to do is event tracking for any number of 
> commands launched. I already tried with pid provider
>
>    pid*::japi_init:entry
>
> but this gets me
>
>    probe description pid*::japi_init:entry does not match any probes
>
> as error.
>
> Any clue how to achieve this?
>
> Thanks,
> Andreas
> _______________________________________________
> dtrace-discuss mailing list
> dtrace-discuss at opensolaris.org



More information about the dtrace-discuss mailing list