Skip to content

Instantly share code, notes, and snippets.

@davidmarkclements
Created August 21, 2017 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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