Date: Thu, 20 Jul 2017 22:09:07 -0700 From: Mark Johnston <markj@FreeBSD.org> To: Nan Xiao <xiaonan830818@gmail.com> Cc: Matthew Ahrens <mahrens@delphix.com>, freebsd-dtrace@freebsd.org Subject: Re: Does DTrace script only support "#pragma D option ..", not "-x option"? Message-ID: <20170721050907.GA2736@raichu> In-Reply-To: <CA%2BMhoaOH-S8p2ENDDWzPdP5YrL7=LgriHp8U3RevT6e=Jt3-0w@mail.gmail.com> References: <CA%2BMhoaORhTetd4414WjWgEbvRmTiHfbwk9FM5QCgqUbpKhBm9Q@mail.gmail.com> <CAJjvXiHbz7re_JpcQLiH4nW5VdJduFxSbYEVUfr_n=Drsv48zw@mail.gmail.com> <CA%2BMhoaOH-S8p2ENDDWzPdP5YrL7=LgriHp8U3RevT6e=Jt3-0w@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jul 21, 2017 at 12:56:28PM +0800, Nan Xiao wrote:
> Hi Matt & Mark,
>
> Firstly, thanks very much for your responses!
>
> I change my script as this:
>
> #!/usr/sbin/dtrace -x dynvarsize=64m -s
>
> dtrace:::BEGIN
> {
> printf("Hello FreeBSD!\n");
> }
>
> It still generates errors:
>
> dtrace: failed to set -x dynvarsize: Invalid option name
>
>
> But dynvarsize should be a valid option name.
It turns out that this won't work on FreeBSD: on a shebang line, the
tokens following the interpreter path are passed to the interpreter as a
single argument, so dtrace(1)'s option parser won't handle your example.
I think it follows that you have no choice but to specify the option
with a pragma. See the two block comments here:
https://svnweb.freebsd.org/base/head/sys/kern/imgact_shell.c?view=markup#l61
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170721050907.GA2736>
