Skip to content

Instantly share code, notes, and snippets.

@jen20
Created May 2, 2017 04:32
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 jen20/60d9d9b9c75cd2611998e1a1e2605b9e to your computer and use it in GitHub Desktop.
Save jen20/60d9d9b9c75cd2611998e1a1e2605b9e to your computer and use it in GitHub Desktop.
Trace all args to `ld` and `gcc`. Probably SmartOS only.
#!/usr/sbin/dtrace -ws
#pragma D option quiet
#pragma D option switchrate=10
syscall::exec*:return
/ execname == "ld" || execname == "gcc"/
{
stop();
system("pargs %d", pid);
system("prun %d", pid);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment