From 7016c1630f464d7c6bbae995a3de51d1126488dd Mon Sep 17 00:00:00 2001 From: DEBADRIBASAK <32904247+DEBADRIBASAK@users.noreply.github.com> Date: Sun, 8 Oct 2023 05:31:36 +0530 Subject: [PATCH] dtrace: add page (#10787) * dtrace: add page * addressed comments * Fixed formatting error. --- pages/osx/dtrace.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 pages/osx/dtrace.md diff --git a/pages/osx/dtrace.md b/pages/osx/dtrace.md new file mode 100644 index 0000000000..3d1cdfc0de --- /dev/null +++ b/pages/osx/dtrace.md @@ -0,0 +1,37 @@ +# dtrace + +> A simple interface to invoke the D language compiler, retrieve buffered trace, and print traced data from the DTrace kernel facility. +> Generic front-end to DTrace facility, requiring root privileges. +> More information: . + +- Set target data model for a specific architecture: + +`dtrace -arch {{arch_name}}` + +- Claim [a]nonymous tracing state and display the traced data: + +`dtrace -a` + +- Set principal trace buffer size. Supported units are `k`, `m`, `g`, or `t`: + +`dtrace -b {{2g}}` + +- Compile the specified D Program [s]ource file: + +`dtrace -s {{D_script}}` + +- Run the specified [c]ommand and exit upon its completion: + +`dtrace -c {{command}}` + +- Specify [f]unction name to trace or list (-l option). The corresponding argument can include any of the probe description forms like `provider:module:function`, `module:function` or `function`: + +`dtrace -f {{function}}` + +- Grad the specified [p]rocess ID, cache its symbol table, and exit upon completion: + +`dtrace -p {{pid}}` + +- Combine different options for tracing function in a process: + +`dtrace -a -b {{buffer_size}} -f {{function}} -p {{pid}}`