For example, finding out the traffic that a python script sends via UDP and the return (both python programs on the same machine); the first sends “foo”, the server sends what it got plus “bar”:
dtrace: description 'syscall::sendto*:entry ' matched 2 probes
CPU ID FUNCTION:NAME
0 397 sendto:entry Python sock=3 sockadd=0 buffer=foo
3 397 sendto:entry Python sock=4 sockadd=0 buffer=got foo, sending bar
Trivial example but finally, this is great. Dtrace, which looks cosmically cool, has been so useless on the mac for so long… thanks apple!