David Smith [Wed, 3 Jun 2009 20:20:46 +0000 (15:20 -0500)]
Make sure all DEBUG_TRANS output uses printk.
* runtime/transport/control.c (_stp_ctl_write_cmd): Calls dbug_trans2
instead of _dbug (so that printk is used instead of the transport
itself).
(_stp_ctl_write_dbug): Ditto.
* runtime/debug.h (dbug_trans2): New macro.
David Smith [Wed, 3 Jun 2009 18:04:54 +0000 (13:04 -0500)]
Fixed STP_TRANSPORT_VERSION 1 behavior.
* runtime/transport/control.c (_stp_ctl_write_dbug): Added support for
more messages.
* runtime/transport/relay_v2.c (_stp_transport_data_fs_start): New
function.
(_stp_transport_data_fs_stop): Ditto.
(_stp_transport_data_fs_close): Moved some functionality into
_stp_transport_data_fs_stop() and calls _stp_transport_data_fs_stop()
also.
(_stp_transport_data_fs_init): Moved some functionality into
_stp_transport_data_fs_start() and calls _stp_transport_data_fs_start()
also.
* runtime/transport/relayfs.c (_stp_transport_data_fs_start): New
function.
(_stp_transport_data_fs_stop): Ditto.
(_stp_transport_data_fs_close): Moved some functionality into
_stp_transport_data_fs_stop() and calls _stp_transport_data_fs_stop()
also.
(_stp_transport_data_fs_init): Moved some functionality into
_stp_transport_data_fs_start() and calls _stp_transport_data_fs_start()
also.
* runtime/transport/ring_buffer.c (_stp_transport_data_fs_start): New
empty function.
(_stp_transport_data_fs_stop): Ditto.
* runtime/transport/transport.h: Added _stp_transport_data_fs_start() and
_stp_transport_data_fs_stop() prototypes.
* runtime/transport/transport.c (_stp_cleanup_and_exit): Calls
_stp_transport_data_fs_stop().
(_stp_transport_close): Calls _stp_transport_fs_close() earlier.
(_stp_transport_init): Calls _stp_transport_data_fs_start().
David Smith [Tue, 26 May 2009 19:08:57 +0000 (14:08 -0500)]
Cleanup and better original transport support.
* runtime/print.h: Moved _stp_reserve_bytes() prototype here.
* runtime/vsprintf.c (_stp_vsnprintf): Includes print.h to get
_stp_reserve_bytes() prototype.
Josh Stone [Fri, 15 May 2009 01:47:33 +0000 (18:47 -0700)]
[tracepoints] Print pointer arguments with %p
We know the full type of every tracepoint argument, so for those that
are pointers, print $$vars/$$parms using "%p". The integer-type
arguments continue to use the generic "%#x".
Mark Wielaard [Thu, 14 May 2009 17:07:10 +0000 (19:07 +0200)]
PR10139 Mark .probes section SHF_ALLOC.
* includes/sys/sdt.h (STAP_PROBE_DATA_): Mark .probes section SHF_ALLOC.
* tapsets.cxx (dwarf_builder::build): Search in either dwarf or main elf
file for .probes section.
Keiichi KII [Wed, 13 May 2009 20:55:11 +0000 (16:55 -0400)]
PR 6930: Add additional testcases for flight recorder mode
* testsuite/parseko/cmdline17.stp:
command line check - bad combination with -D and -L
* testsuite/parseko/cmdline18.stp:
command line check - bad combination with -D and -d
* testsuite/parseko/cmdline19.stp:
command line check - bad combination with -D and -c
* testsuite/parseko/cmdline20.stp:
command line check - need output file with -D
* testsuite/parseko/cmdline21.stp:
command line check - need output file with -S
* testsuite/systemtap.base/flightrec3.exp:
New test case for file switching with bulk mode
* testsuite/systemtap.base/flightrec3.stp:
Test script for file switching per cpu
David Smith [Tue, 12 May 2009 18:38:48 +0000 (13:38 -0500)]
Start at supporting the original transport (STP_TRANSPORT_VERSION=1).
* runtime/print.c: Only use print_new.c.
* runtime/print_new.c (stp_print_flush): Add STP_TRANSPORT_VERSION 1 support.
* runtime/transport/transport.c: Removed inclusion of procfs.c.
* runtime/transport/procfs.c (_stp_proc_read): Adapt to new interface.
(_stp_proc_write): Ditto.
* runtime/transport/relayfs.c: Ditto.
Mark Wielaard [Sun, 10 May 2009 18:24:40 +0000 (20:24 +0200)]
Get .probes section through dwarf debuginfo file if necessary.
* tapsets.cxx (dwarf_builder::build): Add some comments, verbose log
messages and get Elf through dwarf_getelf if it exists before searching
for .probes section.
Josh Stone [Sat, 9 May 2009 02:30:42 +0000 (19:30 -0700)]
Allow @cast failures to get optimized away
We have the saved_conversion_error field, but I wasn't using it. Now
@cast errors are saved in that field, so they're only seen if the
optimizer doesn't remove the @cast.
Josh Stone [Sat, 9 May 2009 01:32:17 +0000 (18:32 -0700)]
PR10054: Unify the translate_components errors
Since translate_components is the one that knows the details of its
failures, it makes more sense to let it throw its own errors, instead of
relying on each caller to do it. The function now always either returns
successfully or throws an error.
Josh Stone [Sat, 9 May 2009 00:50:28 +0000 (17:50 -0700)]
Refactor anonymous lookups in translate_components
The previous code recursed the entirety of translate_components, and
it seemed to be restarting the components list every time, so it would
only work if the anonymous portion was the first component. Even then,
examining the code output by semok/thirtythree revealed that it wasn't
fully translating the locations when multiple anonymous pieces were
involved.
Instead, it now recurses in a separate function, find_struct_member,
which does just enough to find the member die and return. It also
builds a vector of the locations passed through, so translate_components
can output code for the full chain of anonymity.
The generated code for semok/thirtythree's $page->mapping now appears to
match the offsets from my manual inspection of struct page. I also
added a test for $page->first_page->mapping, which works now but would
segfault the old code.
Josh Stone [Fri, 8 May 2009 19:40:43 +0000 (12:40 -0700)]
Simplify buildok/context_test.stp
The test was using optional probes on uptime_read_proc, which doesn't
exist anymore on 2.6.30. The problem is that when those optional probes
are skipped, the test doesn't really do anything.
For a buildok test of the context functions, the actual probe point
doesn't matter, so I've changed it to just a begin probe that calls all
of the functions.
Mark Wielaard [Fri, 8 May 2009 08:30:41 +0000 (10:30 +0200)]
Search for only under $(SRCDIR)/tapsets for tapsets.xml and cleanup.
* doc/SystemTap_Tapset_Reference/Makefile.am (tapsets.xml): Only search
under $(SRCDIR)/tapsets for .stp files. Cleanup tapsets.xml.new.
* doc/SystemTap_Tapset_Reference/Makefile.in: Regenerated.
Josh Stone [Fri, 8 May 2009 02:06:52 +0000 (19:06 -0700)]
Merge branch 'tapsets-cleanup'
This merge splits some of the built-in tapsets into their own files, so
we can better maintain clean interfaces. Still TODO are the dwarf-
dependent tapsets though, because that's a much bigger mess to untangle.
Josh Stone [Wed, 6 May 2009 23:43:51 +0000 (16:43 -0700)]
Separate built-in timer tapsets
All of the timer.* tapsets are now built and handled in their own
tapset-timers.cxx, as the first step of many to pare down the current
monolithic tapsets.cxx.
David Smith [Wed, 6 May 2009 17:25:02 +0000 (12:25 -0500)]
Start of support for older transport and cleanup.
* runtime/transport/control.c: Added inclusion of linux/delay.h to get
declaration of msleep().
* runtime/transport/relay_v2.c: New skeleton file for transport version 2.
* runtime/transport/ring_buffer.c: Cleanup.
* runtime/transport/transport.c: Ditto.
Wenji Huang [Tue, 5 May 2009 23:26:38 +0000 (19:26 -0400)]
PR10102: tolerate the failure related to optional probe
This patch will make stap silently accept the
failure related to optional probe. It puts try/catch
around find_and_build which can cover most probe types.
The specific treatment for dwarf_derived_probe in
commit ed82b7c902d6a2e26452ec51c9cdb9665dbf9e97 is
reverted.
Mark Wielaard [Sun, 3 May 2009 04:49:02 +0000 (06:49 +0200)]
Don't recurse into DW_AT_declaration subprograms in iterate_over_labels.
Newer gcc (4.4) places more DW_TAG_subprograms with DW_AT_declaration
at call sites. iterate_over_labels should only be concerned about
complete declarations.
* tapsets.cxx (dwflpp::iterate_over_labels): Skip DW_TAG_subprogram
that has attribute DW_AT_declaration.
The syscall testsuite uses embedded "// TEXT" markers in the .c files
to designate expected output, kind of like the "dg-" bunch in the gcc
test suite. Unfortunately, "//" is not a unique prefix to systemtap
tests, and in particular it can occur in the system headers that will
be picked up with the "gcc -E -C ..." invocation in test.tcl.
So let's switch to "//staptest//". test.tcl is also modified to
escape a few more mischevious regexp metacharacters that might sneak
past.