David Smith [Thu, 13 Feb 2014 19:54:35 +0000 (13:54 -0600)]
Fix PR16580 by decoding the 'protocol' argument of 'syscall.socket{pair}'.
* tapset/linux/aux_syscalls.stp (_sock_protocol_str): New function.
* tapset/linux/syscalls2.stp: Decode the 'protocol' argument in
syscall.socket and syscall.socketpair with _sock_protocol_str().
* tapset/linux/nd_syscalls2.stp: Ditto.
* testsuite/systemtap.syscall/socket.c: New test.
* testsuite/systemtap.syscall/socketpair.c: Updated test to expect decoded
'protocol' arguments.
* testsuite/systemtap.syscall/net1.c: Ditto.
Lukas Berk [Thu, 13 Feb 2014 16:18:18 +0000 (11:18 -0500)]
Check directories exist before sym linking runtime-java helpers
* systemtap.spec - When we're linking libHelperSDT_*.so and
HelperSDT.jar we need to make sure that the openjdk
dirs we're linking to actually exist if yum/openjdk
failed to remove the base dir on an openjdk upgrade.
Jonathan Lebon [Wed, 12 Feb 2014 21:43:47 +0000 (16:43 -0500)]
find_and_build: set from_glob for globby functors
We don't want to create suggestions for probe points created from globby
functors (e.g. syscall.*). Otherwise, we'll be creating a lot of
overhead calculating levenshtein distances for no reason.
Dave Brolley [Wed, 12 Feb 2014 21:03:51 +0000 (16:03 -0500)]
RHBZ 847285: Don't allow 'systemctl reload'.
'reload' is not supported by the stap-server script. The
ExecReload line in stap-server.service was calling
'stap-server restart' which stops the server and starts a
new one. This behavior is not expected or tolerated by systemd
which promptly sends SIGKILL to the new server.
We cannot supported 'reload' in systemctl. Note that 'restart'
is supported and works properly.
David Smith [Wed, 12 Feb 2014 18:58:41 +0000 (12:58 -0600)]
Fix PR16570 by speeding up the syscall.exp/nd_syscall.exp testcases.
* testsuite/systemtap.syscall/syscall.exp: Compile the module once.
* testsuite/systemtap.syscall/nd_syscall.exp: Ditto.
* testsuite/systemtap.syscall/test.tcl (run_one_test): Use staprun to load
the previously compiled module.
David Smith [Tue, 11 Feb 2014 18:07:57 +0000 (12:07 -0600)]
Small scheduler tapset testsuite fixes.
* testsuite/buildok/scheduler-cpu_on.stp: New file.
* testsuite/buildok/scheduler-detailed.stp: Moved 'scheduler.cpu_on' test
to scheduler-cpu_on.stp.
* testsuite/buildok/scheduler-migrate.stp: Removed unneeded
'__scheduler.migrate.kp' test.
David Smith [Tue, 11 Feb 2014 18:03:58 +0000 (12:03 -0600)]
Make 'signal.checkperm.return' optional, since it can be inlined.
* tapset/linux/signal.stp: On some kernels, check_kill_permission() can be
only inlined, so make 'signal.checkperm.return' optional.
* testsuite/buildok/signal-detailed.stp: Make the
'signal.checkperm.return' test optional
David Smith [Tue, 11 Feb 2014 17:38:03 +0000 (11:38 -0600)]
Fix PR16557 by improving the vm.mmap probe alias.
* tapset/linux/memory.stp (vm.mmap): Improve probe alias by probing
do_mmap_pgoff() (when available) instead of do_mmap(), which can be
always inlined.
David Smith [Mon, 10 Feb 2014 23:08:13 +0000 (17:08 -0600)]
Fix kernels that have CONFIG_USER_NS, but uid/gids are still simple values.
* buildrun.cxx (compile_pass): Add an export test for "from_kuid_munged".
* runtime/linux/runtime.h: If we don't have "from_kuid_munged", define our
own from_kgid_munged()/from_kgid_munged() that do nothing.
Jonathan Lebon [Mon, 10 Feb 2014 20:47:25 +0000 (15:47 -0500)]
delete initscript/README.stap-server
The large majority of information in README.stap-server was already part
of the stap-server(8) man page. A few examples and clarifications were
transferred over.
- initscript/README.stap-server: delete it
- man/stap-server.8: incorporate some of the examples from the README
and some clarifications
- systemtap.spec: remove README.stap-server from $files list
- NEWS: add blurb about removal
David Smith [Mon, 10 Feb 2014 19:07:09 +0000 (13:07 -0600)]
Fix PR16541 by updating the nfsd.stp tapset.
* tapset/linux/nfsd.stp: Two fixes. Handle kernels with CONFIG_USER_NS,
whose uids/gids aren't simple types. In nfsd.close, handle the inlined
case were we can't find the argument.
Jonathan Lebon [Mon, 10 Feb 2014 15:20:56 +0000 (10:20 -0500)]
man/systemtap.8.in: new man page to replace README
This man page replaces the README.systemtap text file. The content is
almost the same. A lot of rephrasing, some restructuring, and some
clarifications that weren't present in the original document.
- man/systemtap.8.in: new man page
- initscript/README.systemtap: remove it
- initscript/systemtap.in: add hint to man page
- configure.ac: add man/systemtap.8.in in AC_CONFIG_FILES macro
- man/Makefile.am: add systemtap.8 to man_MANS
- systemtap.spec: replace README by man page in systemtap-initscript pkg
$files list
runtime: linux 3.14 porting: userns: Remove UIDGID_STRICT_TYPE_CHECKS
Adapt to linux commit 261000a56b6382f597bcb12000f55c9ff26a1efb
by using CONFIG_USER_NS as trigger for our *id*munged treatment
instead of CONFIG_UIDGID_STRICT_TYPE_CHECKS.
Jonathan Lebon [Wed, 22 Jan 2014 14:01:57 +0000 (09:01 -0500)]
string.stp: fix str_replace() return
Unfortunately, we can't use STAP_RETURN() here because we've been
gradually building STAP_RETVALUE from multiple concatenations so using
STAP_RETURN() would overwrite the hard work.
Jonathan Lebon [Fri, 17 Jan 2014 17:11:20 +0000 (12:11 -0500)]
stap[run/dyn]: disable colors when SYSTEMTAP_COLORS empty
The current behaviour of SYSTEMTAP_COLORS is to turn on colors if it is
not set, or set but empty, and to turn off colors when set and invalid.
With this patch, rather than having users purposely make it invalid to
turn off colors, we interpret a set but empty SYSTEMTAP_COLORS to mean
turning colors off.
Jonathan Lebon [Thu, 16 Jan 2014 22:21:41 +0000 (17:21 -0500)]
PR15781: fix suggestion logic for optional probes
We previously used the heuristic of not suggesting functions for
optional probes to get around issues with recursive calls to
derive_probes from globby probes. This had the disadvantage that
suggestions could not be made for truly (script-level) optional probes.
We now add the new field 'from_glob' to probe_point which tracks whether
the probe_point was created out of a globby pp. We can thus now easily
determine when it is correct to suggest something, and when we should
suggest nothing but rather accumulate modules to suggest from.
Jonathan Lebon [Thu, 16 Jan 2014 22:13:36 +0000 (17:13 -0500)]
elaborate.cxx: save up all errors from optional pps
We remember all semantic_error objects caught even for optional probe
points so that if we get an error for a non-optional probe point, we
also print out the info of optional probe points that failed. This
gives users a clearer picture of why the whole probe failed.
Jonathan Lebon [Thu, 16 Jan 2014 22:07:03 +0000 (17:07 -0500)]
semantic_error: let it own its chain
This patch simplifies the way semantic_error chains are used by allowing
the parent object to own its chain. Upon setting the chain, the parent
creates a copy and keeps it secret, to be de-allocated upon destruction.
The patch also modifies the semantic_error constructor to allow the
chain to be also set at the same time.
Lukas Berk [Mon, 20 Jan 2014 20:39:35 +0000 (15:39 -0500)]
Add java backtrace test
*java.exp - delay removal of singleparam.class so backtrace test can use
it, also add the backtrace testcase
*singleparam.java - have method's call each other in the same order
instead of having each called directly from main,
this allows for a better backtrace
*java.stp - renamed to singleparam.stp for consistency with other tests
Lukas Berk [Mon, 20 Jan 2014 20:33:25 +0000 (15:33 -0500)]
Update/correct java testcase string
A remanent of when pn() originally passed the class.method name. This was
changed before the 2.2.1 release due to the fact byteman can't (yet)
properly pass that, so the unique identifier was changed. We should
update what the testcase is looking for just the parameter that was
passed.
* testsuite/systemtap.apps/java.exp - update search strings in test
Lukas Berk [Mon, 20 Jan 2014 20:30:54 +0000 (15:30 -0500)]
Fix how stapbm passes itself the methodname
*java/stapbm.in - we need to make sure stapbm passes the methodname with
the surrounding quotes in case there are multiple
parameters in the method call (otherwise stambm will
call itself with up to 17 parameters and error out)
Lukas Berk [Fri, 17 Jan 2014 23:26:58 +0000 (18:26 -0500)]
Add java backtrace functionality
This commit adds two functions, sprint_java_backtrace() and
print_java_backtrace. The former returns the java backtrace as one
string (may need to set the -DMAXSTRINGLEN var to read the entire
backtrace), and latter prints the java backtrace one line at a time.
*java/HelperSDT.c - Add METHOD_STAP_BT and _METHOD_BT_DELETE jni
functions
*java/HelperSDT.h - ditto
*java/..../HelperSDT.java - ditto
*java/stapbm.in - add conditional calls to functions based on backtrace
flag status
*tapset-method.cxx - add the probe points for METHOD_STAP_BT and
METHOD_BT_DELETE to be handled
*tapset/java.stp - add sprint_java_backtrace and print_java_backtrace functions
David Smith [Fri, 17 Jan 2014 19:21:40 +0000 (13:21 -0600)]
Improve avahi string list handling.
* csclient.cxx (get_value_from_avahi_string_list): Rewrite
extract_field_from_avahi_txt() to use native avahi string list
functions.
(resolve_callback): Call new function.
David Smith [Fri, 17 Jan 2014 18:11:51 +0000 (12:11 -0600)]
Handle updated server messages in server_[args,concurrency].exp testcases.
* testsuite/systemtap.server/server_args.exp
(stap_direct_and_with_client): Handle more than one hostname to skip.
* testsuite/systemtap.server/server_concurrency.exp: Handle new network
port message output.
Josh Stone [Fri, 17 Jan 2014 06:10:34 +0000 (22:10 -0800)]
Remember which rpms have been checked in the session
When the kernel or any userspace file is missing debuginfo, we run an
rpm query so packages can be suggested. If the user tries many such
probes on the same target, it's a waste to repeat the same query. Now
we remember which targets have already been checked in the session.
This was seen on a simple 'stap -l syscall.*', which took much longer to
run when debuginfo was missing than when present. With this patch, the
first syscall miss will lead to an rpm query, but each following miss
will know it's already been done.
Jonathan Lebon [Wed, 8 Jan 2014 20:54:23 +0000 (15:54 -0500)]
systemtap.spec: fix %post/%postun for initscript pkg
In the systemtap-iniscript pkg's %post and %postun, stap-server is
used rather systemtap (copy/pasted from stap-server's section?). Also,
we don't need the call to systemd-tmpfiles since the initscript pkg does
not define any tmpfiles.d config file (may also just have been left-over
from the server section).
Jonathan Lebon [Wed, 27 Nov 2013 16:21:02 +0000 (11:21 -0500)]
tapset-utrace.cxx: allow pid 1 probing
We originally limited the PID of a process(PID) probe to be greater than
1 to be on the safe side. Our latest utrace poses less risk and thus
probing init should be fine.
Frank Ch. Eigler [Sat, 11 Jan 2014 00:51:37 +0000 (19:51 -0500)]
stap translator: tolerate NULLs coming from some elfutils string lookups
It was reported on the mailing list, and privately experienced, that
stap pass-2 crashes could occur due to NULL dwarf_diename or
dwarf_decl_file's being propagated rather far within stap. This
commit adds protections (of the form ?: "foo") to eliminate the
problem in a few spots. There may be others; we should not store
so many raw char*'s.
Robin Hack [Thu, 9 Jan 2014 21:52:55 +0000 (16:52 -0500)]
tapset: add decoded sockaddr field vars to socket-related syscalls
* tapset/linux/aux_syscalls.stp (_struct_sockaddr_u_impl): New pretty-printer
with a bitfieldful of options.
* tapset/linux/syscalls.stpm (@_af_inet_info_u): New macro to pull call it.
* tapset/linux/*syscalls*: Lots of calls to it.
* testsuite/systemtap.examples/network/connect_stat.stp: New sample script.