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]

command line arguments


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


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