Skip to content

Instantly share code, notes, and snippets.

@d
Last active March 7, 2018 02:30
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 d/212c1ad1840c26aabbec097c3d8248ab to your computer and use it in GitHub Desktop.
Save d/212c1ad1840c26aabbec097c3d8248ab to your computer and use it in GitHub Desktop.
instrumenting
# wait for gporca_test to launch
dtrace -xmangled -n 'pid$target::__ZN4gpos9CRefCount6AddRefEv:entry { @["AddRef"]=count(); }' -W gporca_test
# list all probes
dtrace -xmangled -l -n 'pid$target:gporca_test::' -n 'pid$target:libgpopt.3.dylib::' -n 'pid$target:libnaucrates.3.dylib::' -n 'pid$target:libgpdbcost.3.dylib::' -n 'pid$target:libgpos.3.dylib::' -p (pgrep gporca_test) > /tmp/gporca_test_probes.txt
# dynamically trace an already running orca process
dtrace -xmangled -n 'pid$target::__ZN4gpos9CRefCount6AddRefEv:return { @["AddRef"]=count(); }' -p (pgrep gporca_test)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment