Adam Leventhal wrote:
> Hi Joachim,
> 
> You can't use variables, but you can use parameters from the command-line:
> 
> ---8<--- arg.d ---8<---
> 
> #!/usr/sbin/dtrace -s
> 
> pid$target::$1:entry
> {
>         @[$$1] = count();
> }
> 
> ---8<--- arg.d ---8<---
> 
> # ./arg.d -p `pgrep -n firefox` malloc
> dtrace: script './arg.d' matched 4 probes
> ^C
>   malloc                                                        50262

Thanks, this will be fine as well. Don't need variables, although they 
might make things clearer in longer scripts.

Still, it would be nice to have some sort of builtin getopt() to build 
more robust native dtrace scripts - with more than one macro argument, 
confusion is guaranteed now. And sed-preprocssing is addional overhead 
when writing and maintaining a script.

Before asking this question, I checked the dtrace user guide and failed 
to find this information - now it's obvious... sorry.

  Joachim

-- 
Joachim Worringen, Software Architect, Dolphin Interconnect Solutions
phone ++49/(0)228/324 08 17 - http://www.dolphinics.com
_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to