Created
October 25, 2024 14:36
-
-
Save siepkes/6e0e86255e7953abbc47787367215dd5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/sbin/dtrace -s | |
#pragma D option quiet | |
proc:::exec | |
/ $1 == curpsinfo->pr_ppid / | |
{ | |
self->start = timestamp; | |
} | |
proc:::exec-success | |
/self->start/ | |
{ | |
this->now = timestamp; | |
this->elapsed = this->now - self->start; | |
printf("Process exited: PID = %d, Parent PID = %d, Start time: %d, End time: %d, Total time: %d, Command = %s\n", | |
curpsinfo->pr_pid, curpsinfo->pr_ppid, self->start, this->now, this->elapsed, curpsinfo->pr_psargs); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment