Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Aug 2017 16:45:33 -0400
From:      Ryan Stone <rysto32@gmail.com>
To:        Nan Xiao <xiaonan830818@gmail.com>
Cc:        "freebsd-dtrace@freebsd.org" <freebsd-dtrace@freebsd.org>
Subject:   Re: Does DTrace on FreeBSD support macro argument?
Message-ID:  <CAFMmRNzrDt5wiu5EJUENnSMGTn4n1ekVYQOqjW6WSCBg8n-pXA@mail.gmail.com>
In-Reply-To: <CA%2BMhoaObzQQX%2B7xZuK5q_0EDVqvBJow6xJa9igyXfE3Aqi5hTQ@mail.gmail.com>
References:  <CA%2BMhoaObzQQX%2B7xZuK5q_0EDVqvBJow6xJa9igyXfE3Aqi5hTQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
If a script uses a positional argument like $1, the script will error
out if you don't provide that parameter.  Try instead supplying a pid
on the command line:

# ./tracewrite.d 123

On Fri, Aug 18, 2017 at 3:27 AM, Nan Xiao <xiaonan830818@gmail.com> wrote:
> Hi all,
>
> Greetings from me!
>
> I am trying the following simple script on FreeBSD 11:
>
> #!/usr/sbin/dtrace -s
>
> syscall::write:entry
> /pid == $1/
> {
> }
>
> and get following error:
>
> # ./tracewrite.d
> dtrace: failed to compile script ./tracewrite.d: line 4: macro
> argument $1 is not defined
>
> From this link(http://docs.oracle.com/cd/E19253-01/817-6223/chp-script-3/index.html),
> it seems FreeBSD doesn't support macro argument, right? If I want to
> use it, what is the correct method?
>
> Thanks very much in advance!
>
> Best Regards
> Nan Xiao
> _______________________________________________
> freebsd-dtrace@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace
> To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFMmRNzrDt5wiu5EJUENnSMGTn4n1ekVYQOqjW6WSCBg8n-pXA>