[dtrace-discuss] dtrace -q -s behaves differently than dtrace -qs

Menno Lageman Menno.Lageman at Sun.COM
Thu Sep 21 06:59:15 PDT 2006


Paul van den Bogaard wrote:
> The file test.d contains:
> 
> #!/usr/sbin/dtrace -qs
> 
> pid$target:libc.so.1:_door*:return
> {
>     printf("%s:%s:%s:%s\n", probeprov, probemod, probefunc, probename);
> }
> 
> This one gives me the output I expect (I run it on the sshd process) 
> 
> However when I change only the first line to
> 
> #!/usr/sbin/dtrace -q -s
> 
> The result becomes:
> 
> dtrace: no probes specified
> 
> And the shell prompt appears again.
> 
> Is this "normal" behaviour. Can't find anything in the man pages.

See exec(2):

  An interpreter file begins with a line of the form

           #! pathname [arg]

      where pathname is the path of the interpreter, and arg is an
      optional argument. When an interpreter file is executed, the
      system  invokes  the  specified  interpreter.  The  pathname
      specified  in  the interpreter file is passed as arg0 to the
      interpreter. If arg was specified in the  interpreter  file,
      it is passed as arg1 to the interpreter. The remaining argu-
      ments to the interpreter are arg0 through argn of the origi-
      nally  exec'd  file.  The interpreter named by pathname must
      not be an interpreter file.

Cheers,

Menno


More information about the dtrace-discuss mailing list