From owner-freebsd-dtrace@freebsd.org Sat Aug 19 20:45:35 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 1002EDE3648 for ; Sat, 19 Aug 2017 20:45:35 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::22d]) (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 CDCC8640B4 for ; Sat, 19 Aug 2017 20:45:34 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-it0-x22d.google.com with SMTP id 76so19384344ith.0 for ; Sat, 19 Aug 2017 13:45:34 -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=1fV8lJ7l3LIeQDk43e42kDFDF6AEWO03Uff8DahXkBI=; b=ge960f7luseKOFusYIvi57X7mXhH0CBqOiqyqAm/xDlDzkNNKT5RS6FHJBBnUiNL1I l/M8hkyvf5lgTY3EZqj4/9mZSSXyz48jEkeHzbi+BS0qLN58jsnYNM9BEvV+LHGKIHKQ pktYnq9WCrUoMVG4Zuc7k9pEodZqDb8ANJdAwLAv2ySUT0Iswulk9blRYziPO+lQWQGi D1CFG/Oee1FIlZiL032cFY2aJ6coWQce3SZdS0gvnMdxYbBi7cHx29LopBsJH5zWuoE2 /p32AQFnTW6xlfVIUSU4fnkWLZis03CxvUaiQvcqn3hr2DQriGP62TmjyzBgXiF+6BXk 14QA== 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=1fV8lJ7l3LIeQDk43e42kDFDF6AEWO03Uff8DahXkBI=; b=jFiMOfqjYIPFHgDMYFVM/RUh7V2j4+oJ/10oFEdeTxUOhKP3NebcIKnNnF3t0qMiAa UEwew9cAbr/sQOv4zKs3W75bXYQLUbgGz/syHZwPlXQkaSjGIIVp9vh+TC/FRoYzmIog FAba9rOadfVdAmjhdd5b45nkTZd91Ai2HGxXvHZWOcwhvSo6+LNWT5qwJKsPCgalcQaN 234DvgyCpUWwxtP3bZJjWiNyuJbyejpgfH+ayAYBmfHciJvpCevUYaU5sbfC7VC+/d6u uT9Vpkxq5t7h1i3NBFPVymNct63WJ3B4iYILbsuYCK2+Kog1bZmoHafLn7dicaKr9Uzy C2UQ== X-Gm-Message-State: AHYfb5iP/JjNoZgb/+++UF4rUc/7AG8JEZDwUABXNR6ilbHY/Yb7Apwf crk34WMGIKUnySY/jkCZQf0aUmpXWA== X-Received: by 10.36.3.193 with SMTP id e184mr2213885ite.34.1503175534236; Sat, 19 Aug 2017 13:45:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.114.233 with HTTP; Sat, 19 Aug 2017 13:45:33 -0700 (PDT) In-Reply-To: References: From: Ryan Stone Date: Sat, 19 Aug 2017 16:45:33 -0400 Message-ID: Subject: Re: Does DTrace on FreeBSD support macro argument? To: Nan Xiao Cc: "freebsd-dtrace@freebsd.org" Content-Type: text/plain; charset="UTF-8" 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: Sat, 19 Aug 2017 20:45:35 -0000 If a script uses a positional argument like $1, the script will error out if you don't provide that parameter. Try instead supplying a pid on the command line: # ./tracewrite.d 123 On Fri, Aug 18, 2017 at 3:27 AM, Nan Xiao wrote: > Hi all, > > Greetings from me! > > I am trying the following simple script on FreeBSD 11: > > #!/usr/sbin/dtrace -s > > syscall::write:entry > /pid == $1/ > { > } > > and get following error: > > # ./tracewrite.d > dtrace: failed to compile script ./tracewrite.d: line 4: macro > argument $1 is not defined > > From this link(http://docs.oracle.com/cd/E19253-01/817-6223/chp-script-3/index.html), > it seems FreeBSD doesn't support macro argument, right? If I want to > use it, what is the correct method? > > Thanks very much in advance! > > 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"