I am very now to DTrace land. 

1) I want to write a DTrace script which takes -verbose or --verbose as an 
option.

#!/usr/sbin/dtrace -s
#pragma D option quiet

pid$1::func1:entry
{
    /* should be called only when verbose option is provided in command line */
   printf("Entered %s ...\n", probefunc);
}
pid$1::func2:entry,
{
    /* should be called always */
}
END 
{
    /* should be called always */
    /* print out summary */
}

It should be normally run as 
$./myscript.d 9149 
(where 9149 is the pid of the process I want to trace)

when I want more detailed information, I should be able to run it as 
$./myscript.d 9149 --verbose

Is something of this sort possible ?

2) Also I saw that END gets executed when I press Control C. But when I want to 
send output to another file via tee as shown below :
$./myscript.d |tee dtrace.log
and when I press control C, it doesn't get called. Any ideas?


      
_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org

Reply via email to