All proceeds from Ad Clicks goes to the author of this site.

 

Friday, January 21, 2005

Tips for dtrace

dtrace –s scriptname to execute a script in a file or #!/usr/sbin/dtrace –s at the start of a script if you wish to execute file as a script

$1-$9 are the arguments the script is called with

If you pass in a string that will be evaluated as a string you need to use $$num

.e.g.

/execname == $$1/

If the argument doesn’t require an argument you can link them together with a single – like -Cs for a script that is run through the cpp preprocessor

List all hooks into the kernel that dtrace has:

dtrace –o dtrace_hooks –l

You can limit the list by including. * can be used as wild card, and more than one can be included to limit the list

-P ‘provider’

-m ‘module’

-f ‘function’

arg0-arg9 are the arguments passed into a function that the probe is monitoring. arg0 on return probes is the return value. Just because an argN variable has data in it doesn’t mean that it is was used to call the function that the probe is monitoring. Relying on side effects can break in the next upgrade or on different architectures check /usr/include for the number of arugments function/call uses.


0 Comments:

Post a Comment

<< Home