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: stap and staprun use cases


On Tue, 2007-07-24 at 12:54 -0500, David Smith wrote:

> > 1B. Just compile a script.  When doing this it will always be desirable
> > to give it a meaningful name.
> > 
> > Now.
> >> stap -p4 -km name
> >> cp /tmp/stapXXXX/name.ko [destination]
> >> rm -rf /tmp/stapXXX
> > 
> > Proposed.
> >> stap -m name
> > name.ko is put in the current directory. Module is not loaded.
> 
> With the proposed syntax, you can't name a module and run it in one 
> command, as you can now ("stap -m name foo.stp").

This works with the proposed change
> stap -m name; staprun name.ko

Or we could do something like
> stap -p5 -m name

Or take the opposite approach and define "-m" to default to loading the
module, as it does now. Add a flag like "-C" to mean compile only.
> stap -Cm name
compiles name.ko only
> stap -Cim name
compile and install name.ko

Doesn't matter much to me as long as we make the whole temporary
directory hack invisible to the user.

> > 1C. Compile and install a script so stapusr users may use it.
> > Now.
> >> stap -p4 -km name
> >> cp /tmp/stapXXXX/name.ko /lib/modules/`uname -r`/systemtap
> >> rm -rf /tmp/stapXXX
> > 
> > Proposed. add "-i" option for install. Change "-m" to put module in
> > current directory and not load it.
> >> stap -im name
> 
> Unless the /lib/modules/`uname -r`/systemtap directory is writable by 
> the stapdev group, this will fail.

We can, if we want, make that a requirement. staprun should check
ownership and permissions on that directory anyway.

> > 1D. Load and run a module.
> >>From /lib/modules/`uname -r`/systemtap:
> >> staprun module[.ko]
> > 
> >>From anywhere:
> >> staprun /path/to/module[.ko]
> 
> I believe that currently the '.ko' is required.
Yes, along with a full pathname.

> > 2. stapusr
> > 
> > 2A. Compile and Run a script.  Not allowed.
> > Proposed:
> > stap should reject attempts to compile script unless
> > "-m" or "-pX" where X < 5. This is optional. staprun
> > will not load the script
> > 
> > 2B. Just compile a script. Same as 1B. All (not just stapusr) users may
> > compile scripts. Justification: Allows users to check that scripts
> > compile. Allows them to then use su or sudo and install the module in
> > the case where they are not, for some reason, in stapdev.
> 
> If they have root access (either through su or sudo) they don't need to 
> install the module to run it - "sudo stap foo.stp" should work correctly.

But that doesn't let others run it. I was trying to think of reasons
normal users would want to run stap.




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