This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: help: can "staprun" support command-line arguments?
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: =?GB2312?B?s8K+ss/g?= <chenjx8 at gmail dot com>
- Cc: "systemtap at sources dot redhat dot com" <systemtap at sources dot redhat dot com>
- Date: Thu, 01 Jul 2010 10:21:49 -0400
- Subject: Re: help: can "staprun" support command-line arguments?
- References: <AANLkTimKlr8CvEXFkcYmhkK2zVUwq2mlYjVseOQPa7O7@mail.gmail.com>
=?GB2312?B?s8K+ss/g?= <chenjx8@gmail.com> writes:
> [...]
> systemtap script can use command-line arguments, but when I use
> cross-instrumentation build module, I have a problem. I hope I can input
> command-line arguments to=A0 the module which I build out of script in my
> own computer [...]
> e.g.
> #cat commandlineargs.stp
> probe kernel.function("vfs_read") # fche: I think you meant function(@1) here
> {
> fn = @1
> printf("do function %s\n", fn)
> }
> [...]
There is a facility for passing some staprun-time parameters.
However, these are limited to overriding values of scalar global
variables, not arbitrary places in the script. That means that such
arguments *cannot* vary probe point specifications (but see PR11550
for some forthcoming relaxation of this), but can do things like this:
% stap -p4 -mfoo -e '
global var="world"
probe begin
log (var)
}'
# staprun foo.ko var=hello
hello
# staprun foo.ko
world
- FChE