Tim Moore [Wed, 2 Sep 2009 10:39:05 +0000 (12:39 +0200)]
Add graph data chooser window, based on glade
* configure.ac: Test for libglademm
* grapher/GraphWidget.hxx (DataModelColumns): new class
(onDataDialogCancel, void onDataAdd, onDataRemove, onDataDialogOpen):
new methods
* grapher/GraphWidget.cxx: ditto; methods for the graph data dialog.
* grapher/graph-dialog.glade: New file.
* grapher/graph-dialog.gladep: New file.
* grapher/Makefile.am (dist_pkgdata_DATA): add graph-dialog.glade to
installation.
* grapher/GraphWidget.cxx (GraphWidget constructor): Use PKGDATADIR
Tim Moore [Tue, 4 Aug 2009 21:46:02 +0000 (23:46 +0200)]
more multiple graph fixes
* grapher/Graph.cxx (Graph constructor): set _drawX, _drawY
* grapher/GraphWidget.cxx (addGraph): Fix graph layout
(on_button_press_event): Fix test of play button in multiple graphs
Mark Wielaard [Wed, 30 Sep 2009 14:51:29 +0000 (16:51 +0200)]
PR10678 module reloc refers to symbol in dwarf refer to kernel symbols.
First part of a fix for PR10678. Always include the kernel in the dwfl.
This doesn't seem to impact performance noticable, so for now enable
always.
* setupdwfl.cxx (setup_dwfl_done): New variable, used to clean up logic
in setup_dwfl_report_kernel_p().
(setup_all_deps): New static bool to indicate we want all deps (just
the kernel for now, other modules coming).
(setup_dwfl_report_kernel_p): Use new variables, shortcut kernel
inclusion.
(setup_dwfl_kernel): Setup setup_dwfl_done (false).
build fix: use boost shared_ptr if libstdc++ to old to have <tr1/memory>
* configure.ac: Look for tr1/memory and boost/shared_ptr.hpp
* setupdwfl.h (shared_ptr): Define conditionally based on above.
* systemtap.spec (with_boost): New parameter, default-off.
Josh Stone [Tue, 29 Sep 2009 18:35:18 +0000 (11:35 -0700)]
Add -Werror to tracequery build
The final module build uses -Werror, so tracequery should as well to
catch problems as early as possible. Some ext4 errors have crept in
again (PR10703).
* buildrun.cxx (make_tracequery): Add -Werror to EXTRA_CFLAGS.
Several problems: some invalid <command> etc. directives
in the tapset embedded docs; some analysis about the
non-generation of the pdf; some cleanup of the generated
man pages.
* configure.ac (BUILD_PDFREFDOCS): Correct condition typo, but still
leave disabled.
* doc/SystemTap_Tapset_Reference/Makefile.am (XMLTOMANPARMS): Add,
to disable noise "AUTHORS" / "COPYRIGHT" sections.
* tapset/*.stp: Removed several docbook-y markup that is not valid
in kerneldoc.
Mark Wielaard [Tue, 29 Sep 2009 14:45:37 +0000 (16:45 +0200)]
Cache Dwfl's for reuse between pass 2 and pass 3.
* setupdwfl.h: Introduce DwflPtr.
* setupdwfl.cxx: Cache kernel_dwfl and user_dwfl. Keep track of last used
module strings. Return cached versions if same query used.
* dwflpp.h: Use DwflPtr instead of Dwfl*.
* dwflpp.cxx: Use DwflPtr and don't dwfl_end().
* translate.cxx: Likewise. Run through dwfl_getmodules() with returned
ptr offset.
Mark Wielaard [Tue, 29 Sep 2009 09:22:30 +0000 (11:22 +0200)]
Handle non-regex full path kernel module dwfl setup earlier.
* setupdwfl.cxx (setup_dwfl_kernel(unsigned*,systemtap_session&)):
Don't switch around offline_search_modname and offline_search_names here.
(setup_dwfl_kernel(string&,unsigned*,systemtap_session&): But here.
Josh Stone [Tue, 29 Sep 2009 01:49:51 +0000 (18:49 -0700)]
Simplify copy_file calls
Every single copy_file call we had was converting strings to char*,
printing the same error message, and optionally printing the same
verbose string. Let's canonicalize that.
* util.cxx (copy_file): Take string filenames, add a verbose flag, and
consolidate the message printing.
* cache.cxx (add_to_cache): Pass strings and remove message printing.
(get_from_cache): Ditto.
* main.cxx (main): Ditto.
* tapsets.cxx (tracepoint_builder::get_tracequery_module): Ditto.
(dwarf_cast_expanding_visitor::filter_special_modules): Ditto.
Josh Stone [Tue, 29 Sep 2009 00:36:04 +0000 (17:36 -0700)]
Try to build tracequery for all headers at once
To mitigate PR10424, we switched to building a separate tracequery
module for each tracepoint header, so a bad header wouldn't break all of
the others. However, with recent kernels that leads to ~18 make
commands, which adds up quickly in time. It's cached, so that's not too
bad, but as a developer who rebuilds stap frequently, it gets annoying.
If we're going to call 18 makes, it's worth it to start with one bigger
make that covers all the headers at once (like we used to). If that one
fails, we can still fall back to compiling individually.
FWIW, the failing ext4.h header was only created in 2.6.31, and was
fixed before 2.6.32, so the specific failure in PR10424 has a fairly
small window.
* buildrun.cxx (make_tracequery): Just take a single vector of headers.
* hash.cxx (find_tracequery_hash): Deal with multiple headers.
* tapsets.cxx (tracepoint_builder::get_tracequery_module): Ditto.
(tracepoint_builder::init_dw): Attempt all system headers together,
and if that fails, try again individually.
David J. Wilder [Fri, 25 Sep 2009 22:24:58 +0000 (15:24 -0700)]
Removing support for InMcastPkts, OutMcastPkts, InBcastPkts and
OutBcastPkts. As they are not needed for tcpipstat and tend to break
easily with kernel changes.
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
* 'master' of ssh://sources.redhat.com/git/systemtap:
Better grapher option handling.
Fix configure on systems without 'gcc -fgnu89-inline' support (rhel4).
David Smith [Wed, 23 Sep 2009 21:14:46 +0000 (16:14 -0500)]
Better grapher option handling.
* configure.ac: Don't check for gtkmm if '--disable-grapher' was used.
Also, error if '--enable-grapher' was used but gtkmm isn't installed.
* configure: Regenerated.
* tapset/random.stp (randint): Make it 1-arity (imply min=0).
Document with kerneldoc.
* doc/Systemtap_Tapset_Reference/tapsets.tmpl: Extract the docs.
* runtime/arith.c (_stp_random_pm_u): Rename without _pm.
(_stp_random_pm): Rewrite in terms of ..._u.
* testsuite/random.stp: Adapt & simplify.
David Smith [Wed, 23 Sep 2009 20:37:37 +0000 (15:37 -0500)]
Fix configure on systems without 'gcc -fgnu89-inline' support (rhel4).
* configure.ac: Only compile elfutils with '-fgnu89-inline' if the
compiler actually supports it.
* configure: Regenerated.
David Smith [Wed, 23 Sep 2009 16:11:07 +0000 (11:11 -0500)]
Forward-ported staplog.c crash support (PR 10644).
* staplog.c (get_rchan): Separated original relayfs code and current
relayfs code.
(get_rchan_buf): Ditto.
(output_cpu_logs): Ditto.
(get_rchan_addr): Handles original relayfs code detection.
(setup_global_data): Looks for '_stp_relay_data' structure instead of
'_stp_utt' structure.
(open_output_file): Improved error message.
* runtime/transport/relay_v2.c: Rearranged struct _stp_relay_data_type to
make things a bit easier for staplog.c.
* runtime/transport/relayfs.c: Ditto
* tapset/logging.stp (ftrace): New function.
(*): Add kerneldoc to other functions.
* doc/SystemTap_Tapset_Reference/tapsets.tmpl: Process logging.stp.
* stapfuncs.3stap.in: Remove "LOGGING" section, now redundant.
* runtime/autoconf-trace-printk.c: New autoconf test.
* buildrun.cxx (compile_pass): Build it.
* NEWS: Mention it.
* testsuite/buildok/logging.stp: Test it.
Mark Wielaard [Sat, 19 Sep 2009 17:14:33 +0000 (19:14 +0200)]
Use less idle time in testsuite.
A lot of tests wait, sleep or use a timer for multiple seconds when that
is not necessary. Reduce the time waited so save test time.
* testsuite/systemtap.base/backtrace.stp: Exit after 100ms.
* testsuite/systemtap.base/badkprobe.exp: Likewise.
* testsuite/systemtap.base/global_end.stp: Likewise.
* testsuite/systemtap.base/itrace.exp: Wait 1 sec instead of 5 for each test.
* testsuite/systemtap.base/maxactive.exp: Likewise.
* testsuite/systemtap.base/onoffprobe.exp: Match and use modname, so
build script can be cached.
* testsuite/systemtap.base/onoffprobe.stp: Wait miliseconds instead of
seconds in each alias. Output module_name.
* testsuite/systemtap.base/poll_map.stp: Start after 100ms.
Josh Stone [Sat, 19 Sep 2009 02:59:43 +0000 (19:59 -0700)]
Fix uninitialized line numbers in the function spec
The rewrite of parse_function_spec left the line numbers uninitialized
when not used, but elsewhere was depending on that. Fix the uninit, and
also don't depend on it.
* tapsets.cxx (dwarf_query::parse_function_spec): Init line stuff.
(query_cu): Branch on the spec_type, not the line contents.
PR10655 part 1: uprobes: track sdt semaphores properly
commit 6846cfc8 introduced an unintended side-effect where semaphore tracking
was identified with stap_uprobe_specs[] elements, which are normally static/const.
This kernel patch <http://article.gmane.org/gmane.linux.kernel/854187> catches
and panics on this. The cure is to move the variable over to the stap_uprobes[]
array.
* tapsets.cxx (uprobe emit_module_decls): Add sdt_sem_address to stap_uprobe{} struct,
to contain per-process relocated semaphore address.
(emit_module_decls,_init): Remove tsk field, restore constness of appropriate
locals. Activate uprobe semaphore right around uprobe activation time. Remove
semaphore clearing upon process exit, since by then it's gone.
(emit_module_exit): Use remembered relocated semaphore address to clean up.
Fix "-uprobe" DEBUG_UPROBES message.
* runtime.h: #include <linux/sched.h>.
* dtrace.in (*_semaphore): Make it an unsigned short - intended 16 bits on all
common architectures/multilibs.
Dave Brolley [Fri, 18 Sep 2009 22:17:15 +0000 (18:17 -0400)]
stap-start-server(->stap-serverd) now accept -r -R -I -B and -a options for cross compilation.
Server correctly advertises itself wrt -r and -a.
Fix bug in stap-server: fatal function was potentially recursive.
David Smith [Fri, 18 Sep 2009 20:11:12 +0000 (15:11 -0500)]
Fixed relay_old.c by providing ppoll().
* runtime/staprun/staprun.h: Put ppoll() declaration here (so that
relay_old.c can use it).
* runtime/staprun/relay.c (ppoll): Made ppoll() non-static so that
relay_old.c can use it.
Mark Wielaard [Fri, 18 Sep 2009 14:13:24 +0000 (16:13 +0200)]
Always mark .probes section as writable.
Allocated section needs to be writable when creating pic shared objects
because we store relocatable addresses in them. We used to make this
read only for non-pic executables, but the new semaphore support relies
on having a writable .probes section to put the enabled variables in.
* includes/sys/sdt.h (ALLOCSEC): Define unconditionally as "aw".
Josh Stone [Fri, 18 Sep 2009 02:06:39 +0000 (19:06 -0700)]
Ensure that STAP_PROBE behaves like a single statement
It's important for macros like this to appear as a single statement, so
they won't break the control flow of the caller. The new STAP_SEMAPHORE
macro was breaking this masquerade, but now I've moved it inside of the
do-while block.
* includes/sys/sdt.h (STAP_SEMAPHORE): Define the disabled case empty.
(STAP_PROBE[1-10]_): Move the semaphore inside the do-while block.
Josh Stone [Fri, 18 Sep 2009 01:35:12 +0000 (18:35 -0700)]
Simplify the sdt semaphore decrement in utrace
The decrement can happen at the same time that the utrace detach is
called. However, I'm concerned that this code isn't correctly handling
the case where multiple tasks may register the same probe, so for now
I've noted those places. I think task finder may have to help in fixing
this...
* tapset-utrace.cxx (utrace_derived_probe_group::emit_module_init): As
noted in uprobes-land, there's no need to tear down anything.
(utrace_derived_probe_group::emit_module_exit): Unify the detach and
semaphore decrement, and note a concern about multiple tasks.
(utrace_derived_probe_group::emit_module_decls): Note same concern.
* tapsets.cxx (uprobe_derived_probe_group::emit_module_decls): Ditto.
(uprobe_derived_probe_group::emit_module_exit): Ditto.
Josh Stone [Thu, 17 Sep 2009 23:37:36 +0000 (16:37 -0700)]
Map std semaphores from probe->addr
Each probe needs to know the associated semaphore address, rather than
the other way around.
* session.h (sdt_semaphore_addr): Reverse the key-value types.
* tapsets.cxx (record_semaphore): Take an index to only record the
semaphore for newly added results.
(sdt_query::handle_query_module): Adjust accordingly.
(uprobe_derived_probe_group::emit_module_decls): Now it's a simple map
lookup for sdt_sem_address.
* tapset-utrace.cxx (utrace_derived_probe_group::emit_probe_decl): Ditto.
Josh Stone [Thu, 17 Sep 2009 21:42:04 +0000 (14:42 -0700)]
Remove temporaries in netdev.change_mac
As reported by dsmith, reusing temporary locals will prevent our
limited optimizer from eliminating code. I'm getting rid of these
particular locals altogether.
* tapset/networking.stp (netdev.change_mac): Don't write mac
intermediates into locals; just pass them directly to sprintf.
Mark Wielaard [Thu, 17 Sep 2009 14:59:28 +0000 (16:59 +0200)]
Add a testcase for PR10417 support for DW_OP_{stack|implicit}_value.
Currently XFAILS when gcc-vta detected, otherwise UNTESTED.
* testsuite/systemtap.base/vta-test.exp: New test harness.
* testsuite/systemtap.base/vta-test.c: New test program.
* testsuite/systemtap.base/vta-test.stp: New test script.
Mark Wielaard [Thu, 17 Sep 2009 13:06:57 +0000 (15:06 +0200)]
PR10417 Pass around attributes for supporting DW_OP_{implicit,stack}_value.
Preparation for retrieving the Dwarf_Block that holds the value of an
DW_OP_implicit_value. We need the Dwarf_Attribute that is associated with
the location expression operants. Depends on new elfutils 0.143
functionality. Recognizes, but does not yet handle the new operants
DW_OP_{implicit,stack}_value.
* loc2c.h (c_translate_location): Take an Dwarf_Attribute.
* loc2c.c (c_translate_location): Likewise and pass it on.
(location_relative): Likewise.
(location_from_address): Likewise.
(translate): Likewise and capture Dwarf_Block.
* loc2c-test.c (handle_variable): Pass in Dwarf_Attribute.
* dwflpp.cxx (translate_location): Likewise.
(literal_stmt_for_return): Pass in NULL to indicate no attribute.
Mark Wielaard [Thu, 17 Sep 2009 10:20:07 +0000 (12:20 +0200)]
PR10595 Work around uprobe2 causing selinux failures for kernel 2.6.28+.
We allocate a "fake" unlinked shmem file because anonymous
memory might not be granted execute permission when the selinux
security hooks have their way. Only do this for 2.6.28 or higher
since shmem_file_setup() isn't exported before that.
* runtime/uprobes2/uprobes.c (uprobe_setup_ssol_vma): Use shmem_file_setup
to setup the ssol vma area when using 2.6.28+.
Josh Stone [Thu, 17 Sep 2009 02:38:20 +0000 (19:38 -0700)]
PR10461: Match C++ scopes for namespaces and classes
The function spec for dwarf probes now supports scopes, so you can limit
the probes to specific namespaces or classes. Multiple scopes can be
specified, and they will be matched progressively outward.
* dwflpp.cxx (dwflpp::get_parent_scope): New, finds the containing
scopes of the specified DIE.
(dwflpp::function_scope_matches): New, checks that the scopes
containing the function all match the given scope patterns.
* tapsets.cxx (dwarf_query::parse_function_spec): Rewrite, now handles
multiple scope separators too.
(query_dwarf_func): Check that the functions scopes match.
PR10650: markup some unprivileged-safe tapset functions
Add /* unprivileged */ to a variety of tapset embedded-c functions,
together with uid-assertion-checking code as needed. This is only
an initial set, and may need to grow or shrink after further testing.
Prototyped-By: Dave Brolley <brolley@redhat.com>
* runtime/runtime.h (is_myproc, assert_is_myproc): New macros.
* runtime/addr-map.c (lookup_bad_addr): Reject if !is_myproc
in unprivileged mode.
* runtime/print.c (_stp_print_kernel_info): Add unprivileged
mode info.
* tapset/DEVGUIDE: Document /* pure */ and /* unprivileged */.
* tapset/*.stp: Add /* unprivileged */ here and there, in
questionable cases along with an assert_is_myproc().