From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9153 invoked by alias); 23 Feb 2006 22:42:23 -0000 Received: (qmail 9146 invoked by uid 22791); 23 Feb 2006 22:42:22 -0000 X-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 23 Feb 2006 22:42:21 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id k1NMgJCJ030688 for ; Thu, 23 Feb 2006 17:42:19 -0500 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k1NMgI104373 for ; Thu, 23 Feb 2006 17:42:19 -0500 Received: from touchme.toronto.redhat.com (IDENT:postfix@touchme.toronto.redhat.com [172.16.14.9]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id k1NMgIg2013051 for ; Thu, 23 Feb 2006 17:42:18 -0500 Received: from ton.toronto.redhat.com (ton.toronto.redhat.com [172.16.14.15]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 997B68000E9 for ; Thu, 23 Feb 2006 17:42:18 -0500 (EST) Received: from ton.toronto.redhat.com (localhost.localdomain [127.0.0.1]) by ton.toronto.redhat.com (8.13.1/8.13.1) with ESMTP id k1NMgIiL014513 for ; Thu, 23 Feb 2006 17:42:18 -0500 Received: (from fche@localhost) by ton.toronto.redhat.com (8.13.1/8.13.1/Submit) id k1NMgI2B014512 for systemtap@sources.redhat.com; Thu, 23 Feb 2006 17:42:18 -0500 Date: Thu, 23 Feb 2006 22:42:00 -0000 From: "Frank Ch. Eigler" To: systemtap@sources.redhat.com Subject: command line arguments Message-ID: <20060223224218.GE20902@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q1/txt/msg00606.txt.bz2 Hi - I committed a draft of command line argument support as per bug #1304. One part (plain substitution into scripts) is usable now. Another part (initializing globals at module init time) is sort of dormant. The way the first part works is by making any additional arguments passed to "stap" available to the script for substitution as string or number literals: # stap -e 'probe kernel.function(@1) { print($2) }' sys_open 4 The @ vs $ distinction encodes whether the numbered argument should be pasted as a string or number literal. I considered guessing but heuristics don't seem to belong somewhere so critical. I'm open to suggestions about better notation than $n and @n. (#n is out because of comments; % and others because of arithmetic operators.) - FChE