From owner-freebsd-dtrace@freebsd.org Fri Jul 21 04:27:28 2017 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51D38D7F21B for ; Fri, 21 Jul 2017 04:27:28 +0000 (UTC) (envelope-from matthew.ahrens@delphix.com) Received: from mail-lf0-x22b.google.com (mail-lf0-x22b.google.com [IPv6:2a00:1450:4010:c07::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBE763954 for ; Fri, 21 Jul 2017 04:27:27 +0000 (UTC) (envelope-from matthew.ahrens@delphix.com) Received: by mail-lf0-x22b.google.com with SMTP id y15so19004863lfd.5 for ; Thu, 20 Jul 2017 21:27:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphix.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RTLqVo87OYoc6ADLI17VxwksBe02dnKrPDTqpByNY20=; b=YWgc0QQysmm2QQ+aPpaamtl1OADSGN0ri8pFRtuXewPIVKJXhVeua6KzG14hRUvWnE d2NTEeRSQpRidet9fqTIU0wJe9i0m/AUxEQ1L5isPM51JsrFsjVKQvy9ixzTnQ3xrEgS MO9+ML+aK3PfnCfzj8Sw8Hfje/hY/3R5q/+K8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RTLqVo87OYoc6ADLI17VxwksBe02dnKrPDTqpByNY20=; b=uYJLtm4tFuHTEclmNduvRf7GSk0bomRzWnliV9TDYbMlmSeC4UHC6RZSUzlZQ+ek01 +wi7YM9ZSEexV+iuE5eeIACN+gECCu/k+M0hfZdWphJ/s4EiosmvXN2cZvXzBO7LBXFo ++Hn63qSrCb29xagtqJ0voSH2qQvV7sSKw8Lf6kLiZ9cpow6tGhim/TkZpM3+zVXywTg 1i9mCOZOKZvO+Pi1bMe6r63W7F7gpUscosqYwXrm97G6nBj4oZ+HJ/t8jSaF9yDKsKBI X2fdZ+etMjUVfo/WkNg2ZOIIPj1MI6VFE84InlOozbn9FoLYEK6Qlq9DiE0Le67oDZrY RuPQ== X-Gm-Message-State: AIVw111U8CfJ5Sob6lTb81H2qG39NyxCnLTSyCrBqNmzDCVT3P3ZqFJJ RBcRDJwN1ZUu6tP76HxsutVz8JV8kq4meTY= X-Received: by 10.46.22.28 with SMTP id w28mr2082141ljd.62.1500611245229; Thu, 20 Jul 2017 21:27:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.15.101 with HTTP; Thu, 20 Jul 2017 21:27:24 -0700 (PDT) In-Reply-To: References: From: Matthew Ahrens Date: Thu, 20 Jul 2017 21:27:24 -0700 Message-ID: Subject: Re: Does DTrace script only support "#pragma D option ..", not "-x option"? To: Nan Xiao Cc: freebsd-dtrace@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jul 2017 04:27:28 -0000 On Thu, Jul 20, 2017 at 8:03 PM, Nan Xiao wrote: > Hi all, > > My FreeBSD version is 11.0, and I write a simple DTrace script: > > #!/usr/sbin/dtrace -s -x dynvarsize=64m > > dtrace:::BEGIN > { > printf("Hello FreeBSD!\n"); > } > > Running it will generate following error: > > dtrace: failed to open -x dynvarsize=64m: No such file or directory > > > So does DTrace only support using "#pragma D option dynvarsize=64m" format > in script? I remembered Solaris can support both formats. > This doesn't work on Solaris, because (at least on Solaris/illumos) shebang binaries only support one argument; further arguments are silently ignored. So your script does execute on Solaris, but the "-x dynvarsize=64m" is ignored. And as Mark said, the -s needs to be last. But (on Solaris) then it'll be ignored because it isn't the first argument. You can combine multiple no-argument flags in the shebang line, e.g.: #!/usr/sbin/dtrace -vZs ... --matt > > Thanks! > > 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" >