Permalink
Browse files

import exectime.d

example:

clu# dtrace -s exectime.d                                                                                                              ~
dtrace: script 'exectime.d' matched 6 probes
CPU     ID                    FUNCTION:NAME
  1   1074                      fork:create ksh pid 5112 ppid 4983
  2   1035        __mac_execve:exec-success ls pid 5123 ppid 5112 creation: 1208 us
  2   1119              exit1_internal:exit ls pid 5123 ppid 5112 lifetime: 4319 us
  • Loading branch information...
proger committed Aug 27, 2013
1 parent b13d570 commit ed09232afe7bac24507b715c5af85ee07c532dbf
Showing with 15 additions and 0 deletions.
  1. +15 −0 sys/exectime.d
View
@@ -0,0 +1,15 @@
proc:::create
{
procs[pid] = timestamp;
printf("%s pid %d ppid %d", execname, pid, ppid);
}
proc:::exec-success
{
printf("%s pid %d ppid %d creation: %d us", execname, pid, ppid, (timestamp - procs[ppid]) / 1000);
}
proc:::exit
{
printf("%s pid %d ppid %d lifetime: %d us", execname, pid, ppid, (timestamp - procs[ppid]) / 1000);
}

0 comments on commit ed09232

Please sign in to comment.