Josh Stone [Fri, 15 Jun 2012 21:16:27 +0000 (14:16 -0700)]
PR14168: Let stap_system() callers describe the command
This fixes the gripe of commit 42da159, that error codes from
"env ... make" were identified as env failures.
* util.cxx (stap_system): Add a "description" parameter that names the
command for the WARNING message.
* util.h (stap_system): Keep the old form as a wrapper which uses
args[0] as the description.
* buildrun.cxx (run_make_cmd): Now more descriptive than ever before,
pass the name "kbuild" to stap_system().
Chris Meek [Fri, 15 Jun 2012 19:21:16 +0000 (15:21 -0400)]
PR14240: Fixed netfilter hookfunction for RHEL5
Previous to kernel 2.6.22 (linux commit 3db05fe), the hook function
definition takes a **skb whereas currently it uses *skb. We need to
emit the right version for this to compile on RHEL5.
Josh Stone [Thu, 14 Jun 2012 23:52:28 +0000 (16:52 -0700)]
PR14244: Assert that the real UID has access to debugfs
Some systems are now defaulting debugfs to mode 0700. If the user has
no access to debugfs, then they won't be able to communicate with the
systemtap module. Thus, this should be a non-starter, before even
loading the module at all.
This was previously causing staprun to fail after loading the module,
when it checked R/W access to the module's .ctl file. But since we also
restrict removing modules to those you can control, staprun would not
unload the new module either.
William Cohen [Thu, 14 Jun 2012 16:02:21 +0000 (12:02 -0400)]
Update the Beginners Guide version information
The "version:" flag in publican.cfg does not really work the way
expected. It will change the name of the generated pdf file during
the build, but it does not completely override the <productnumber> in
Book_Info.xml. Need manual fixing for the time being.
Serguei Makarov [Wed, 13 Jun 2012 17:28:38 +0000 (13:28 -0400)]
NEWS: describe the required changes to embedded-C functions.
- SystemTap now mangles local variables to avoid collisions with C
headers included by tapsets. This required a change in how
embedded-C functions access local parameters and the return value slot.
Instead of THIS->foo in an embedded-C function, please use the newly
defined macro STAP_ARG_foo (substitute the actual name of the
argument for 'foo'); instead of THIS->__retvalue, use the newly
defined STAP_RETVALUE. All of the tapsets and test cases have been
adapted to use this new notation.
If you need to run code which uses the old THIS-> notation, run stap
with the --compatible=1.7 option.
Serguei Makarov [Wed, 13 Jun 2012 17:21:31 +0000 (13:21 -0400)]
PR10299: enable locals mangling in translate.cxx.
It is now *required* to use STAP_ARG_* and STAP_RETVALUE to access
parameters in embedded-C functions -- the actual underlying names
and locations of the parameters are subject to be changed/renamed
arbitrarily.
David Smith [Tue, 12 Jun 2012 13:28:52 +0000 (08:28 -0500)]
Improve conversions.exp test by also testing tracepoint/timer.profile probes.
* testsuite/systemtap.stress/conversions.exp: Move main logic into a
procedure so that more than begin probes can be tested. Add tracepoint
and timer.profile testing.
* testsuite/systemtap.stress/conversions_profile.stp: New file.
* testsuite/systemtap.stress/conversions_trace.stp: New file.
Studying docbook-style-xsl in Fedora, and the corresponding xslt-fo
stylesheets on the web, found some xsl:param options that make the
tapsets.pdf a little more lean and a touch more mean. See also
http://snapshots.docbook.org/xsl/doc/fo/
* doc/SystemTap_Tapset_Reference/Makefile.am: Pass some powerful
stringparams to xmlto.
documentation: generate tapset reference pdf with fop if available
* configure.ac: Look for fop program. It runs much faster than
pdfdblatex or whatnot.
* doc/SystemTap_Tapset_Reference/Makefile.am: Pass --with-fop to
xmlto if fop was found.
Josh Stone [Thu, 7 Jun 2012 20:46:38 +0000 (13:46 -0700)]
testsuite: Fix pretty-bits/char to work with relative paths
This is more fallout from the automake update (commit c66be968a4ea)
which led to relative $srcdir. The pretty-bits and pretty-char tests
are passing $srcdir headers to @cast kernel types. That gets compiled
with Kbuild, with the working directory is changed to the kernel root,
so we need to give full paths for those headers.
This adds a new tcl proc "fullpath" which inserts [pwd]/ on relative
paths, and updates those pretty tests to use it.
After commit c66be968a4ea, the testsuite could receive a relative
$srcdir (if the systemtap build tree was configured with a relative
source tree). check.exp was not prepared for this, switching around
the cwd's, and still using relative path name strings. So now we
change directories more circumspectly. Isly thatly anly adverbly?
Chris Meek [Wed, 6 Jun 2012 15:43:59 +0000 (11:43 -0400)]
PR13516: More robust handling of crtl-c
Rather than return or break after checking if(pending_inturrupts),
we now throw an interrupt_exception. This is caught in main, where
we immediately exit.
Also added some code to check for other uncaght exceptions.
Chris Meek [Mon, 4 Jun 2012 20:10:16 +0000 (16:10 -0400)]
PR13516: Shifted main (style cleanup)
Shifted main right by one tab to align properly with
the new try/catch block. Decided to do this in a separate commit
so as to make the previous one more clear.
Chris Meek [Mon, 4 Jun 2012 20:00:50 +0000 (16:00 -0400)]
PR13516 pre: Re-worked tmpdir creation/removal
In preparation for PR13516, we needed to rework the tmpdir
creation/removal, so as to be sure the tmpdir gets removed
when we get an exception. Creation now happens in the
systemtap_session ctor with a call to
systemtap_session::create_tmp_dir() and removal in the dtor
with a call to systemtap_session::remove_tmp_dir().
passes_0_4_again_with_server() now calls the new
systemtap_session::reset_tmp_dir(), rather than just removing
and relying on passes_0_4() to recreate it.
David Smith [Mon, 4 Jun 2012 17:57:55 +0000 (12:57 -0500)]
Fix systemtap.base/plt.exp cleanup.
* testsuite/systemtap.base/plt.exp: Only call cleanup function when
exiting, otherwise an early failure causes later failures. Also perform
better cleanup of generated files.
David Smith [Fri, 1 Jun 2012 21:15:33 +0000 (16:15 -0500)]
Update 2 buildok tests for kernel-3.5.0-0.rc0.git9.2.fc18.
* testsuite/buildok/twentytwo.stp: Add '.call' to the
'kernel.function("vfs_llseek")' so that we can avoid inlined versions
that don't have $offset.
* testsuite/buildok/xtime.stp: Update for kernel-3.5.0-0.rc0.git9.2.fc18,
where the old xtime global variable got moved into a structure.
David Smith [Thu, 31 May 2012 20:19:01 +0000 (15:19 -0500)]
Give better errors when the kernel won't support the task_finder.
* runtime/runtime.h: Only include task_finder.c if the kernel supports it.
* runtime/vma.c: Surround code that needs the task_finder with '#ifdef
HAVE_TASK_FINDER'.
* runtime/task_finder.c: If we don't have the prerequisites for the
task_finder, give an error instead of silently defining dummy
functions.
Chris Meek [Thu, 31 May 2012 18:19:04 +0000 (14:19 -0400)]
PR13667: Hardcoded netfilter constants, cleaned up
Since certain older versions of the kernel do not define some
netfilter constants, we had to hardcode all the values
so that it would compile on those older kernels (i.e. RHEL 4 and 5).
This is OK, since we were only including the netfilter_* headers
to map the constants to their equivalent values.
Serguei Makarov [Fri, 25 May 2012 18:57:58 +0000 (14:57 -0400)]
PR14146: adapted manpager.sh to produce passable tapset::* manpages.
The resulting manpages can act as 'very succinct' (read: utterly
bare-bones) tables of contents listing documented functions and probes,
and referring the user to probe::* and function::* manpages generated by
the 'robust' (read: hideously complicated and slow, but very reliable)
DocBook toolchain.
manpager.sh is currently not hooked up to the build sequence, pending
delivery of a fresh supply of fingers to cross in hope that everything
works as advertised.
Frank Ch. Eigler [Fri, 25 May 2012 16:04:04 +0000 (12:04 -0400)]
PR14168: sanitize $PATH for kbuild invocation
* buildrun.cxx (make_any_make_cmd): Use env(1) to unset and change
some environment variables, particularly $PATH.
(run_make_cmd): Don't unsetenv here for the stap process any more.
* testsuite/systemtap.base/kbuildenv.exp: Test it.
* NEWS: Mention it.
Frederic Turgis [Thu, 24 May 2012 01:21:06 +0000 (21:21 -0400)]
Allow tuning of reader thread ppoll timeout value
Default value of 200ms causes too many wake-ups for embedded platforms
low power use-cases. Timeout of several seconds is expected on these.
New option is -T x where x is timeout in ms.
* runtime/staprun/common.c (parse_args): Parse -T option.
(usage): Mention it.
* runtime/staprun/relay.c (reader_thread): Use -T value to override default
polling interval.
* runtime/staprun/staprun.8: Document it.
translate.cxx may model duplicate probe handlers by changing multiple
*_derived_probe ->name's to the same string, which upsets
tapset-netfilter.cxx code generation. Use an index for the contexts
where required.
* tapset-netfilter.cxx (netfilter_derived_probe ctor): Assign unique
nf_filter index.
(emit_module_decls, emit_module_init, emit_module_exit): Use when
appropriate.
Serguei Makarov [Wed, 23 May 2012 15:22:26 +0000 (11:22 -0400)]
Added section describing netfilter probes to stapprobes.3stap.
Note that the link to tapset::netfilter (3stap) is currently broken.
That man page is waiting on a fix for PR14146. If that bug gets delayed
indefinitely, it may be necessary to delete the reference for the time
being, and refer people to the Tapset Reference document instead.
Serguei Makarov [Tue, 22 May 2012 18:20:21 +0000 (14:20 -0400)]
Initial version of improved tapset for netfilters.
This tapset exposes the ability to track IPv4 network packets using the
netfilter hooks mechanism. Support for IPv6 is still very patchy, and
support for other protocols (ARP, bridge) is basically nonexistent.
Mark Wielaard [Mon, 21 May 2012 10:57:41 +0000 (12:57 +0200)]
Add testcase for PR14107 Bad user unwinding from kernel fatal signal handler.
This is really a kernel bug, see bug report, when the CFI for the assembly
code is missing we cannot properly recover the register state for the user
process and might give a bad/missing user backtrace.