This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Processing argv


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]