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]

[Bug uprobes/5163] tweak uprobes.ko build process


------- Additional Comments From jkenisto at us dot ibm dot com  2007-10-11 23:01 -------
(In reply to comment #0)

These are valid concerns, but I think the solutions need further thought.  See
below.

One thing to keep in mind is that we don't expect uprobes.ko to be insmod-ed and
rmmod-ed every time somebody runs a stap script.  Rather, once uprobes is in the
kernel, it stays there.  (As mentioned in bugs #5079 and #5083, sometimes
uprobes has to hang around long after the last unregister.)  The typical
scenario is that when it's time to insmod a stap-generated module,  uprobes is
already in the kernel (which we can detect becauses the uprobes symbols show up
in /proc/kallsyms).

We can certainly handle somebody rmmod-ing uprobes (in which case we
automatically rebuild it and/or re-insmod it as necessary), but that's not the
typical situation.

The only times we try to build uprobes.ko are:
1. we're stopping after pass 4 (in case uprobes.ko is needed in the environment
where the script will eventually be run); or
2. we're proceeding to pass 5 and we don't see uprobes in the kernel...
... and the script needs uprobes, of course.

> We need to tweak some of the uprobes.ko build steps from bug #5079.
> Several problems: /usr/share/systemtap/runtime/uprobes is the wrong place
> to build an object file into; /usr could be read-only;

And a user from group stapdev doesn't have write access to the directory where
stap currently tries to build uprobes.ko.  You'd have to run stap as root for
the build to succeed.

> the file may not be
> easily accessible to staprun except in the local/immediate probing scenario;

Yes, if you move the stap-generated module to another system, you may need to
bring uprobes.ko with it.

> uprobes.ko is kernel-version/arch. dependent, just like the systemtap probe
> module.
> 
> Let's investigate building the uprobes.ko more similarly to probe modules.
> 
> It could be stored in the module cache directory ($SYSTEMTAP_DIR/uprobes/).

Since each stap user has his/her own cache directory (by default), this would
mean multiple copies of uprobes.ko (and possibly the uprobes source).

> It could be given a name that encodes the version/architecture parameters
> (so the cache directory itself can be shared between machines).  Instead
> of passing just "-u" to staprun and have it find uprobes.ko someplace,
> pass "UPROBEFILENAME.ko" itself in addition ot the "PROBEFILE.ko".
> "stap -p4" could itself print out both needed modules.

Jim

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED


http://sourceware.org/bugzilla/show_bug.cgi?id=5163

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


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