Re: [dtrace-discuss] Pass argument to dtrace script for use as predicate

2009-09-12 Thread Jim Mauro
From http://wikis.sun.com/display/DTrace/Scripting; If you want your D macro arguments to be interpreted as string tokens even if they match the form of an integer or identifier, prefix the macro variable or argument name with two leading dollar signs (for example, $$1) to force the D compiler

Re: [dtrace-discuss] Pass argument to dtrace script for use as predicate

2009-09-12 Thread Angelo Rajadurai
For string arguments use $$1 -Angelo On Sep 12, 2009, at 3:07 PM, Stathis Kamperis wrote: Greetings to everyone. I wrote a script to calculate how much time is spent on the system calls originating from a specific executable: #!/usr/sbin/dtrace -s /* * Generate table statistics on how much

Re: [dtrace-discuss] Pass argument to dtrace script for use as predicate

2009-09-12 Thread Stathis Kamperis
2009/9/12 Stathis Kamperis : > 2. If I leave $1 without double quotes " and the execname doesn't have > a dot in it, it fails with: > $ pfexec ./lala.d temp > dtrace: failed to compile script ./lala.d: line 11: failed to resolve > temp: Unknown variable name Ok, I got lucky with google this time: h

[dtrace-discuss] Pass argument to dtrace script for use as predicate

2009-09-12 Thread Stathis Kamperis
Greetings to everyone. I wrote a script to calculate how much time is spent on the system calls originating from a specific executable: #!/usr/sbin/dtrace -s /* * Generate table statistics on how much time is spent on every system call, * for a given program (its name is assigned to $1). */ #