Josh Stone [Fri, 10 May 2013 20:09:20 +0000 (13:09 -0700)]
stapdyn: hide internal module functions
The header stapdyn.h is only for functions meant to be called from the
stapdyn binary into the module, so stp_dyninst_session_init_finished
shouldn't be there. Also, all functions that aren't part of stapdyn.h
should be declared with static visibility.
David Smith [Fri, 10 May 2013 19:41:00 +0000 (14:41 -0500)]
Fixed PR15456 by updating syscall tapsets with compat function changes.
* tapset/linux/syscalls.stp (syscall.compat_sys_msgrcv): Updated for newer
kernel compat function argument names.
(syscall.compat_sys_msgsnd): Ditto.
* tapset/linux/syscalls2.stp (syscall.compat_sys_semctl): Updated for
newer kernel compat function argument names.
(syscall.compat_sys_shmat): Updated for newer kernel compat function
argument names. Deprecated old "first", "second", "third" variable names
in favor of variable names that match the non-compat probe alias.
* tapset/linux/nd_syscalls2.stp: Ditto.
* testsuite/buildok/nd_syscalls2-detailed.stp: Updated with new variables
in the "shmat" probe alias.
* testsuite/buildok/syscalls2-detailed.stp: Ditto.
* NEWS: Mentioned variable deprecations.
Serguei Makarov [Fri, 10 May 2013 19:05:54 +0000 (15:05 -0400)]
probe timer.profile: workaround for the incredible disappearing register_timer_hook()
* tapset-timers.cxx: rename timer.profile to timer.profile.tick, explicitly
check for existence of kernel registration functions.
* tapset/timers.stp: timer.profile aliases to either timer.profile.tick
or perf.sw.cpu_clock as an alternative.
runtime perf.c: consistentify perf_event_create_kernel_counter context* use
Two runtime/linux/autoconf tests create a cartesian product of sorts
about the evolution of the $subject kernel API. In one spot, the
runtime neglected to consider the modern combination, breaking perf.*
probes on recent kernels.
Caused by commit 30c05350c39d ("powerpc/pseries: Use stop machine to
update cpu maps") from the powerpc tree interacting with (probably)
commit ff794dea52ea ("cpuset: remove include of cgroup.h from cpuset.h")
from the cgroup tree. Removing includes from header files is fraught
with danger ...
PR15445: fix kernel panic due to hardware-breakpoint callback abi incompatibility
* tapsets.cxx (hwbkpt_derived_probe_group::emit_module_decls): Add support for
non-STAPCONF_PERF_HANDLER_NMI kernels.
* testsuite/systemtap.examples/memory/hw_watch*.meta: Use a more likely-to-trigger
target variable, to make it more likely that this problem doesn't reoccur.
David Smith [Tue, 7 May 2013 21:21:03 +0000 (16:21 -0500)]
Fix PR15408. Create top-level procfs directory in init_module, where we're root.
* translate.cxx (emit_kernel_module_init): New function.
(emit_kernel_module_exit): Ditto.
(translate_pass): Call emit_kernel_module_init() and
emit_kernel_module_exit().
* translate.h: Add prototypes for emit_kernel_module_init() and
emit_kernel_module_exit().
* runtime/linux/runtime.h (init_module): Calls generated
systemtap_kernel_module_init().
(cleanup_module): Calls generated systemtap_kernel_module_exit().
* tapset-procfs.cxx (emit_module_decls): New function.
(emit_kernel_module_exit): Ditto.
* runtime/procfs.c (_stp_rmdir_proc_module): Improve error messages. No
longer use _stp_warn(), since transport won't be available.
(_stp_mkdir_prpoc_module): Improve error messages. Invert return code so
that 0 is success.
(_stp_create_procfs): No longer call _stp_mkdir_proc_module(), which now
gets called from generated systemtap_kernel_module_init().
(_stp_close_procfs): No longer call _stp_rmdir_proc_module(), which now
gets called from generated systemtap_kernel_module_exit().
* elaborate.h (struct derived_probe_group): Added
emit_kernel_module_init() and emit_kernel_module_exit() prototypes.
Lukas Berk [Tue, 30 Apr 2013 20:46:23 +0000 (16:46 -0400)]
remove spaces in rule names and their files for bmsubmit and bminstall
*java/stapbm: surround all variables in quotes to manage spaces
*tapset-method.cxx: add new_no_method (standing for no spaces),
this will be the rule name which is used to pass
to bmsubmit and actually name the file
Lukas Berk [Mon, 29 Apr 2013 14:47:58 +0000 (10:47 -0400)]
Add check for '.sh' suffix on byteman specific commands
*java/stapbm: When installed from rpm, byteman scripts do not have the
'.sh' suffix. However, they do if byteman is installed from
source. We need to be flexible on which we accept.
Lukas Berk [Sat, 27 Apr 2013 19:13:57 +0000 (15:13 -0400)]
Add passable -J<BYTEMAN_INSTALL_OPTIONS> to stap
This will allow systemtap to pass options to bminstall. This can include
an option such as -Jorg.jboss.byteman.compile.to.bytecode which will then
be passed as -Dorg.jboss.byteman.compile.to.bytecode and directly compile
the byteman rule to bytecode, allowing for faster rule execution
*cmdline.h: add the J case
*java/stapbm: add the new (optional) parameter to be passed
*session.cxx: add the new -J case statement
*session.h: compilation variable
*tapset-method.cxx: append the passed command
Lukas Berk [Sat, 27 Apr 2013 18:27:19 +0000 (14:27 -0400)]
Add java.exp testcase
*testsuite/systemtap.apps/java.exp: expect file for testcase
*testsuite/systemtap.apps/java.stp: script to use for java testing
*testsuite/systemtap.apps/singleparam.java: java file to compile and test
Lukas Berk [Sat, 27 Apr 2013 17:39:36 +0000 (13:39 -0400)]
Add a locking file while writing the rule in stapbm script
*java/stapbm: at times there are several rules being written so quickly
that the script overlaps the rules, resulting in an errnous
script, add a lock file to ensure this doesn't happen
configure.ac: rework configury to support --with-helper and --with-jdk options
The different options control where libHelperSDT.so and HelperSDT.jar end up.
Use --with-helper to install to a folder like libexec for subsequent symlinking
Use --with-jdk to install a jdk folder under ...ext/ and ...amd64/ directories
Lukas Berk [Thu, 25 Apr 2013 19:07:11 +0000 (15:07 -0400)]
Adjust stapbm to allow more than one rule per process
*java/stapbm: Relax script to allow more than one rule per process
This required file locks to be used to ensure bminstall
was only called once, as well as only allowing one
rule to be submitted at a time.
*java/tapset-method.cxx: stapbm script always needs all parameters to be
passed to ensure properly running behaviour
Lukas Berk [Tue, 23 Apr 2013 16:34:46 +0000 (12:34 -0400)]
Moved bm{install,submit} operations to pass 5
*java/stapbm: removed unneeded suffix from file name
*session.cxx: remove byteman operations/variables
*session.h: remove byteman operations/variables
*tapset-method.cxx: add new add new probe points and ensure that
the main probe body isn't copied to all new
probe points
Lukas Berk [Thu, 4 Apr 2013 15:24:51 +0000 (11:24 -0400)]
Only install rules once per java process
*session.cxx: re-enable the check before executing java_detach
*tapset-method.cxx: only bminstall.sh the process if its not already been recorded
and check to see if we've installed any java procs already
Lukas Berk [Wed, 3 Apr 2013 21:26:40 +0000 (17:26 -0400)]
Allow more than one java probe point per script
*tapset-method.cxx: add filter to match probe against the class
and method, if it doesn't match, then skip
the probe point
*session.cxx: change how rules are uninstalled
Lukas Berk [Tue, 19 Mar 2013 14:39:59 +0000 (10:39 -0400)]
Cleanup and use stap_system() to launch commands
*tapset-method.cxx: use stap_system() to launch bmsubmit and bminstall
commands instead of forking and managing it ourselves.
Also, a small cleanup of commented out vars and varnames
Lukas Berk [Mon, 18 Mar 2013 23:11:29 +0000 (19:11 -0400)]
Uninstall the specific byteman rule we generated
*session.cxx: add systemtap_session member variables and use
stap_system to launch bmsubmit.sh uninstall command
*session.h: added member variable declarations
*tapset-method.cx: use member variables so we know which rule to uninstall
*tapsets.cxx: reorder which tapsets to register so normal process probes
are registered first
Lukas Berk [Thu, 14 Mar 2013 20:44:06 +0000 (16:44 -0400)]
Exit gracefully from a java process (uninstall rules)
*session.cxx: add java_detach() function, exec bmsubmit.sh -u
*session.h: declaration of java_detach
*tapset-method: change some local variables to systemtap_session
variables for java_detach
Lukas Berk [Mon, 4 Mar 2013 20:38:58 +0000 (15:38 -0500)]
Add java specific helper files
*java/HelperSDT.c: the actual value extraction and passing to stap
*java/HelperSDT.h: the jni header file
*java/HelperSDT.java: the java jni file
*java/README: how to manually compile and add the .jar and .so
*java/TODO: the TODO for automation
*tapset-method.cxx: fix the helper name
Lukas Berk [Mon, 4 Mar 2013 18:50:34 +0000 (13:50 -0500)]
Make use of HAVE_HELPER config variable
*tapset-method.cxx: only create new probe point and exec byteman
if HAVE_HELPER / --with-helper was defined
and use the specified variable in the new
process("libHelperSDT.so").mark("*") probe
Lukas Berk [Sat, 2 Mar 2013 20:41:59 +0000 (15:41 -0500)]
Fix method argument amount calculation
*tapset-method.cxx: previously the number of arguments in a method
was determined by counting the number of ','s.
Fix this by checking for distance between ()'s