Chris Meek [Mon, 5 Mar 2012 21:16:31 +0000 (16:16 -0500)]
PR13661: Relax Server Rlimits (move to stap)
Added rlimit options to stap:
--rlimit-as=NUM
--rlimit-cpu=NUM
--rlimit-nproc=NUM
--rlimit-stack=NUM
--rlimit-fsize=NUM
These options will set the appropriate rlimits to whatever is
provided.
Removed all rlimit handling from stap-serverd.cxx. These values
can be specified in ~stap-server/.systemtap/rc.
Default values are added to ~stap-server/.systemtap/rc on install.
William Cohen [Fri, 2 Mar 2012 17:13:53 +0000 (12:13 -0500)]
Clean out tracking for blocks that are merged into other blocks
The IO system in linux often merges blocks together to reduce the number of
IO operations sent to IO devices. If nothing is done the tracking for
merged IO operations can fill up the associative arrays, causing the script
to fail. This problem was reported in rhbz743591. This commit resolves
this problem.
William Cohen [Fri, 2 Mar 2012 17:07:21 +0000 (12:07 -0500)]
Clean out tracking for blocks that are merged into other blocks
The IO system in linux often merges blocks together to reduce the number of
IO operations sent to IO devices. If nothing is done the tracking for
merged IO operations can fill up the associative arrays, causing the script
to fail. This problem was reported in rhbz743591. This commit resolves
this problem.
Stan Cox [Thu, 1 Mar 2012 04:11:32 +0000 (23:11 -0500)]
Match Requires to existing package layout.
* systemtap.spec (main): Only BuildRequires gcc-c++
(devel): Requires gcc make
(testsuite): Requires gcc gcc-c++ make glibc-devel and possibly glibc-devel.i386
Josh Stone [Wed, 29 Feb 2012 02:48:04 +0000 (18:48 -0800)]
PR13721 (partial): Move cross-file WARNING before setting arity
For PR10799, there is a WARNING check for when globals are used across
different files. However, set_arity was done first, so any exception
there would bypass the check.
* elaborate.cxx (symresolution_info::find_var): Warn before set_arity.
Mark J. Wielaard [Sat, 25 Feb 2012 16:05:48 +0000 (17:05 +0100)]
kernel/sched.c is no more, use kernel/time.c in examples and tests.
kernel commit v3.2-rc1-319-g391e43d
"sched: Move all scheduler bits into kernel/sched/"
removed kernel/sched.c. Use kernel/time.c in langref.tex and
stapprobes.3stap examples and systemtap.stress/current.stp test instead.
Chris Meek [Fri, 24 Feb 2012 19:17:29 +0000 (14:17 -0500)]
PR13609: Fixed interrupts and race conditions
- Interrupts are now handled properly. They
wait for any outstanding threads to finish
before exiting (unless a timeout occurs or
another interrupt happens)
- client_version is now local
- spawned_pids[] is now protected
William Cohen [Fri, 24 Feb 2012 13:32:37 +0000 (08:32 -0500)]
Do not probe ARM assembly language __switch_to function in current.stp test
The systemtap.stress/current.stp test did not work on ARM because the
test was trying to probe a function that is an assembly language function
on ARM. This patch avoids probing assembly language function.
David Smith [Wed, 22 Feb 2012 19:56:31 +0000 (13:56 -0600)]
Fix PR13646 (partial) by updating ipaddr testcase.
* testsuite/systemtap.base/ipaddr.exp: Change start_server() and
stop_server() procedure names to avoid clashing with procedures in
testsuite/lib/systemtap.exp.
David Smith [Tue, 21 Feb 2012 19:22:45 +0000 (13:22 -0600)]
Fix PR13646 (partial) by adding IPv6 support to 'tcp.receive'.
* tapset/tcp.stp: Added IPv6 support to tcp.receive by splitting it into
tcp.ipv4.receive and tcp.ipv6.receive (and making tcp.receive link to
both). Added a 'family' variable.
* testsuite/buildok/tcp-detailed.stp: Added compile testcase for
tcp.ipv4.receive and tcp.ipv6.receive.
* testsuite/systemtap.base/ipaddr.exp: Improved script output regexp.
* testsuite/systemtap.base/ipaddr2.stp: Works for IPv4 and IPv6.
David Smith [Tue, 21 Feb 2012 17:29:29 +0000 (11:29 -0600)]
Fix PR13646 (partial) by improving inline embedded-C expressions using AF_INET.
* tapset/inet_sock.stp: Add '/* pure */' to all inline embedded-C
expressions returning AF_INET/AF_INET6 so they can be optimized away.
* tapset/ip.stp: Ditto.
* tapset/nfs_proc.stp: Ditto.
* tapset/rpc.stp: Ditto.
* tapset/tcp.stp: Ditto.
Mark Wielaard [Tue, 21 Feb 2012 14:08:58 +0000 (15:08 +0100)]
PR13714 - Make sure REG_STATE.cfa_is_expr is always set correctly.
runtime/unwind.c (processCFI): Always set REG_STATE.cfa_is_expr and
add new sanity checks to make sure the cfa definition rules are sane.
Since the cfa expr pointer and cfa register/offset rule shared a union
not setting REG_STATE.cfa_is_expr could result in compute_expr ()
wrongly being called and using the register/offset as expr pointer.
David Smith [Mon, 20 Feb 2012 22:48:38 +0000 (16:48 -0600)]
Fix PR13646 (partial) by adding a testcase and some fixes.
* tapset/ip.stp (format_ipaddr): Marked as 'pure' so that it can be
optimized away. Fixed handling of IPv6 addresses.
(__ip_sock_saddr): Added support for IPv6 sockets.
(__ip_sock_daddr): Ditto.
* tapset/tcp.stp: Added 'family' variable to tcp.recvmsg and
tcp.recvmsg.return probes.
* tapset/nfs_proc.stp (AF_INET): Marked as 'pure' so that it can be
optimized away.
(AF_INET6): New function.
* testsuite/buildok/nfs_proc-embedded.stp: Added AF_INET6() compile test.
* testsuite/buildok/tcp-detailed.stp: Prints 'family' variable in
tcp.recvmsg and tcp.recvmsg.return probes.
* testsuite/systemtap.base/ipaddr.exp: New testcase.
* testsuite/systemtap.base/ipaddr.txt: Ditto.
* testsuite/systemtap.base/ipaddr1.stp: Ditto.
* testsuite/systemtap.base/ipaddr2.stp: Ditto.
David Smith [Wed, 15 Feb 2012 22:04:47 +0000 (16:04 -0600)]
Fix PR13646 (partial) by properly converting IPv6 addresses to strings.
* tapset/ip.stp: Added the format_ipaddr() function to handle converting
an IP address to a string. The ip_ntop() function now just calls
format_ipaddr(). Added the __ip_sock_family() function to return the IP
address family for a 'struct inet_sock'.
* tapset/inet_sock.stp: The inet_get_ip_source() function uses
format_ipaddr() to format an IP address as a string. The
daddr_to_string() function has been deprecated.
* tapset/rpc.stp: Make addr_from_rqst_str() handle IPv6 addresses.
* tapset/tcp.stp: Use format_ipaddr() instead of ip_ntop() to convert IP
adresses to strings.
* runtime/loc2c-runtime.h (kderef_buffer): New function.
* testsuite/buildok/inet_sock-embedded.stp: Deprecated daddr_to_string()
function test.
* testsuite/buildok/ip-embedded.stp: Added format_ipaddr() and
__ip_sock_family() tests.
* NEWS: Mention daddr_to_string() deprecation.
* stap.1: Ditto.
David Smith [Wed, 15 Feb 2012 15:20:57 +0000 (09:20 -0600)]
Update 3 semok tests for RHEL4.
* testsuite/semok/entry01.stp: Added 'kernel.function("filp_open")' probe
point for RHEL4 (which doesn't have 'kernel.function("do_filp_open")'.
* testsuite/semok/entry03.stp: Ditto.
* testsuite/semok/kretprobe-data.stp: Added
'kernel.function("path_lookup")' probe point for RHEL4 (which doesn't
have 'kernel.function("do_path_lookup")'.
William Cohen [Tue, 14 Feb 2012 16:02:51 +0000 (11:02 -0500)]
Make sure that procfs.c runtime code include <linux/mount.h>
On the arm architecture the <linux/mount.h> isn't pulled in by other
code. This one line change makes sure that the include file gets
pulled in. This allows the test using the procfs to build on arm.
David Smith [Fri, 10 Feb 2012 21:45:20 +0000 (15:45 -0600)]
(Fixed PR13681) Bulk mode scripts no longer leave the module behind on rhel4.
* runtime/staprun/relay_old.c (close_relayfs_files): 0 can be a valid
relay_fd[cpu] value.
(open_relayfs_files): On error, initialize relay_fd[cpu] to -1, not 0.
(init_oldrelayfs): Initialize relay_fd[cpu] to -1, not 0.
David Smith [Wed, 8 Feb 2012 14:55:49 +0000 (08:55 -0600)]
Fixed PR13670 by getting task_dentry_path() working on 3.3 kernels.
* tapset/dentry.stp (real_mount): New function.
(task_dentry_path): Uses real_mount() to get the 'struct mount' pointer
for a 'struct vfsmount' pointer (needed on 3.3 kernels).
* testsuite/buildok/dentry-embedded.stp: Added real_mount() test.
Chris Meek [Tue, 7 Feb 2012 21:23:08 +0000 (16:23 -0500)]
PR13609: Parallel Server Connections
Used pthreads to parallelize the server. A new thread is created to
handle each incomming connection. The maximum number of threads
created is limited by the new --max-threads=N option. If a value of
0 is passed, no new threads are created and each connection is
handled in the main thread, in serial. The default value is
equal to the number of processors on the host.
Stan Cox [Tue, 7 Feb 2012 21:47:44 +0000 (16:47 -0500)]
Get all source line matches for statement probes.
* dwflpp.cxx (iterate_over_srcfile_lines): Pass nsrcs=0 to
dwarf_getsrc_file so all source matches are returned instead of just
nsrcs=N matches.
* (has_single_line_record): Fix indentation. No other changes.
David Smith [Tue, 7 Feb 2012 21:35:46 +0000 (15:35 -0600)]
Fix PR13646 (partial) by improving use of 'AF_NET'.
* tapset/nfs_proc.stp: Added copyright header. Change AF_INET() to just do
'return %{ AF_INET %}'. Changed NFS_I() to used in-line embedded-C to
get 'AF_INET'.
* tapset/rpc.stp: Use in-line embedded-C to get 'AF_INET' instead of
calling AF_INET().
* testsuite/systemtap.examples/process/pfiles.stp: Use in-line embedded-C
to get 'AF_UNIX', 'AF_INET', and 'AF_NET6'.
William Cohen [Tue, 7 Feb 2012 18:16:58 +0000 (13:16 -0500)]
Avoid changing the linebreak in tapset.xml
There are cases where the linebreaks mess up the output for the man pages.
Removing the '<xsl:strip-space elements="*"/>' in sort-tapsets.xslt avoids
these issues.
David Smith [Thu, 2 Feb 2012 16:36:44 +0000 (10:36 -0600)]
Fix PR13641 by not calling a sleeping function from an invalid context.
* testsuite/systemtap.examples/process/pfiles.stp: To avoid the
possibility of sleeping while holding a lock, change GFP_KERNEL
allocation to GFP_ATOMIC allocation. Also convert i_mode2str() from an
embedded-C function.
Mark Wielaard [Tue, 31 Jan 2012 22:06:30 +0000 (23:06 +0100)]
Use UTRACE_ATTACH_ATOMIC when calling utrace create under lock.
UTRACE_ATTACH_ATOMIC is very new, but we need it when calling
utrace create while holding a lock or in interrupt context.
If it doesn't exist we do as before (define it as zero).
See http://sourceware.org/ml/systemtap/2011-q4/msg00340.html
William Cohen [Tue, 31 Jan 2012 15:50:53 +0000 (10:50 -0500)]
Add the stopwatch.stp tapset
The stopwatch.stp tapset provides multiple, independent timers to user
scripts. Stopwatches can be created by the user script at
anytime. The created stopwatches can be stopped and started by the
user script. The times from the stopwatches can be read in seconds,
milliseconds, microsecons, and nanoseconds.
Dave Brolley [Mon, 30 Jan 2012 18:40:16 +0000 (13:40 -0500)]
PR 13631 and other rework of multi-privilege level support
- PR 13631 - Detection of Reqested Privilege Level in stap-server
- Parsing of the client's command now uses getopt_long and shares
the getopt input with session.cxx
- cmdline.cxx, cmdline.h
- Do not allow multiple privilege-setting options to specify
different privilege levels.
- No longer a need for stap-serverd to generate a --privilege
option for the spawned stap.
- stap-serverd cannot (and no longer does) rely on knowledge of
the highest signed privilege level when evaluating the user's
credentials.
- Simplified user credentials test against those required by the module
in stap-serverd.
- Some kernel.* probes were being registered for use by stapdev only.
Corrected to be stapdev | stapsys.
- Corrected testsuite problem which was hiding this bug.
Josh Stone [Sat, 28 Jan 2012 00:16:56 +0000 (16:16 -0800)]
task_finder2: update an unprivileged check for stapsys
* runtime/task_finder2.c (stap_start_task_finder): Update the macro
around the "only probe their own threads" check to exempt both stapdev
and stapsys modules (as __stp_utrace_attach_match_filename does).
Mark Wielaard [Thu, 26 Jan 2012 22:58:38 +0000 (23:58 +0100)]
PR13626 Add extra whitespace in sdt.h to deal with C11/C++11 UDF.
gcc 4.7 supports C11/C++11 user defined literals (UDF):
https://en.wikipedia.org/wiki/C%2B%2B11#User-defined_literals
In std=c++0x mode one now needs to add whitespace between string literals.
See http://gcc.gnu.org/gcc-4.7/porting_to.html
Chris Meek [Thu, 26 Jan 2012 18:56:07 +0000 (13:56 -0500)]
PR13546 Cont'd: Fixed failing test cases
Since we introduced a random seed to the hash function,
certain tests that printed results in an unordered
fashion could now fail, since the order is not necessarily
the same from run to run. These tests have been fixed and now
print in a certain order as to avoid those errors.
Chris Meek [Thu, 26 Jan 2012 18:48:46 +0000 (13:48 -0500)]
PR13546 - Improve Map Hashing
- Made str_hash() in map.c more hashy.
- Introduced a runtime random seed to the hash calculations
to reduce the chance of deliberate hash collision inducing
attacks.
- Made the HASH_TABLE_SIZE depend on MAXMAPENTRIES, rather than
just a static 256. This effectivly increases the size of the
hash table.