public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Martin Hunt <hunt@redhat.com>
To: "Frank Ch. Eigler" <fche@redhat.com>
Cc: systemtap@sources.redhat.com
Subject: Re: command line arguments
Date: Mon, 27 Feb 2006 20:34:00 -0000	[thread overview]
Message-ID: <1141072486.4794.40.camel@dragon> (raw)
In-Reply-To: <20060225213836.GK20902@redhat.com>

It seems to me that this feature is being created from the bottom up. I
think we really need to consider how this should work and then figure
out how to do the internal magic to make it happen.

For example,
> stap foo.stp -- args
> foo.stp args

For modules:
> stap -mfoo foo.stp -- args 
> stap foo.ko -- args

Now, there is a sticky problem caused by the fact that stap compiles and
executes a program at the same time. Users may want to pass in the name
of functions to probe, and those must be fixed at compile (elaboration)
time.  Using -D to set those seems like a reasonable approach.
> stap -Dprobe1="sys_open" foo.stp -- args

The script would then do
probe kernel.function("$probe1") { ... }

That would require a change to our current definition of "-D". While we
are discussing these issues, it would be nice if we can change at least
MAXSTRINGLEN and MAXMAPENTRIES to variables so they can be changed at
module load time.

> > [...]  Still, I don't see how you can do anything like getopt to
> > process args.
> 
> One can't, with what there is now.  It would not take much to add
> another way of accessing the entire argument array, for some
> adventurous person to implement getopt on top of.

In fact, all it takes is some way to let the script know how many args
were passed in; something that basic error checking should also make
necessary.

So, for 'n' args, setting @(n+1) = ""  OR creating $argn and setting
that to 'n'.


  reply	other threads:[~2006-02-27 20:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-23 22:42 Frank Ch. Eigler
2006-02-24  5:52 ` Martin Hunt
2006-02-24 12:24   ` Frank Ch. Eigler
2006-02-24 18:44     ` Martin Hunt
2006-02-25 21:38       ` Frank Ch. Eigler
2006-02-27 20:34         ` Martin Hunt [this message]
2006-02-24 13:42 ` Daniel P. Berrange
2006-02-24 15:51   ` Frank Ch. Eigler
2006-02-24 20:59     ` Roland McGrath
2006-02-24 21:22       ` Frank Ch. Eigler
2006-02-23 23:41 Stone, Joshua I
2006-02-24  1:00 ` Frank Ch. Eigler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1141072486.4794.40.camel@dragon \
    --to=hunt@redhat.com \
    --cc=fche@redhat.com \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).