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
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace
To unsubscribe, send any mail to "[email protected]"