From owner-freebsd-dtrace@freebsd.org Wed Jul 19 09:56:52 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 06CD3C31CCD for ; Wed, 19 Jul 2017 09:56:52 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from dss.incore.de (dss.incore.de [195.145.1.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C146A73B25 for ; Wed, 19 Jul 2017 09:56:51 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from inetmail.dmz (inetmail.dmz [10.3.0.3]) by dss.incore.de (Postfix) with ESMTP id 508BE67867 for ; Wed, 19 Jul 2017 11:56:43 +0200 (CEST) X-Virus-Scanned: amavisd-new at incore.de Received: from dss.incore.de ([10.3.0.3]) by inetmail.dmz (inetmail.dmz [10.3.0.3]) (amavisd-new, port 10024) with LMTP id P2aa7rgKzcKA for ; Wed, 19 Jul 2017 11:56:42 +0200 (CEST) Received: from mail.local.incore (fwintern.dmz [10.0.0.253]) by dss.incore.de (Postfix) with ESMTP id 700AB67846 for ; Wed, 19 Jul 2017 11:56:42 +0200 (CEST) Received: from bsdlo.incore (bsdlo.incore [192.168.0.84]) by mail.local.incore (Postfix) with ESMTP id 3EBC6508A1 for ; Wed, 19 Jul 2017 11:56:42 +0200 (CEST) Message-ID: <596F2CDA.1000705@incore.de> Date: Wed, 19 Jul 2017 11:56:42 +0200 From: Andreas Longwitz User-Agent: Thunderbird 2.0.0.19 (X11/20090113) MIME-Version: 1.0 To: "freebsd-dtrace@freebsd.org" Subject: g_journal_read has broken argument list in V10 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit 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: Wed, 19 Jul 2017 09:56:52 -0000 I use FreeBSD 10.3-STABLE r317936 with "old" /usr/lib/dtrace/ip.c and can't get DTrace to work for the function g_journal_read(). In the output of "dtrace -lv" I see 33379 fbt geom_journal g_journal_read entry Probe Description Attributes Identifier Names: Private Data Semantics: Private Dependency Class: Unknown Argument Attributes Identifier Names: Private Data Semantics: Private Dependency Class: ISA Argument Types args[0]: struct g_journal_softc * args[1]: off_t args[2]: off_t args[3]: struct bio * but the sourcefile g_journal.c gives static void g_journal_read(struct g_journal_softc *sc, struct bio *pbp, off_t ostart, off_t oend) So args[0] and args[2] matches in type, but args[1] and args[3] does not. This problem did not exist in FreeBSD V8, dtrace -lv gives correct 31519 fbt geom_journal g_journal_read entry Probe Description Attributes Identifier Names: Private Data Semantics: Private Dependency Class: Unknown Argument Attributes Identifier Names: Private Data Semantics: Private Dependency Class: ISA Argument Types args[0]: struct g_journal_softc * args[1]: struct bio * args[2]: off_t args[3]: off_t Please can somebody show me how this can be fixed ? -- Andreas Longwitz From owner-freebsd-dtrace@freebsd.org Fri Jul 21 03:03:22 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 D8CD4D7DB53 for ; Fri, 21 Jul 2017 03:03:22 +0000 (UTC) (envelope-from xiaonan830818@gmail.com) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (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 87C0CE1E for ; Fri, 21 Jul 2017 03:03:22 +0000 (UTC) (envelope-from xiaonan830818@gmail.com) Received: by mail-wm0-x22c.google.com with SMTP id w191so2844487wmw.1 for ; Thu, 20 Jul 2017 20:03:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=vfnkD0o2ZJO/FIV/Ye7PR/h0AvrjYvbEAHNv+YuZhwg=; b=U0fjNgWqpA4n/IJiXTfRHRTiChZ6oaG3z56B8pgrfx1BVyaTEbLLSHkObk2+eFEJeI rQz/BjcZVHLvP0FS0Ci6RUvCoewjxVsbr+nakvB0U4ceUyM9Br6LvBu4WOV+swjseUJo WaHLfOs/G8mY5RSkjiQgkSjhMeBgLioXfJWrYodRMLUgdpZp4QoLLkGnZzIwYJ2oKbdD RWAePZaQVBpBPU+lOlOzduBYoA04tI2ip61E2RUOYW0kSOb6dxeBmf3dteibdy0Bzg1Y xpdgXyNYyW00HHK0BxKjLGHf6b/vkZoM3+80au/DnvzQFQcRZpd4q51Sg06BqSCZtBX/ Vmfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=vfnkD0o2ZJO/FIV/Ye7PR/h0AvrjYvbEAHNv+YuZhwg=; b=iVrivZUz/8751+NyCKucbfBRCxt641x8jlxSMRmzVyHgtbUj8+zL7HT0NBCLcMOtVV tkUaftErCK06uhBK0bVILnKTi5J3TvjI7lAJyM7/GyC5kH0k4SpT7p2FMNEZkTHScBn1 45t36hXL9Zu0Dg7EnIFe0kvi5lBXxfnYAJOmZvozc1f6Mp/f3yM0aZ2LANiDy3/nB+Yj EUFU7sWzfv1A+ur36y2xZZFcseEvKi3nwTsyY0tKUMfh/euNGI+F+et0hD0/aahFbalp aex5D+CD8BBgos1CJIZjU9xSWpddukW5Qa+FaIFSJG8iQjKUI7QUAGTR6wRjaFz1OPWt P3LA== X-Gm-Message-State: AIVw113hJxCLiptmW7IpQ1Y7/SFgZ48AVt4UiZJSlWwcENntQd/7tFk5 Fcqw5pUi5Y4lhG+dqGzjhsZ3w36xSxgP X-Received: by 10.80.176.198 with SMTP id j64mr4445772edd.168.1500606200264; Thu, 20 Jul 2017 20:03:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.162.231 with HTTP; Thu, 20 Jul 2017 20:03:19 -0700 (PDT) From: Nan Xiao Date: Fri, 21 Jul 2017 11:03:19 +0800 Message-ID: Subject: Does DTrace script only support "#pragma D option ..", not "-x option"? To: 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 03:03:22 -0000 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. Thanks! Best Regards Nan Xiao From owner-freebsd-dtrace@freebsd.org Fri Jul 21 03:39:56 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 32BD4D7E5E4 for ; Fri, 21 Jul 2017 03:39:56 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-oi0-x22e.google.com (mail-oi0-x22e.google.com [IPv6:2607:f8b0:4003:c06::22e]) (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 E990C21D9 for ; Fri, 21 Jul 2017 03:39:55 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-oi0-x22e.google.com with SMTP id p188so42742675oia.0 for ; Thu, 20 Jul 2017 20:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Xc0LQn+gdEx+/hrsEWPYxIQpyBAMHrBfxiTsFJrkLgk=; b=hbfpjXjarkuvTT8FCGq5XUH/FiDyWwUr7o8sArfh4FyoBd6P3g7wmXSIwooIBMYwH3 grttth2zkJ2czPatuQaNBHwWZgjfthfEZLbmndp3DPJmna9ACKq4N/X5EYeLV8kh2Kc9 JdYcXx8QtriuBHV1//we186YCr8kE6shLvDMUky3jA1nwX4BWK2ir94L8MRNJCSqFj4O 9jTA9EMWAag6Q5SE0iruz1HDFO8GOTdoMSBWWTUlblFS/ImgWMJVj91l4+MOfoGyC5Uy GhnRoOS7ebYQ3T3H3kzd8RR8CZHmGpY+y2NAvWmCCTV5XU0boBXVYEUcd4w5I4Wp+Op5 1y/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Xc0LQn+gdEx+/hrsEWPYxIQpyBAMHrBfxiTsFJrkLgk=; b=CXILc97UW3F/+xAcjQ5yNKVx9oUIlhM1azrhf4SGeTBV0YX3sV6tL92GYwF50ymEbl 76eMHXrSJyCPkyQLybMJKwMg4mAZ8rHUT877ZDKJb2l0k6XvnbDPZTehwqvOubkF6T/5 qaj9n7q/ogGpDubTOUekARHsnoRrP/MYD1p2zGJzotP6syGmd2LdvBkpQemQyDBqaFNE O1b/BQY0Hg4GcmZ0aZGwS+uq39K+5vH3FDseWALjRvYx4s0IrLPzD45wbMb01M00e20u iML9UMtpJIJyt7WbvGk/w1Nb3WfEMZZh/KPfkbHb/TsOVqUQ0Ow7YRHuJg7AQ0+qauvf Dbtw== X-Gm-Message-State: AIVw110hNnqf46LzYdIxHpxVpPFBK1heSxC9Z8IJSocVsg1LdytIzUhA Wys8n1tKHsy2BEo1X4km6gRRIlbz4A== X-Received: by 10.202.166.28 with SMTP id p28mr949822oie.150.1500608394369; Thu, 20 Jul 2017 20:39:54 -0700 (PDT) MIME-Version: 1.0 Sender: markjdb@gmail.com Received: by 10.182.43.2 with HTTP; Thu, 20 Jul 2017 20:39:53 -0700 (PDT) Received: by 10.182.43.2 with HTTP; Thu, 20 Jul 2017 20:39:53 -0700 (PDT) In-Reply-To: References: From: Mark Johnston Date: Thu, 20 Jul 2017 20:39:53 -0700 X-Google-Sender-Auth: P-amzeToSnFJly2vJ1Ey0GZtKEc 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 03:39:56 -0000 On Jul 20, 2017 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 I'm not able to test at this very moment, but I suspect that -s needs to be the last argument for this to work. So does DTrace only support using "#pragma D option dynvarsize=64m" format in script? I remembered Solaris can support both formats. 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" 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" > From owner-freebsd-dtrace@freebsd.org Fri Jul 21 04:56:30 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 B352BD7F7C4 for ; Fri, 21 Jul 2017 04:56:30 +0000 (UTC) (envelope-from xiaonan830818@gmail.com) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (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 475B363642 for ; Fri, 21 Jul 2017 04:56:30 +0000 (UTC) (envelope-from xiaonan830818@gmail.com) Received: by mail-wm0-x234.google.com with SMTP id w126so3620221wme.0 for ; Thu, 20 Jul 2017 21:56: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=4iL2AaKAyTHAlvIGdQMkPUK75iojJ3wfRBY7kzGI2dk=; b=tPmfila7n6bmWVfmgzEM/hM0n2VhFmuM+ds7i8vNGgV2Y1r/i1uR3rQyltKSspYy2n 6iUttTiGqoWw3hPAkotoJk7reek9tQ2a4c/7FIVg/2adN8UZFB99Uv2F6+BUuc2+Zm9h CqFR7tXj+4ub0mcy9EnvOv0Ttb00j6Mj9n+7+ARvbLTn3u+gBTEcBqfSRSmQgVHHvHdv 4drZ3g+oAKyKcLDxEftUXAI++A+IExGhzt7xgADDCQyfq85b31UhrrBcYmCkG+OHwTli yry9S58A7vFy2bMD/2B4jugMlOrbvaJIAvMtT21xWy8kLlfJ3s8KMyLczKswvSs8lrA0 ufJw== 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=4iL2AaKAyTHAlvIGdQMkPUK75iojJ3wfRBY7kzGI2dk=; b=akaoDW6c5Ax+xhUq0wPE/UVZqYXxJn6UfFsIJLcM0PqyazU0daLXrXh0KO+uyIFwi5 uyYi/r0TlHwWA5ZMEU2a5X/v8UuWjdHlOjzEbgOltqSEfDyzr2QrF0AWG03FMILD97sR Q+5fT98656AL8HkaeAdkPfHiyOfWuvYjq1pxZ5V+aXHo3VpeKEXe+7eo/JloNL1uhYjM Qyn8igL1atNQn9HIBiYPx22mhWU/uzCBv3xOfLVOdvllW+kIN/hGV9dEHjWD4VQ6Xdi3 KShYqjdHrzbaMC7TE0NbmuldNt+z13BgnLTyqW+xCbD74ukJRxU1DIkEeKRtVxS6cnQE 7siQ== X-Gm-Message-State: AIVw112OWlDsNmDhGBESWztMW1KkPmiwUvF3Ifv92EHV1gt6Nus8IWeD SgGTB1lEa0QIXfMS6SVojLizXtezBMgN X-Received: by 10.80.204.151 with SMTP id q23mr1056835edi.259.1500612988578; Thu, 20 Jul 2017 21:56:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.162.231 with HTTP; Thu, 20 Jul 2017 21:56:28 -0700 (PDT) In-Reply-To: References: From: Nan Xiao Date: Fri, 21 Jul 2017 12:56:28 +0800 Message-ID: Subject: Re: Does DTrace script only support "#pragma D option ..", not "-x option"? To: Matthew Ahrens 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:56:30 -0000 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. Thanks! Best Regards Nan Xiao On Fri, Jul 21, 2017 at 12:27 PM, Matthew Ahrens wrote: > > > 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" >> > > From owner-freebsd-dtrace@freebsd.org Fri Jul 21 05:09:13 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 15AE6D7FACA for ; Fri, 21 Jul 2017 05:09:13 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pg0-x22a.google.com (mail-pg0-x22a.google.com [IPv6:2607:f8b0:400e:c05::22a]) (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 D77F0639AC for ; Fri, 21 Jul 2017 05:09:12 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pg0-x22a.google.com with SMTP id s4so23751225pgr.5 for ; Thu, 20 Jul 2017 22:09:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=SobDs5BRYLP1qwieD+vVn0JMFbucW9TyKLMNXxcr1Qo=; b=PGrPVXnjNxxK4BKzLJubS7vaCaZlsrOxEE5IyiiXFPGFi6858xXJHvpbqWVvxLxK07 8m+ttRS7DHXgiSx/TtGj5o6Q3MguuTNWm445r3YMz74Fh2WAlMFXT6wwHexkLYy4bTd3 pglZsJR1R2wKiA1dw7AszydhQX0L7xC7W1D+BFihItqBEd+9Bmfw00KSoDfX/XE3J4ww xikGaFY94uJiOl3DxysZgyIkMB/riNprjos3ibkvbLNhx5P30sleJHRr+zI9AjXkinIB b1Hco4JQ4IVLEeVo7gHy0ZtzYvftBseWS9zNaTT3AogQyRkljJ2wH6rNnr3l5SBa51Gi 6UVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=SobDs5BRYLP1qwieD+vVn0JMFbucW9TyKLMNXxcr1Qo=; b=GKyah9j8FWDfOEY7gjM8y2xiRNOhskVS1j5pMFqMRflYHxVJmo+FmE3KDp7j6bE1jl YK1fs9ChrjJ1Bj5siNAL6QRAAU1rfvxRODZtMO0WqrwDSobxq00uRXX0GITYYtsDo3mL ys/PguUEWKHJ6feN6+CNDkhRPxL3vjlb41LjqACKU1lMFh9CuFeYdo9RGi8ZlnHiFFGK eLpNh+xUc5PaQDbhuz9bXJEjGfbXE44ATrXxSybQ+Ii3JOLWpr1SXkaLb/cMwfgIT+cD MAEsBT8ra6ewnAbtV4ASph7X5hqXSWEgGzQUTxM0KP/xggrsmHgM8LMy+kW8TtqCuKyR SQ/w== X-Gm-Message-State: AIVw111akJMqYWcumphppBzXoAmcWJBho0cgq+vftFy6KvK/3DeZNBdj hxTlg5wR0HAW2s3l X-Received: by 10.98.89.22 with SMTP id n22mr6273799pfb.326.1500613752049; Thu, 20 Jul 2017 22:09:12 -0700 (PDT) Received: from raichu ([2604:4080:1102:0:ca60:ff:fe9d:3963]) by smtp.gmail.com with ESMTPSA id d15sm7488984pgt.44.2017.07.20.22.09.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jul 2017 22:09:11 -0700 (PDT) Sender: Mark Johnston Date: Thu, 20 Jul 2017 22:09:07 -0700 From: Mark Johnston To: Nan Xiao Cc: Matthew Ahrens , freebsd-dtrace@freebsd.org Subject: Re: Does DTrace script only support "#pragma D option ..", not "-x option"? Message-ID: <20170721050907.GA2736@raichu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-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 05:09:13 -0000 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 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 >