From owner-freebsd-dtrace@freebsd.org Fri Jul 21 06:19:31 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 6B3A2D96A34 for ; Fri, 21 Jul 2017 06:19:31 +0000 (UTC) (envelope-from xiaonan830818@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::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 E9862650A3; Fri, 21 Jul 2017 06:19:30 +0000 (UTC) (envelope-from xiaonan830818@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id w191so5164108wmw.1; Thu, 20 Jul 2017 23:19:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YYnXLVgZGWT6bE1zfVArIDwJhIbZbwikCkaNsms64a0=; b=fuhQ7Qaj+MRibL2v8OYEg+sAStYqQUXuhFeHYllsk+HcTjILC3MiZekUL7qHN16JDQ adqcEq0qZ5Lox8giXA6chRG8D2U7hlbI6sLqpnzSxGQxdjfroZ3Puv97UoeLO84eRTJc iaimC5P3tyFFvmdkkZEJcAAts2d/iAmPPkIc3dNgi6e6bhRIrxfHZS2UvPRqhKB8FypQ YbUhYnRNcewAwMF2VasbSrb4AlH4vCA49J6ixvFUJ2iM2T4bQKMJSp0AAdP6UxVe2uhR W9kJXCb+LSLGIljifyqJQEAJP4u8jP6pVZslAwq0OOIO7HyPay28QOnzJKQ3PLyepKs2 5r+A== 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=YYnXLVgZGWT6bE1zfVArIDwJhIbZbwikCkaNsms64a0=; b=i0KYbfvrjc6Lg4OIyFN6G0wvBKy9lFvTU55L0IuXsO9BMEBsiAmaWHk5DIrZCKI9JS FjWqY8aQo9iYrTiuHSKJO13kb29y9fiCk/7HT7bX2zOR784NV9a6we/4D4Z4y4qnHcoY 3dAiLn0R4hrnBAYXfGLbxiQNeSttSVH9ksAaQ4dsPDQWw9pD+6XAnPhAm3+SLt3V81oQ sSj38bjo3tlCcyCHqTUE/KnvzmPW9sqTFiEwcz6Y1BkLaA9Ce+9H4vPBpCQ2/LaYMsqg EuU5uXSDMn3ouXw5y6vWyhnSGkeBKw6oQNBHKy1iUjHbiRDoC0Eh1Oc5PwcK5ypf5bwJ 82Kg== X-Gm-Message-State: AIVw1111DNzPA0WWe0VsnaHMxwPl3vXiIprE6bz4Ca+YXHu8Pf0X9dFB 3K5uiGtX5ljn8Yn62+eqTkswj76HMg== X-Received: by 10.80.157.136 with SMTP id w8mr4901578ede.224.1500617969225; Thu, 20 Jul 2017 23:19:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.162.231 with HTTP; Thu, 20 Jul 2017 23:19:28 -0700 (PDT) In-Reply-To: <20170721050907.GA2736@raichu> References: <20170721050907.GA2736@raichu> From: Nan Xiao Date: Fri, 21 Jul 2017 14:19:28 +0800 Message-ID: Subject: Re: Does DTrace script only support "#pragma D option ..", not "-x option"? To: Mark Johnston Cc: Matthew Ahrens , 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 06:19:31 -0000 Hi Mark, Thanks very much for your explanation! Best Regards Nan Xiao On Fri, Jul 21, 2017 at 1:09 PM, Mark Johnston 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 >