There is another way. Let cpp handle the arguments:
#!/usr/sbin/dtrace -Cs
syscall:::entry {
#ifdef VERBOSE
printf("%s", probefunc);
#endif
@[probefunc] = count();
}
[EMAIL PROTECTED]:~/lang/d$ pfexec /usr/sbin/dtrace -Cs /tmp/cpp.d -n 'tick-1s
{ exit(0) }'
dtrace: script '/tmp/cpp.d' matched 2
Thanx, I will make it work with -x defaultargs that way both
$./sample.d
and
$./sample.d verbose
will work.
___
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org
On Mon, Nov 03, 2008 at 04:31:20AM -0800, [EMAIL PROTECTED] wrote:
> I am very now to DTrace land.
>
> 1) I want to write a DTrace script which takes -verbose or --verbose as an
> option.
>
> #!/usr/sbin/dtrace -s
> #pragma D option quiet
>
> pid$1::func1:entry
> {
> /* should be called on