Skip to content

Instantly share code, notes, and snippets.

@davidmarkclements
Created August 21, 2017 16:13
Show Gist options
  • Save davidmarkclements/b947a140e1c4e7cf3ba8bfa9b462e304 to your computer and use it in GitHub Desktop.
Save davidmarkclements/b947a140e1c4e7cf3ba8bfa9b462e304 to your computer and use it in GitHub Desktop.
#!/usr/sbin/dtrace -s
#pragma D option quiet
#pragma D option switchrate=1000hz
profile-1ms /pid == $target/ {
/* Sampling every 1ms therefore also recording timestamp at ms resolution */
printf("%s %d %d: %s:", execname, pid, timestamp / 1000000, probename);
ustack(10000);
printf("\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment