Mark Wielaard [Fri, 19 Mar 2010 19:57:01 +0000 (20:57 +0100)]
Add ia64 pipe result support. Relax pipe syscall test a little.
* tapset/syscalls2.stp (syscall.pipe.return): ia64 provides pipe0, pipe1
results through (user) registers.
* testsuite/systemtap.syscall/pipe.c: Only expect zero as input fildes.
Josh Stone [Fri, 19 Mar 2010 19:04:39 +0000 (12:04 -0700)]
Let try_block contain any statement
We still require the block for parsing, but the optimizer likes to fold
singleton blocks away, so any statement is possible. PR11341 masks such
issues at compile time, but I'm a little surprised that we've gotten
away with this at runtime...
Mark Wielaard [Fri, 19 Mar 2010 12:00:50 +0000 (13:00 +0100)]
PR11402 Support pipe2 syscall.
The pipe2() was added to Linux in version 2.6.27. It is a variant of the
normal pipe syscall, but takes an extra flags argument which can be the
ORed value of O_NONBLOCK and O_CLOEXEC.
* tapset/aux_syscalls.stp (_sys_pipe2_flag_str:string): New helper function.
* tapset/syscalls2.stp (syscall.pipe2, syscall.pipe2.return): New probes.
Mark Wielaard [Fri, 19 Mar 2010 10:55:57 +0000 (11:55 +0100)]
Make pipe file descriptors available in syscall.pipe[.return].
The actual value of the pipe file descriptors can be interesting,
especially in the syscall.pipe.return probe. This can be done without
any embedded C now using @cast. So don't use _fildes_u() anymore.
_fildes_u in aux_syscall.stp is still retained because it is used in
nd_syscalls2.stp for pipe.
* tapset/syscalls2.stp (syscall.pipe, syscall.pipe.return): Add pipe1
pipe2 convenience variables. Don't use _fildes_u for argstr anymore.
Mark Wielaard [Fri, 19 Mar 2010 10:32:22 +0000 (11:32 +0100)]
Use @defined() in syscall.pipe to select whether fildes_uaddr is available.
* tapset/aux_syscalls.stp (syscall.pipe): Remove architecture dependent
probe definitions. Newer gcc make $fildes available on more arches.
Use @defined($fildes) to select on which ones.
Josh Stone [Fri, 19 Mar 2010 01:57:10 +0000 (18:57 -0700)]
Simplify the perf entry handlers
* tapset-perfmon.cxx (perf_derived_probe_group::emit_module_decls):
Just pass an index from the individual entry handlers, and let
handle_perf_probe figure out the pp and ph.
Josh Stone [Fri, 19 Mar 2010 01:54:18 +0000 (18:54 -0700)]
Create one perf structure to rule them all
* perf.h (stap_perf_probe): Define one structure for all our needs.
* perf.c (_stp_perf_init): Use the new struct, return errors directly.
(_stp_perf_exit): Use the new struct.
* tapset-perfmon.cxx (perf_derived_probe_group::emit_module_decls): Use
the stap_perf_probe definition from perf.h now.
(perf_derived_probe_group::emit_module_init): Adapt.
(perf_derived_probe_group::emit_module_exit): Adapt.
Josh Stone [Thu, 18 Mar 2010 22:39:42 +0000 (15:39 -0700)]
PR11346: Move the skip-badvars logic into const-folding
The const_folder is where we prune constant expressions, like
conditionals based on a @defined($foo), so we want to give this a chance
to work before skip-badvars comes in and throws a warning.
As an added bonus, this makes skip-badvars more generic, so it will work
even for non-dwarf $target variables.
* elaborate.cxx (const_folder::visit_target_symbol): Enact skip-badvars.
* tapsets.cxx (dwarf_var_expanding_visitor::visit_target_symbol): Don't
worry about badvars here anymore. Save the error now, clean up later.
* testsuite/semok/badvar_undefined.stp: Test that @defined with
skip-badvars doesn't throw any warnings.
Frank Ch. Eigler [Thu, 18 Mar 2010 13:35:28 +0000 (09:35 -0400)]
PR909: store kernel exported symbols in session object
* session.h (kernel_exports): New field.
* main.cxx (parse_kernel_exports): Fill it.
* tapset-perfmon.cxx (perf_builder::build): Check it for our pal
perf_event_create_kernel_counter.
Josh Stone [Thu, 18 Mar 2010 02:06:56 +0000 (19:06 -0700)]
Preserve perf initialization errors
* runtime/perf.c (_stp_perf_init): Pass through ERR_PTRs, and create our
own -ENOMEM for allocation failures.
* tapset-perfmon.cxx (perf_derived_probe_group::emit_module_init): Check
IS_ERR for registration status.
Josh Stone [Thu, 18 Mar 2010 00:30:06 +0000 (17:30 -0700)]
PR909: Emit proper decls for perf probes
While I still have some TODOs, it's now in a usable state for others to
start testing...
* tapset-perfmon.cxx (perf_derived_probe_group::emit_module_decls):
Implement the code to hook up real stap handlers.
(perf_derived_probe_group::emit_module_init): Register for real.
(perf_derived_probe_group::emit_module_exit): Unregister.
Josh Stone [Wed, 17 Mar 2010 21:07:56 +0000 (14:07 -0700)]
Translate perf events names into kernel names
* tapset-perfmon.cxx (perf_builder::translate_event): New. The event
mapping is hard-copied from the current state of perf.
(perf_builder::build): Call it.
Josh Stone [Tue, 16 Mar 2010 23:53:48 +0000 (16:53 -0700)]
Rename perf probe points
These are now the available points:
perf.event("NAME")
perf.event("NAME").sample(NUM)
* tapset-perfmon.cxx (perf_derived_probe::perf_derived_probe): Add
fields for the event name, type, and config. Rewrite the probe_point
to match the derived components
(perf_builder::build): Parse the new fields.
(register_tapset_perf): Adapt the match_nodes.
Will Cohen [Wed, 17 Feb 2010 16:28:36 +0000 (11:28 -0500)]
Modify the systemtap perf sampling internal api
The only information available in the overflow interrupt is the event.
Need to group other pieces of information needed by systemtap, so they
can be found based on the the location of the event information.
Will Cohen [Wed, 17 Feb 2010 15:30:15 +0000 (10:30 -0500)]
PR909: Runtime for Performance Event Sampling
Implements a very simple sampling runtime to using the performance
events kernel API. An perf event attribute describing the setup and a
function to handle the counter overflows are passed into
_stp_perf_init(). This function sets up the event on each processor.
If successfully initialized, a pointer data structure is
returned. When the sampling is no longer needed _stp_perf_del() is
called to shutdown the sampling.
* runtime/perf.h: Add declarations for data structures and functions
* runtime/perf.c: Remove old perfmon runtime runtime.
Add _stp_perf_init() and _stp_perf_del() functions.
David Smith [Tue, 16 Mar 2010 20:47:36 +0000 (15:47 -0500)]
Fixed PR 11372 by removing (most) embedded-C from proc_mem.stp.
* tapset/proc_mem.stp: Tried to remove as much embedded-C as possible.
* tapset/atomic.stp: New file.
* testsuite/buildok/atomic.stp: New file.
* testsuite/systemtap.base/atomic.exp: Ditto.
* testsuite/systemtap.base/atomic_module.c: Ditto.
* testsuite/systemtap.base/atomic_module.makefile: Ditto.
David Smith [Tue, 16 Mar 2010 20:10:06 +0000 (15:10 -0500)]
Move common code from {maxmemory.exp,overload.exp} into stap_run_error.exp.
* testsuite/lib/stap_run_error.exp: New file.
* testsuite/config/unix.exp: Loads stap_run_error.exp.
* testsuite/systemtap.base/maxmemory.exp: Uses stap_run_error function
instead of local code.
* testsuite/systemtap.base/overload.exp: Ditto.
Josh Stone [Tue, 16 Mar 2010 18:11:26 +0000 (11:11 -0700)]
PR10831: Remember derived "aliases" in the probe chain
SDT and label probes are not really final probe types themselves, but
rather they get translated into some other final type. This patch
preserves this relationship as if SDT and label probes were dynamically
generated aliases.
* elaborate.cxx (probe::create_alias): New, fake an alias_derived_probe.
* tapsets.cxx (query_label): Append the label name as an alias.
(sdt_query::handle_query_module): Let convert_location do the alias.
(sdt_query::convert_location): Translate the location using an alias.
* main.cxx (printscript): Elaborate the derivation debug dump.
Steve Dickson [Tue, 16 Mar 2010 12:23:14 +0000 (08:23 -0400)]
The rpc buildok test suite probe breaks with new kernels
With newer kernels the rpc_release_task() routine is not defined
because it becomes inline since its only called once. Plus the
task allocation routines have changed so the arguments no longer
match up with previous routines. So this patch uses the kernel_v
clauses to allow the original functionality with older kernels
and not to break on new kernels.
Steve Dickson [Thu, 4 Mar 2010 20:35:12 +0000 (15:35 -0500)]
Backport recently added probes to RHEL5(U5)
Ensured the recent additions of v4 probes and supporting
routines worked or at least don't break with RHEL5 U5 kernels
(this time without kernel version checks).
Steve Dickson [Tue, 23 Feb 2010 16:58:16 +0000 (11:58 -0500)]
Allow better filtering with IP address and File handle
To allow filtering by the client's IP address,
the addr_from_rqst_str() function was added which
extracts the IP address from incoming procedures
and converts them into a character string. Calls to
addr_from_rqst_str() were added to the top of each
probe so callers of the probes can use the IP addresses
as a filter.
Calls to __svc_fh() were also sprinkled were needed
so callers can also filter on file handles
Josh Stone [Fri, 12 Mar 2010 19:39:52 +0000 (11:39 -0800)]
Get d_path's root natively with @cast
As mjw's aborted commit 5ab0b1b6 attempted, we can use a @cast to get
the filesystem root for the current task instead of embedded-C. I've
left it using the kernel debuginfo instead of headers for now, because
all of the neighboring @casts are doing the same.
* tapset/dentry.stp (d_path): Use @cast to get the root.
(__dentry_get_current_root): Remove, no longer needed.
* testsuite/buildok/dentry.stp: Test that dentry's functions all build.
William Cohen [Fri, 12 Mar 2010 16:31:24 +0000 (11:31 -0500)]
langref.tex editing
Reviewed the language reference manual and made editing changes:
-Reorderd sections for better grouping
-Added description of the @defined operation
-Corrected limits for MAXSTRENLEN and number of indices in associate array
-Adjusted language in aggregates section
-Corrected @hist example writeup.
-Make output for @hist avoid page breaks
-Updated information about manpages in "For Futher References" section
Josh Stone [Fri, 12 Mar 2010 01:14:59 +0000 (17:14 -0800)]
Fix the edge-case of MAXTRYLOCK=0
We didn't really have good semantics for what is meant by MAXTRYLOCK=0,
so when skipped.exp tried it, we ended up locking the variable and then
reporting a skip without ever unlocking it.
This is now cleaning up the semantics such that MAXTRYLOCK defines how
many times we should loop if the lock is busy. Thus MAXTRYLOCK=0 means
we try only once and fail immediately.
The testcase was accidentally creating contention due to the broken
unlock behavior. We now have to try a bit harder to create real
contention, so some lengthy delays are inserted to hoard the lock.
* runtime/probe_lock.h (stp_probe_lock): Fix the skip behavior.
* testsuite/systemtap.base/skipped.exp: Add a big udelay.
Josh Stone [Thu, 11 Mar 2010 03:17:40 +0000 (19:17 -0800)]
PR11370: Add multi-header @casts
Sometimes you need multiple headers to fully describe a type, so we now
permit them to be listed together, e.g. "kernel<foo.h><bar.h>".
* buildrun.cxx (make_typequery): Split the input string into a vector.
(make_typequery_kmod, make_typequery_umod): Use the vector of headers.
* testsuite/semok/cast.stp: Add a multi-header case.
* stap.1.in, NEWS: Document it.
William Cohen [Wed, 10 Mar 2010 20:53:32 +0000 (15:53 -0500)]
PR 11210 move stapprobe.* man pages to tapset::*
make on RHEL-5 and earlier cannot deal with the :: in the man page names.
This work around uses the install-data-local rule to install the
manpages to avoid confusing the older versions of make.
Josh Stone [Tue, 9 Mar 2010 23:32:58 +0000 (15:32 -0800)]
PR11360: Make @defined and -L play nice
The constant-folding is now enabled for s.listing_mode_vars, despite all
other optimizations being disabled. This is needed so we can prune any
invalid branches that are gated by @defined.
* elaborate.cxx (semantic_pass): Leave the optimization decision to the
optimization passes themselves.
(semantic_pass_optimize1): Predicate most optimizations, but enable the
constant-folding for listing_mode_vars too.
(semantic_pass_optimize2): Predicate all (1) optimizations.
* testsuite/semok/defined_list_vars.stp: New test.
David Smith [Tue, 9 Mar 2010 17:51:10 +0000 (11:51 -0600)]
Fix PR 11363 by using logrotate to ensure logfile doesn't grow too large.
* initscript/logrotate.stap-server: Add logrotate config file to make sure
stap-server logfile doesn't grow too large.
* systemtap.spec: Install logrotate config file. Also follow
<https://fedoraproject.org/wiki/PackagingDrafts/Logfiles> to correctly
create the logfile.
William Cohen [Tue, 9 Mar 2010 16:05:25 +0000 (11:05 -0500)]
PR 11210 Eliminate man page collisions
The various man pages for each systemtap probe and function
are prepended with "probe::" and "function::" respectively to avoid
collisions with other man3 pages with the same name. For example
systemtap's strlen function was colliding with glibc's strlen function.