[dtrace-discuss] proc:::exit not firing

Chris Debenham - RSD Engineer Chris.Debenham at Sun.COM
Tue Jul 24 17:52:42 PDT 2007


I have a funny issue whereby when a application exits the proc:::exit 
probe doesn't seem to be firing.
A customer has written a dtrace script that outputs some info whenever 
proc:::exit fires but on occasion (random, no pattern in behaviour) 
dtrace exits without outputting the data.

They are running dtrace via 'dtrace -s exit_trace.d -p <pid>'

Can anyone think of any reason this should be so?
 From my reading of various documents, solaris internals and other spots 
it appears that proc:::exit should ALWAYS be fired regardless of how the 
process ends.

Thanks
   Chris Debenham

The script they are using is as follows:

--- begin script ---
proc:::signal-send
/args[1]->pr_pid == $target/
{
         last_signal = args[2];
         last_signal_sender_pid = pid;
         last_signal_sender_name = execname;
}

proc:::exit
/pid == $target && args[0] == CLD_EXITED/
{
         printf( "%Y normal exit.", walltimestamp );
         ustack();
}

proc:::exit
/pid == $target && args[0] == CLD_KILLED/
{
         printf( "%Y exited by signal. signal=%d, sent by=%s (%d)",
                         walltimestamp,
                         last_signal,
                         last_signal_sender_name,
                         last_signal_sender_pid );
}

proc:::exit
/pid == $target && args[0] == CLD_DUMPED/
{
         printf( "%Y core dump", walltimestamp );
         ustack();
}

proc:::exit
/pid == $target && args[0] != CLD_EXITED && args[0] != CLD_KILLED && 
args[0] != CLD_CONTINUED && args[0] != CLD_DUMPED/
{
         printf( "%Y stop or cont. status = %d", walltimestamp, args[0] );
}

--- end script ---

-- 
-------------------------------------------------------------------------------
   ,-_|\  TSC Engineer                        E-mail : debenham at sun.com
  /     \ Sun Microsystems Australia Pty Ltd. Direct : +61 (2) 9844 5188
  \_,-\_* 828 Pacific Highway                 Phone  : +61 (2) 9844 5000
       v  Gordon, N.S.W. 2072                 Fax    : +61 (2) 9844 5189
                                              Mobile : +61 (40) 9844 514
-------------------------------------------------------------------------------
Don't Worry About Life; You're Not Going To Survive It, Anyway.


More information about the dtrace-discuss mailing list