We would like to have a mode in SystemTap that runs purely in userspace, so one can monitor and debug one's own processes without any special system privilege or complicated configuration (more like usual debugging tools).
I have started publishing work on the branch jistone/stapdyn: > http://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=shortlog;h=refs/heads/jistone/stapdyn This is using Dyninst (www.dyninst.org) as the instrumentation backend, which for interprocess permission just requires ptrace access. I am working with that project to fill a few gaps for our needs, which will hopefully be complete by their 8.0 release. There is still much to do in stap itself, as enumerated in the file stapdyn/TODO. A few larger items I will file as separates bugs for this one to depend on.
The following commits did a lot of the work. It's still not complete, but generally passable for now... commit 02311ab40b457f5a77594ab286c73706be1e3d05 Author: Josh Stone <jistone@redhat.com> Date: Thu May 31 13:58:03 2012 -0700 PR14179: Move staprun et al. out of runtime/ We will reserve runtime/ for those files that are built into the stap-generated module, whereas staprun/ contains source for the various prebuilt executables for running those modules. commit 97859b9d66f7fb91d0aff21c3db0964460d91f0a Author: Josh Stone <jistone@redhat.com> Date: Tue Jun 5 15:29:11 2012 -0700 PR14179: Merge staprun/configure into the root We were duplicating some logic by having separate configure files. The especially doesn't make sense when you consider that staprun et al. even build some ../ sources files as well. Now the configuration is shared all at once. (Makefiles are kept separate though, at least for now.) A few changes to highlight: - The root configure now uses AC_SYS_LARGEFILE, which makes a more informed decision about _FILE_OFFSET_BITS=64. Thus, rather than being forced in stap_CFLAGS, this will now be set in config.h, and only on targets that aren't natively 64-bit. - staprun can now link to the --with-elfutils version of libelf. - The run-staprun helper script now also passes LD_LIBRARY_PATH through sudo, to help the --with-elfutils case. We generally don't support run-stap and run-staprun, except for power users/developers, so those people should make sure their environment is clean. commit 2ba1736aceee83a31fb19d4dfab37e2de33a7688 Author: Josh Stone <jistone@redhat.com> Date: Tue Jun 19 15:22:08 2012 -0700 PR14179: Start the runtime shuffle To aid in code sharing with the dyninst backend, the runtime is being split into neutral and kernel-specific parts. Runtime code that depends on running within the kernel should move to runtime/linux/. ***** * This is still a work in progress, but it remains functional enough * that normal kernel use should be unaffected. The separation is not * complete enough yet for the dyninst branch... ***** commit 7eaca571afab35e8e6263d3c74991c28efdd6b98 Author: Josh Stone <jistone@redhat.com> Date: Tue Jun 26 16:49:29 2012 -0700 PR14179: Install the new runtime/linux/ path too commit 2466bf705cb1ef53c9a088e4ead0050ac7386442 Author: Josh Stone <jistone@redhat.com> Date: Fri Jul 20 17:19:00 2012 -0700 PR14179: Adapt stapdyn runtime to the new layout There still remains more to be done to really separate kernel-specific code in the runtime, but both kernel and stapdyn modes do work now.
(In reply to comment #2) > The following commits did a lot of the work. Bah -- I meant this for PR14179. Time to copy/paste...
SystemTap 2.0 released the preliminary form of this feature. Since we also have a component:dyninst for this runtime, I'm closing this tracker bug, and we'll use individual PRs for new fixes and enhancements.