public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Processing argv
@ 2009-01-08 22:06 Buddy Lumpkin
  2009-01-08 22:57 ` Buddy Lumpkin
  2009-01-09  9:40 ` Mark Wielaard
  0 siblings, 2 replies; 4+ messages in thread
From: Buddy Lumpkin @ 2009-01-08 22:06 UTC (permalink / raw)
  To: systemtap

Ok so the announcement for release 0.7 says the following:

 - The vector of script command line arguments is available in a
   tapset-provided global array argv[].  It is indexed 1 ... argc,
   another global.  This can substitute for of preprocessor
   directives @NNN that fail at parse time if there are not
   enough arguments.
       printf("argv: %s %s %s", argv[1], argv[2], argv[3])

 For a full overview see the SystemTap Language Reference manual.

I cannot find an updated reference manual that gives a full overview.
This manual does not seem to cover it:
http://sourceware.org/systemtap/langref/

There doesn't seem to be a built in atoi. Is there an sscanf or an
intended method for converting strings to ints or do I need to roll my
own?

--Buddy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Processing argv
  2009-01-08 22:06 Processing argv Buddy Lumpkin
@ 2009-01-08 22:57 ` Buddy Lumpkin
  2009-01-09  9:47   ` Mark Wielaard
  2009-01-09  9:40 ` Mark Wielaard
  1 sibling, 1 reply; 4+ messages in thread
From: Buddy Lumpkin @ 2009-01-08 22:57 UTC (permalink / raw)
  To: systemtap

Also, can staprun process command line arguments? My testing seems to
indicate that it can't but perhaps I am not quoting or escaping things
correctly?

--Buddy

On Thu, Jan 8, 2009 at 2:06 PM, Buddy Lumpkin <buddy.lumpkin@gmail.com> wrote:
> Ok so the announcement for release 0.7 says the following:
>
>  - The vector of script command line arguments is available in a
>   tapset-provided global array argv[].  It is indexed 1 ... argc,
>   another global.  This can substitute for of preprocessor
>   directives @NNN that fail at parse time if there are not
>   enough arguments.
>       printf("argv: %s %s %s", argv[1], argv[2], argv[3])
>
>  For a full overview see the SystemTap Language Reference manual.
>
> I cannot find an updated reference manual that gives a full overview.
> This manual does not seem to cover it:
> http://sourceware.org/systemtap/langref/
>
> There doesn't seem to be a built in atoi. Is there an sscanf or an
> intended method for converting strings to ints or do I need to roll my
> own?
>
> --Buddy
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Processing argv
  2009-01-08 22:06 Processing argv Buddy Lumpkin
  2009-01-08 22:57 ` Buddy Lumpkin
@ 2009-01-09  9:40 ` Mark Wielaard
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Wielaard @ 2009-01-09  9:40 UTC (permalink / raw)
  To: Buddy Lumpkin; +Cc: systemtap

Hi Buddy,

On Thu, 2009-01-08 at 14:06 -0800, Buddy Lumpkin wrote:
> Ok so the announcement for release 0.7 says the following:
> 
>  - The vector of script command line arguments is available in a
>    tapset-provided global array argv[].  It is indexed 1 ... argc,
>    another global.  This can substitute for of preprocessor
>    directives @NNN that fail at parse time if there are not
>    enough arguments.
>        printf("argv: %s %s %s", argv[1], argv[2], argv[3])
> 
>  For a full overview see the SystemTap Language Reference manual.
> 
> I cannot find an updated reference manual that gives a full overview.
> This manual does not seem to cover it:
> http://sourceware.org/systemtap/langref/

Seems you are right. It is actually only documented in the manual page
for stapvars (5). BTW. the language reference manual should also be
installed locally, probably somewhere as:
/usr/share/doc/systemtap-0.8/langref.pdf
(but indeed, the new argv/argc support isn't in there, sorry)

> There doesn't seem to be a built in atoi. Is there an sscanf or an
> intended method for converting strings to ints or do I need to roll my
> own?

There is strtol:long (str:string, base:long)
That one is documented in the language reference (9.9 String Functions)

Cheers,

Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Processing argv
  2009-01-08 22:57 ` Buddy Lumpkin
@ 2009-01-09  9:47   ` Mark Wielaard
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Wielaard @ 2009-01-09  9:47 UTC (permalink / raw)
  To: Buddy Lumpkin; +Cc: systemtap

On Thu, 2009-01-08 at 14:57 -0800, Buddy Lumpkin wrote:
> Also, can staprun process command line arguments? My testing seems to
> indicate that it can't but perhaps I am not quoting or escaping things
> correctly?

Do you mean with -c?
Then yes, if you quote the whole argument to -c it should act like it is
all passed to sh -c "your arguments". There were some issues with this
in the past though, see for example
https://bugzilla.redhat.com/show_bug.cgi?id=467652

Cheers,

Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-01-09  9:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-08 22:06 Processing argv Buddy Lumpkin
2009-01-08 22:57 ` Buddy Lumpkin
2009-01-09  9:47   ` Mark Wielaard
2009-01-09  9:40 ` Mark Wielaard

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).