Date: Fri, 21 Jul 2017 14:19:28 +0800 From: Nan Xiao <xiaonan830818@gmail.com> To: Mark Johnston <markj@freebsd.org> 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: <CA%2BMhoaNsfN58rvTDoE8z_HeNjFy3JFbcsREXkEfzwrXN-ZeRdw@mail.gmail.com> In-Reply-To: <20170721050907.GA2736@raichu> References: <CA%2BMhoaORhTetd4414WjWgEbvRmTiHfbwk9FM5QCgqUbpKhBm9Q@mail.gmail.com> <CAJjvXiHbz7re_JpcQLiH4nW5VdJduFxSbYEVUfr_n=Drsv48zw@mail.gmail.com> <CA%2BMhoaOH-S8p2ENDDWzPdP5YrL7=LgriHp8U3RevT6e=Jt3-0w@mail.gmail.com> <20170721050907.GA2736@raichu>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi Mark,
Thanks very much for your explanation!
Best Regards
Nan Xiao
On Fri, Jul 21, 2017 at 1:09 PM, Mark Johnston <markj@freebsd.org> wrote:
> 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?CA%2BMhoaNsfN58rvTDoE8z_HeNjFy3JFbcsREXkEfzwrXN-ZeRdw>
