]> sourceware.org Git - systemtap.git/log
systemtap.git
12 years agostapdyn: Excise the hard-coded STAPDYN flag
Josh Stone [Fri, 11 May 2012 23:05:38 +0000 (16:05 -0700)]
stapdyn: Excise the hard-coded STAPDYN flag

This introduces a new --runtime=dyninst option to select this mode
dynamically.  All the places that had compiled #ifdef STAPDYN checks are
now toggled with a session variable based on this option.

A few places in runtime/ and translator-generated code are now using
__KERNEL__ to differentiate modes when necessary.

12 years agostapdyn: Add to configure and Makefile
Josh Stone [Wed, 9 May 2012 23:23:01 +0000 (16:23 -0700)]
stapdyn: Add to configure and Makefile

This is my rough attempt to bring stapdyn and dynsdt into the build.
Now configure can take --with-dyninst=DIR to set the location of Dyninst
headers and libraries.  This doesn't yet try to be arch-aware, only
x86_64.  It's also only looking for a build-tree layout, not distro-
installed dyninst files.

* Makefile.am: Add stapdyn and dynsdt to the build.
* configure: Process --with-dyninst, with a mild sanity check.
* README: Note DYNINSTAPI_RT_LIB and suggest LD_LIBRARY_PATH.
* TODO: Mark this task partially done.
* ...: Update all other autoreconf-generated files too.

12 years agoWIP support for pure-userspace stap through dyninst
Josh Stone [Wed, 9 May 2012 00:49:53 +0000 (17:49 -0700)]
WIP support for pure-userspace stap through dyninst

This is an early prototype of having a SystemTap mode that operates
purely in userspace, using the Dyninst library to place instrumentation.
There is much more to do - please see the stapdyn/README and TODO files
for details.

12 years agoparsing: when complaining about tok_junk, hex-dump the character in question
Frank Ch. Eigler [Tue, 8 May 2012 21:36:03 +0000 (17:36 -0400)]
parsing: when complaining about tok_junk, hex-dump the character in question

12 years agoGive good error messages for inodes uprobes registration errors.
David Smith [Tue, 8 May 2012 21:07:08 +0000 (16:07 -0500)]
Give good error messages for inodes uprobes registration errors.

* translate.cxx (c_unparser::emit_module_init): Only print an error if
  'probe_point' isn't NULL.
* tapsets.cxx (uprobe_derived_probe_group::emit_module_inode_init): Let
  stapiu_init() handle reporting errors by setting 'probe_point' to NULL.
* runtime/uprobes-inode.c (stapiu_get): Print errors when needed.
  (stapiu_reg): Ditto.

12 years agoconfigury: automake 1.12 as deprecated automatic de-ANSI-fication support
Nitin A Kamble [Tue, 8 May 2012 18:13:49 +0000 (14:13 -0400)]
configury: automake 1.12 as deprecated automatic de-ANSI-fication support

Fix this issue with automake 1.12:

| configure.ac:23: error: automatic de-ANSI-fication support has been removed

[fche:] Note that the systemtap git repository and source releases include
autoconf- and automake-generated files, so this is only an issue for those
who have an unusual reason to regenerate them.

Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
12 years agoImprove the labels.exp testcase output handling.
David Smith [Tue, 8 May 2012 18:03:40 +0000 (13:03 -0500)]
Improve the labels.exp testcase output handling.

* testsuite/systemtap.base/labels.exp: Handle probe output in either
  order, which is OK when the probes are probing the same address.

12 years agoPR14079 - caller() pass-4 error if no uretprobes in script
Mark Wielaard [Tue, 8 May 2012 17:59:07 +0000 (19:59 +0200)]
PR14079 - caller() pass-4 error if no uretprobes in script

caller() is odd in that it tries to do both kernel and user caller.
There is no ucaller(). Move it into its own tapset and include the
right uprobes related structures.

* runtime/uprobes-inc.h: New include file to be included in ...
* runtime/stack.c: here and ...
* tapset/context-caller.stp: here. New tapset, with just the caller context
  function, removed from ...
* tapset/context-unwind.stp: here.
* doc/SystemTap_Tapset_Reference/tapsets.tmpl: Also include context-caller.stp.

12 years agoImprove gtod.exp testcase.
David Smith [Tue, 8 May 2012 16:43:06 +0000 (11:43 -0500)]
Improve gtod.exp testcase.

* testsuite/systemtap.base/gtod.exp: Make more robust by using a state
  machine to match output.

12 years agoPR14078: work around rpmio's bad glob
Frank Ch. Eigler [Tue, 8 May 2012 14:23:50 +0000 (10:23 -0400)]
PR14078: work around rpmio's bad glob

Work around ancient rpm packaging misfeature.
https://bugzilla.redhat.com/show_bug.cgi?id=819680

* configure.ac (rpm*): Force -lc before -lrpm*.

12 years agoRegenerate examples index.
Mark Wielaard [Mon, 7 May 2012 23:53:30 +0000 (01:53 +0200)]
Regenerate examples index.

12 years agoImprove the case-scope testcase output handling.
David Smith [Mon, 7 May 2012 21:40:38 +0000 (16:40 -0500)]
Improve the case-scope testcase output handling.

* testsuite/systemtap.base/cast-scope.stp: Print the probe strings in a
  defined order (since the process.function and process.mark probes can
  end up at the same address).

12 years agoMinor bz5274.exp fixes.
David Smith [Mon, 7 May 2012 21:36:24 +0000 (16:36 -0500)]
Minor bz5274.exp fixes.

* testsuite/systemtap.base/bz5274.exp: Make sure test output is saved in
  the log file.  Make sure to clean up.

12 years agoPR13667: update privileged* tests for netfilter-hook probe point name tweaks
Frank Ch. Eigler [Mon, 7 May 2012 13:45:23 +0000 (09:45 -0400)]
PR13667: update privileged* tests for netfilter-hook probe point name tweaks

12 years agofix the small compile issues in the Cleanups DWARF patch
Negreanu Marius Adrian [Mon, 7 May 2012 11:57:16 +0000 (14:57 +0300)]
fix the small compile issues in the Cleanups DWARF patch

Signed-off-by: Negreanu Marius Adrian <adrian.m.negreanu@intel.com>
12 years agoCleanups and fixes for DWARF unwinder.
Mark Wielaard [Mon, 7 May 2012 08:20:21 +0000 (10:20 +0200)]
Cleanups and fixes for DWARF unwinder.

Add explict comments and set_*_rule functions for different states.
Do data alignment in processCFI, not afterwards in unwind_frame.
Remove unnecessary UNW_DEFAULT_RA. Make unwind_item state union
explicit about (unsigned) reg versus (signed) offset. Same for
unwind_reg_state cfa.

12 years agotoolshed name change: vardecl::skip_init->synthetic
Frank Ch. Eigler [Mon, 7 May 2012 02:10:52 +0000 (22:10 -0400)]
toolshed name change: vardecl::skip_init->synthetic

* staptree.h (vardecl::skip_init): Rename field to "synthetic".
  Update all users.

12 years agoPR13667: beginning of a netfilter-hook tapset
Frank Ch. Eigler [Mon, 7 May 2012 01:11:30 +0000 (21:11 -0400)]
PR13667: beginning of a netfilter-hook tapset

12 years agoPR13667: rework netfilter hook $context variable processing
Frank Ch. Eigler [Mon, 7 May 2012 01:01:17 +0000 (21:01 -0400)]
PR13667: rework netfilter hook $context variable processing

We now use tapset-mark.cxx style script/probe locals for incoming and
outgoing parameters.  These are written/read during the probe prologue
function, and specially marked to prevent optimization/elision.

12 years agoelaboration: don't elide assignments to skip_init vardecls
Frank Ch. Eigler [Mon, 7 May 2012 00:59:09 +0000 (20:59 -0400)]
elaboration: don't elide assignments to skip_init vardecls

Such vardecl objects may also used for output parameters, for which
we don't want to suppress assignments to.

* elaborate.cxx (dead_assignment_remover::visit_assignment): Don't kill
  lvalue skip_init vardecls.

12 years agorespond to pending_interrupts during sub-make sequence
Frank Ch. Eigler [Mon, 7 May 2012 00:57:51 +0000 (20:57 -0400)]
respond to pending_interrupts during sub-make sequence

* buildrun.cxx (run_make_cmd): If we already received a ^C as per
  pending_interrupts, but some naive caller has tried to run yet
  another inferior make, abort without even trying.

12 years agoauditbt example: sudo doesn't take -c.
Mark Wielaard [Sun, 6 May 2012 21:54:23 +0000 (23:54 +0200)]
auditbt example: sudo doesn't take -c.

12 years agoPR14057 - ERROR: Your privilege credentials (stapsys) are insufficient...
Mark Wielaard [Thu, 3 May 2012 19:49:11 +0000 (21:49 +0200)]
PR14057 - ERROR: Your privilege credentials (stapsys) are insufficient...

Initialize user_credentials to pr_unknown in init_staprun and set them
to pr_all when getuid() == 0 in assert_stap_module_permissions or
assert_uprobes_module_permissions.

12 years agoImproved task_finder2 mmap tracking and better task_work cleanup.
David Smith [Thu, 3 May 2012 19:20:34 +0000 (14:20 -0500)]
Improved task_finder2 mmap tracking and better task_work cleanup.

* runtime/task_finder2.c (__stp_tf_alloc_task_work): New function.
  (__stp_tf_free_task_work): Ditto.
  (__stp_tf_cancel_task_work): Ditto.
  (__stp_tf_quiesce_worker): Renamed from __stp_task_worker(). Uses
  __stp_tf_free_task_work() to free the task_work structure.
  (__stp_utrace_task_finder_target_quiesce): Uses
  __stp_tf_alloc_task_work() to allocate a task_work structure.
  (__stp_tf_mmap_worker): New task_work worker function.
  (__stp_utrace_task_finder_target_syscall_exit): If we're in an atomic
  context, use task_work_add() to call __stp_tf_mmap_worker().
  (stap_stop_task_finder): Call __stp_tf_cancel_task_work() to cancel all
  outstanding task work requests.

12 years agoPR13667 (in progress): Added initial context varaible code
Chris Meek [Thu, 3 May 2012 13:29:49 +0000 (09:29 -0400)]
PR13667 (in progress): Added initial context varaible code

Added some initial code to handle context variables such as
$verdict. It is not functioning properly yet, but it is still
in progress.

12 years agoRemove more unused semaphore code from dwarf_derived_probe class.
David Smith [Thu, 3 May 2012 14:36:28 +0000 (09:36 -0500)]
Remove more unused semaphore code from dwarf_derived_probe class.

* tapsets.cxx (dwarf_derived_probe::join_group): Remove semaphore code.
  (dwarf_derived_probe::emit_probe_local_init): Ditto.
  (dwarf_derived_probe_group::emit_module_decls): Ditto.

12 years agoFix PR13992 cont. Do iterate_over_modules, just not over libraries.
Mark Wielaard [Wed, 2 May 2012 19:13:30 +0000 (21:13 +0200)]
Fix PR13992 cont. Do iterate_over_modules, just not over libraries.

The original fix for PR13992 (commit 0ce08aa) failed to iterate of any
modules when no executable path was found, which made the exelib.exp
testcase fail. Refixed by iterating of modules, just not over libraries.

12 years agoRemoved unused kprobe1 sdt support.
David Smith [Wed, 2 May 2012 19:31:58 +0000 (14:31 -0500)]
Removed unused kprobe1 sdt support.

* sdt_types.h: Remove KPROBE1_TYPE define and kprobe1_type enum value.
* testsuite/sys/sdt.h: Ditto.
* tapsets.cxx (sdt_kprobe_var_expanding_visitor): Removed struct and its
  functions.
  (sdt_query::have_kprobe): Removed function.
  (sdt_query::handle_probe_entry): Removed kprobe1_type support.
  (sdt_query::iterate_over_probe_entries): Removed have_kprobe() code.
  (sdt_query::convert_probe): Ditto.
  (sdt_query::convert_location): Ditto.

12 years agoUpdate AUTHORS, with a few canonicalized in .mailmap
Josh Stone [Wed, 2 May 2012 18:24:56 +0000 (11:24 -0700)]
Update AUTHORS, with a few canonicalized in .mailmap

12 years agoRemoved EXPERIMENTAL_KPROBE_SDT support.
David Smith [Wed, 2 May 2012 17:51:13 +0000 (12:51 -0500)]
Removed EXPERIMENTAL_KPROBE_SDT support.

* tapsets.cxx (dwarf_derived_probe_group): Removed 'has_semaphores' member
  variable.
  (dwarf_derived_probe_group::enroll): Throw an error if we have a
  semaphore.
  (dwarf_derived_probe_group::emit_module_decls): No longer emit semaphore
  support in struct stap_dwarf_probe or include kprobes-common.c.
  (dwarf_derived_probe_group::emit_module_init): No longer initialize
  semaphore info in struct stap_dwarf_probe.
  (dwarf_derived_probe_group::emit_module_exit): No longer decrement
  semaphores on module exit.
  (sdt_query::have_kprobe): Remove kprobe2_type support.
  (sdt_query::handle_probe_entry): Ditto.
  (sdt_query::iterate_over_probe_entries): Ditto.
  (sdt_query::convert_location): Ditto.
* sdt_types.h: Remove KPROBE2_TYPE define and kprobe2_type enum value.
* runtime/kprobes-common.c: Deleted.
* runtime/kprobes-common.h: Removed deleted function declarations.
* scripts/probe_perf/bench.sh: Remove EXPERIMENTAL_KPROBE_SDT test.
* testsuite/sys/sdt.h: Removed EXPERIMENTAL_KPROBE_SDT support.
* testsuite/systemtap.base/sdt.exp: Ditto.
* testsuite/systemtap.base/sdt_misc.exp: Ditto.

12 years agosamples: eventcount: add a bunch of configuration options
Frank Ch. Eigler [Fri, 27 Apr 2012 22:53:46 +0000 (18:53 -0400)]
samples: eventcount: add a bunch of configuration options

12 years agoUse new task_work kernel feature to truly stop tasks.
David Smith [Fri, 27 Apr 2012 20:43:16 +0000 (15:43 -0500)]
Use new task_work kernel feature to truly stop tasks.

* buildrun.cxx (compile_pass): Add STAPCONF_TASK_WORK_ADD_EXPORTED autoconf.
* runtime/autoconf-utrace-via-ftrace.c (__autoconf_func): Makes sure
  <linux/task_work.h> is present and works.
* runtime/autoconf-utrace-via-tracepoints.c (__autoconf_func): Ditto.
* runtime/runtime.h: Added export kludge variables for task_work_add() and
  task_work_cancel().
* runtime/stp_utrace.c (utrace_init): If the task_work_* functions aren't
  exported, use kallsyms_lookup_name() to find them.
  (utrace_cleanup): Cancel work function if necessary.
  (utrace_task_alloc): Initialize task work structure.
  (utrace_free): Cancel work function if necessary.
  (utrace_do_stop): Use task_work_add() functionality to replace
  set_notify_resume().
  (utrace_stop): Ditto.
  (utrace_control): Ditto.
  (finish_report): Ditto.
  (utrace_resume): Updated to work as task worker function.
* runtime/task_finder2.c (__stp_task_worker): New function.
  (__stp_utrace_task_finder_target_quiesce): If we can't sleep, use
  task_work_add() to truly stop the task.
* runtime/uprobes-inode.c (stapiu_change_plus): Check build-ids.

12 years agoPR13667 cont'd: Fixed test case
Chris Meek [Thu, 26 Apr 2012 14:37:34 +0000 (10:37 -0400)]
PR13667 cont'd: Fixed test case

Added netfilter probes to the restricted_probe_types list.

12 years agoPR13667 cont'd: Added compile code
Chris Meek [Thu, 26 Apr 2012 14:35:39 +0000 (10:35 -0400)]
PR13667 cont'd: Added compile code

12 years agoPR13667 cont'd: Added parameters
Chris Meek [Thu, 26 Apr 2012 13:59:01 +0000 (09:59 -0400)]
PR13667 cont'd: Added parameters

Now has parameters for hook, protocol family and priority

12 years agobloat: lament about symbol-name literal strings in stap-symbols.h
Frank Ch. Eigler [Wed, 25 Apr 2012 03:04:51 +0000 (23:04 -0400)]
bloat: lament about symbol-name literal strings in stap-symbols.h

12 years agotranslate symbol/unwind extraction: shrink eh_frame output
Frank Ch. Eigler [Tue, 24 Apr 2012 21:00:36 +0000 (17:00 -0400)]
translate symbol/unwind extraction: shrink eh_frame output

commit ebc08b5 forgot the eh_header[] dump case.

* translate.cxx (dump_unwindsym_cxt): Decimify eh_frame[] contents too.

12 years agoPR14000: remove sysroot prefix from a few more strings
Negreanu Adrian [Tue, 24 Apr 2012 20:47:00 +0000 (16:47 -0400)]
PR14000: remove sysroot prefix from a few more strings

* tapsets.cxx (sdt_query::handle_probe_entry): Here, ...
* translate.cxx (dump_unwindsym_cxt): ... and here.

12 years agoSmall comment clarification in tapset/ia64/registers.stp.
David Smith [Tue, 24 Apr 2012 16:28:29 +0000 (11:28 -0500)]
Small comment clarification in tapset/ia64/registers.stp.

12 years agoUpdated and added syscall testsuite debug scripts.
David Smith [Tue, 24 Apr 2012 16:04:35 +0000 (11:04 -0500)]
Updated and added syscall testsuite debug scripts.

* testsuite/systemtap.syscall/test-debug.tcl: Updated regexp that looks
  for specially formatted comments in the test executable source.
* testsuite/systemtap.syscall/test-debug-cmd.tcl: New script, similar to
  test-debug.tcl, but displays the output on the command line (instead of
  in its own window).
* testsuite/systemtap.syscall/test-debug-cmd-nd.tcl: New script, similar to
  test-debug-cmd.tcl, but used the nd_sycall tapset.

12 years agoAdded ia64/registers.stp.
David Smith [Mon, 23 Apr 2012 21:29:00 +0000 (16:29 -0500)]
Added ia64/registers.stp.

* tapset/ia64/registers.stp: New file. Add note that using
  syscall_get_arguments() doesn't work for ia64.

12 years agostaprun: conditionalize use of pthread_mutex*
Frank Ch. Eigler [Mon, 23 Apr 2012 20:27:00 +0000 (16:27 -0400)]
staprun: conditionalize use of pthread_mutex*

staprun is compiled single-threaded, but recent improvements to
util.cxx made it implicitly pthreads-dependent.  Conditionalize
pthread_* calls with #ifndef SINGLE_THREADED throughout.

Reported-By: "Turgis, Frederic" <f-turgis@ti.com>
12 years agoFixed PR11763 by supporting getting arg 6 for nd_syscall probes.
David Smith [Mon, 23 Apr 2012 19:28:14 +0000 (14:28 -0500)]
Fixed PR11763 by supporting getting arg 6 for nd_syscall probes.

* tapset/s390/registers.stp: Convert _stp_arg() to an embedded-C function
  that uses syscall_get_arguments() to find argument values.

12 years agostaprun: fix missing \n on reloc-related dbug messages
Frank Ch. Eigler [Fri, 20 Apr 2012 18:42:01 +0000 (14:42 -0400)]
staprun: fix missing \n on reloc-related dbug messages

12 years agoPR14005: tolerate rudely long kernel module/section names
Frank Ch. Eigler [Fri, 20 Apr 2012 18:37:48 +0000 (14:37 -0400)]
PR14005: tolerate rudely long kernel module/section names

* staprun.c (send_relocation_modules): Ignore return value from
  send_a_relocation(), as failures there are entirely tolerable.

12 years agocontext tapsets: remove EXPERIMENTAL word from the various functions
Frank Ch. Eigler [Fri, 20 Apr 2012 14:12:26 +0000 (10:12 -0400)]
context tapsets: remove EXPERIMENTAL word from the various functions

Two years of EXPERIMENTAL status is plenty.

12 years agoPR13999: Use %#c to escape pretty-printed characters
Josh Stone [Fri, 20 Apr 2012 00:19:53 +0000 (17:19 -0700)]
PR13999: Use %#c to escape pretty-printed characters

We especially need escaping to combat \0 characters, which would
truncate the rest of the pretty-printed string.

* tapsets.cxx (dwarf_pretty_print::recurse_base): Use %#c for chars.
* testsuite/systemtap.printf/pretty-char.*: Test char escaping.

12 years agoPR13999: Let "%#c" add escapes for nonprintables
Josh Stone [Fri, 20 Apr 2012 00:11:14 +0000 (17:11 -0700)]
PR13999: Let "%#c" add escapes for nonprintables

The special '#' flag previously didn't do anything for characters.  Now
it signals that non-printable characters should be escaped in the output
string, either using C shortcuts or octal values.

* runtime/vsprintf.c (_stp_vsprint_char_size, _stp_vsprint_char): New
  functions to size and fill the buffer, accounting for escape chars.
  (_stp_vsnprintf): Use the new char functions.
* translate.cxx (c_unparser::emit_compiled_printfs): Ditto.
* testsuite/systemtap.printf/char2.*: Test %#c
* NEWS, stap.1: Document it.

12 years agoPR13998: pretty-print bit fields numerically
Josh Stone [Thu, 19 Apr 2012 21:11:00 +0000 (14:11 -0700)]
PR13998: pretty-print bit fields numerically

When a struct member has bit attributes, we should always pretty-print
it as a number, even if the underlying type is a character.  Since these
attributes only show up in DWARF on the member, not the type die, we
need to treat it as a special case from the struct member iteration.

* tapsets.cxx (dwarf_pretty_print::recurse_bitfield): Print the incoming
  type numerically, regardless of whether it's a char.
  (dwarf_pretty_print::recurse_struct_members): If a member has a
  bit_offset attribute, use recurse_bitfield instead of normal recurse.
* testsuite/systemtap.printf/pretty-bits.*: Test how bitfields are
  pretty-printed, both for ints and chars underneath.

12 years agoBZ814248: staplog crash/defs.h support for arm
Frank Ch. Eigler [Thu, 19 Apr 2012 13:59:43 +0000 (09:59 -0400)]
BZ814248: staplog crash/defs.h support for arm

* staplog.c: #define ARM if __arm__ to get hold of NR_CPUS in crash/defs.h.

12 years agoPR13992: let stap tolerate -d /foo/bad/path --ldd argument
Frank Ch. Eigler [Thu, 19 Apr 2012 01:48:20 +0000 (21:48 -0400)]
PR13992: let stap tolerate -d /foo/bad/path --ldd argument

* translate.cxx (add_unwindsym_ldd): Skip unresolvable path that
  results in skeleton dwflpp.  We'll get a warning later.
* testsuite/transok/eleven.stp: New test case.

12 years agosamples regen index
Frank Ch. Eigler [Wed, 18 Apr 2012 19:03:30 +0000 (15:03 -0400)]
samples regen index

12 years agoauditbt example: use sudo as sample
Frank Ch. Eigler [Wed, 18 Apr 2012 18:59:39 +0000 (14:59 -0400)]
auditbt example: use sudo as sample

12 years agoregen sample indexes
Frank Ch. Eigler [Wed, 18 Apr 2012 18:58:39 +0000 (14:58 -0400)]
regen sample indexes

12 years agonew sample: auditbt (audit backtracing)
Frank Ch. Eigler [Wed, 18 Apr 2012 18:19:44 +0000 (14:19 -0400)]
new sample: auditbt (audit backtracing)

12 years agoBZ 813323: stapusr-only users no longer able to run unsigned modules in /lib/modules...
Dave Brolley [Tue, 17 Apr 2012 19:16:47 +0000 (15:16 -0400)]
BZ 813323: stapusr-only users no longer able to run unsigned modules in /lib/modules/`uname -r`/systemtap

- Elevate the user's privilege level to stapdev when the module is loaded from
  /lib/modules/`uname -r`/systemtap.
- Suppress error messages about failure to verify the module's signature
  when a signature is not required.

12 years agodwflpp --ldd: add another ld.so alias for arm
Frank Ch. Eigler [Fri, 13 Apr 2012 16:15:16 +0000 (12:15 -0400)]
dwflpp --ldd: add another ld.so alias for arm

* dwflpp.cxx (dwflpp::iterate_over_libraries): Add another alias
  for ARM.

12 years agoSynchronize class/struct declarations
Josh Stone [Thu, 12 Apr 2012 19:59:50 +0000 (12:59 -0700)]
Synchronize class/struct declarations

We are not very consistent about choosing struct vs class types, and in
some cases we have a mismatch between declaration and definition of a
given type.  Gcc doesn't care, but clang -Wall complains:

  CXX    stap-main.o
In file included from ../main.cxx:12:
../staptree.h:489:1: error: struct 'vardecl' was previously declared
        as a class [-Werror,-Wmismatched-tags]
struct vardecl: public symboldecl
^~~~~~
class
../staptree.h:218:7: note: previous use is here
class vardecl;
      ^

In all cases, I left the definition alone, and adjusted the declaration
to match, so it should be semantically unchanged.

12 years agosdt_query: initialize probe_type/loc as unknown.
Josh Stone [Thu, 12 Apr 2012 19:51:24 +0000 (12:51 -0700)]
sdt_query: initialize probe_type/loc as unknown.

The fields, probe_type and probe_loc, are meaningless to start, and are
later set as the queried module is examined.  Commit 74fe61bc tried to
make sure that all POD types in this class are initialized, but these
two were essentially self-assigned.  Gcc misses this uninitialized use,
but clang caught it:

  CXX    stap-tapsets.o
../tapsets.cxx:6058:38: error: field is uninitialized when used here [-Werror,-Wuninitialized]
  base_query(dw, params), probe_type(probe_type), probe_loc(probe_loc), base_probe(base_probe),
                                     ^
../tapsets.cxx:6058:61: error: field is uninitialized when used here [-Werror,-Wuninitialized]
  base_query(dw, params), probe_type(probe_type), probe_loc(probe_loc), base_probe(base_probe),
                                                            ^

Values for "unknown" are now added to these enum types to initialize
with, and dealt with where needed.

12 years agostapsh: convert dbug macros to void statements
Josh Stone [Thu, 12 Apr 2012 19:46:00 +0000 (12:46 -0700)]
stapsh: convert dbug macros to void statements

This is to get around a clang warning:

   CC     stapsh-stapsh.o
 ../../../runtime/staprun/stapsh.c:241:3: error: expression result
     unused [-Werror,-Wunused-value]
   vdbug (1, format, dbug_args);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ../../../runtime/staprun/stapsh.c:100:58: note: instantiated from:
 #define vdbug(level, format, args) ( (verbose < level) ? 0 : \
                                                          ^

None of the dbug/vdbug callers care about the fprintf return values,
so just squash them and move on.

12 years agodwflpp: Mark loc2c_error as noreturn
Josh Stone [Thu, 12 Apr 2012 19:35:25 +0000 (12:35 -0700)]
dwflpp: Mark loc2c_error as noreturn

Clang complains thusly:

../dwflpp.cxx:2281:15: error: no matching function for call to
      'c_translate_constant'
      *tail = c_translate_constant (pool, &loc2c_error, this,
              ^~~~~~~~~~~~~~~~~~~~
In file included from ../dwflpp.cxx:54:
../loc2c.h:46:18: note: candidate function not viable: no known
      conversion from 'void (*)(void *, const char *, ...)' to
      'void (*)(void *, const char *, ...) __attribute__((noreturn))'
      for 2nd argument
struct location *c_translate_constant (struct obstack *,
                 ^

The declaration for loc2c_error just needs the matching attribute.

12 years agocsclient: check directly for negative IPv4 pieces
Josh Stone [Thu, 12 Apr 2012 19:26:41 +0000 (12:26 -0700)]
csclient: check directly for negative IPv4 pieces

As noted by clang, the code was looking for negative values of an
unsigned variable (which was read by strtoul).

  CXX    stap-csclient.o
../csclient.cxx:2638:44: error: comparison of unsigned expression < 0
      is always false [-Werror,-Wtautological-compare]
      if (errno != 0 || *estr != '\0' || p < 0 || p > 255)
                                         ~ ^ ~

This can never be negative, but strtoul will implicitly case negative-
looking strings to unsigned, which will make them fail p > 255 anyway.
But to be more direct, switch to [signed] long and use strtol.

12 years agoPR13667: rework/simplify rough draft for netfilter.hook probes
Frank Ch. Eigler [Thu, 12 Apr 2012 20:19:36 +0000 (16:19 -0400)]
PR13667: rework/simplify rough draft for netfilter.hook probes

12 years agoPR13667 (In Progress) - Expose Netfilter Hooks
Chris Meek [Thu, 12 Apr 2012 18:46:10 +0000 (14:46 -0400)]
PR13667 (In Progress) - Expose Netfilter Hooks

Preliminary work setting up new probe points.

12 years agoFixed PR13745 by updating memory tracepoint examples.
David Smith [Thu, 12 Apr 2012 18:05:25 +0000 (13:05 -0500)]
Fixed PR13745 by updating memory tracepoint examples.

* testsuite/systemtap.examples/memory/mmanonpage.stp: Updated tracepoints
  for RHEL6 and upstream kernels.
* testsuite/systemtap.examples/memory/mmanonpage.stp: Ditto.
* testsuite/systemtap.examples/memory/mmfilepage.stp: Ditto.
* testsuite/systemtap.examples/memory/mmwriteback.stp: Ditto.
* testsuite/systemtap.examples/memory/mmanonpage.meta: Updated script
  tracepoint dependencies in 'test_support' section.
* testsuite/systemtap.examples/memory/mmfilepage.meta: Ditto.
* testsuite/systemtap.examples/memory/mmwriteback.meta: Ditto.

12 years agotest at_var_mark.exp requires uprobes
Josh Stone [Thu, 12 Apr 2012 00:25:30 +0000 (17:25 -0700)]
test at_var_mark.exp requires uprobes

12 years agoFix compile problem by changing 'stp_for_each_cpu' to 'for_each_possible_cpu'.
David Smith [Wed, 11 Apr 2012 20:01:02 +0000 (15:01 -0500)]
Fix compile problem by changing 'stp_for_each_cpu' to 'for_each_possible_cpu'.

* runtime/runtime.h: Removed stp_for_each_cpu() macro definition, since no
  longer needed (and 'cpu_possible_map' has been removed from the upstream
  kernel).
* runtime/map-stat.c: Replaced 'stp_for_each_cpu()' with
  'for_each_possible_cpu()'.
* runtime/map.c: Ditto.
* runtime/perf.c: Ditto.
* runtime/pmap-gen.c: Ditto.
* runtime/stat.c: Ditto.
* runtime/transport/procfs.c: Ditto.
* translate.cxx: Ditto.

12 years agoClarify that resource limits are imposed on stap-server requests and not on stap...
Dave Brolley [Tue, 10 Apr 2012 18:32:24 +0000 (14:32 -0400)]
Clarify that resource limits are imposed on stap-server requests and not on stap-server itself.

12 years agoDon't compile csclient.cxx and cscommon.cxx when HAVE_NSS is false.
Dave Brolley [Tue, 10 Apr 2012 18:14:24 +0000 (14:14 -0400)]
Don't compile csclient.cxx and cscommon.cxx when HAVE_NSS is false.

- Don't compile the files at all (Makefile.am)
- #if HAVE_NSS added to the files in case another distro compiles
  them anyway.
- Don't call functions in these files from elsewhere.

12 years agoruntime/autoconf: compensate for missing <linux/wait.h> in some inode-uprobes versions
Negreanu Marius [Tue, 10 Apr 2012 15:07:29 +0000 (11:07 -0400)]
runtime/autoconf: compensate for missing <linux/wait.h> in some inode-uprobes versions

12 years agoImproved nfsdtop.stp by using aggregates.
David Smith [Thu, 5 Apr 2012 19:35:08 +0000 (14:35 -0500)]
Improved nfsdtop.stp by using aggregates.

* testsuite/systemtap.examples/network/nfsdtop.stp: Use aggregates to
  optimize a bit and reduce the number of global variables.

12 years agoAdded meta file for nfsdtop.stp and regenerated example index files.
David Smith [Thu, 5 Apr 2012 19:27:51 +0000 (14:27 -0500)]
Added meta file for nfsdtop.stp and regenerated example index files.

* testsuite/systemtap.examples/network/nfsdtop.meta: New file.
* testsuite/systemtap.examples/network/nfsdtop.stp: Made executable and
  added '#! /usr/bin/env stap' line at the top.
* testsuite/systemtap.examples/index.html: Regenerated.
* testsuite/systemtap.examples/index.txt: Ditto.
* testsuite/systemtap.examples/keyword-index.html: Ditto.
* testsuite/systemtap.examples/keyword-index.txt: Ditto.

12 years agoAdded new NFS server example script.
Bryn M. Reeves [Thu, 5 Apr 2012 18:49:11 +0000 (13:49 -0500)]
Added new NFS server example script.

12 years agopf3.stp sample: and regenerate the examples index
Frank Ch. Eigler [Thu, 5 Apr 2012 18:35:02 +0000 (14:35 -0400)]
pf3.stp sample: and regenerate the examples index

Next up, one thousand commits to add then subtract
whitespace.

12 years agopf3.stp sample: fix index title
Frank Ch. Eigler [Thu, 5 Apr 2012 18:34:31 +0000 (14:34 -0400)]
pf3.stp sample: fix index title

12 years agoexamples: add pf3.stp
Frank Ch. Eigler [Thu, 5 Apr 2012 18:21:38 +0000 (14:21 -0400)]
examples: add pf3.stp

* profiling/pf3.*: New example for combined kernel/user-space
  gross function profiling.

12 years agoMove pf2.* sample script from process/ to profiling/ subdirectory
Frank Ch. Eigler [Thu, 5 Apr 2012 18:06:05 +0000 (14:06 -0400)]
Move pf2.* sample script from process/ to profiling/ subdirectory

12 years agoFix module build problem on ARM.
David Smith [Wed, 4 Apr 2012 20:50:29 +0000 (15:50 -0500)]
Fix module build problem on ARM.

* runtime/vma.c (_stp_vma_match_vdso): Call __access_process_vm_noflush()
  instead of __access_process_vm().  When reading user memory, the
  __access_process_vm_noflush() and __access_process_vm() functions are
  fairly equivalent and we're only reading here.  (The write side of
  __access_process_vm() calls non-exported functions on ia64, mips,
  and arm.)
* runtime/sym.c (_stp_build_id_check): Ditto.

12 years agoFix module build problem on RHEL5 ia64.
David Smith [Mon, 2 Apr 2012 19:24:21 +0000 (14:24 -0500)]
Fix module build problem on RHEL5 ia64.

* runtime/sym.c (_stp_build_id_check): Only call __access_process_vm()
  when we're not using in-kernel utrace.  On RHEL5 ia64 calling
  __access_process_vm() doesn't work since it ends up calling
  flush_icache_range(), which isn't exported.
* runtime/vma.c (_stp_vma_match_vdso): Ditto.

12 years agoFix stapiu cleanup to not hold rcu lock while decrementing semaphores.
David Smith [Thu, 29 Mar 2012 20:31:33 +0000 (15:31 -0500)]
Fix stapiu cleanup to not hold rcu lock while decrementing semaphores.

* runtime/uprobes-inode.c (stapiu_decrement_process_semaphores): Unlock
  rcu while writing semaphores.  Otherwise we're atomic and we can't be in
  atomic context while writing semaphores.

12 years agoUpdate sdt_misc.exp testcase for ARM
Wade Farnsworth [Wed, 28 Mar 2012 14:47:06 +0000 (07:47 -0700)]
Update sdt_misc.exp testcase for ARM

* Omit -m64 switch for wildcard tests, as ARM does not implement this
switch
* Mark a subset of the V1 and V2 tests as XFAIL, as they are known to fail
due to broken operand parsing on ARM.  Note that this brokenness does
not affect V3.

Signed-off-by: Wade Farnsworth <wade_farnsworth@mentor.com>
12 years agoPR13475: Fix ARM SDT_V3 operand parsing
Wade Farnsworth [Wed, 28 Mar 2012 14:46:16 +0000 (07:46 -0700)]
PR13475: Fix ARM SDT_V3 operand parsing

* Include regular expressions to parse ARM operands
* Add ARM register data
* Allow for whitespace in ARM operands containing []'s

Signed-off-by: Wade Farnsworth <wade_farnsworth@mentor.com>
12 years agoPR 13370: Complete IPv6 support in the compile-server and client.
Dave Brolley [Tue, 27 Mar 2012 18:58:06 +0000 (14:58 -0400)]
PR 13370: Complete IPv6 support in the compile-server and client.

12 years agoPR13644: staprun -V (version) option
Frank Ch. Eigler [Mon, 26 Mar 2012 17:54:07 +0000 (13:54 -0400)]
PR13644: staprun -V (version) option

* common.c (parse_args): Add -V (version) support.  No long options
  already used, so --version is not immediately available.
  (usage): Document it.
* staprun.8: Ditto.
* Makefile.am: Build git_version.h.
* Makefile.in: Regenerated.

12 years agoruntime i18n: disable nonfunctional _F / _NF macros
Frank Ch. Eigler [Mon, 26 Mar 2012 17:47:06 +0000 (13:47 -0400)]
runtime i18n: disable nonfunctional _F / _NF macros

* staprun.h (_F, _NF): Disable them, noting why.

12 years agoverbosify NEWS blurbage regarding -fdebug-types-section
Frank Ch. Eigler [Sun, 25 Mar 2012 16:01:19 +0000 (12:01 -0400)]
verbosify NEWS blurbage regarding -fdebug-types-section

12 years agoImprove build-id checking when the task we're interested in isn't 'current'.
David Smith [Fri, 23 Mar 2012 20:52:01 +0000 (15:52 -0500)]
Improve build-id checking when the task we're interested in isn't 'current'.

* translate.cxx (emit_module_init): Moved include files to
  runtime/runtime.h.
* runtime/runtime.h: Moved includes here from translate.cxx.  Rearranged
  order a bit, to allow use of __access_process_vm() earlier.
* runtime/sym.c (_stp_build_id_check): Instead of passing in a flag to
  indicate build-id checking a user module, instead pass a task_struct
  pointer in.  If the task_struct pointer isn't 'current', use
  __access_process_vm() to read data.
  (_stp_module_check): Update _stp_build_id_check() call.
  (_stp_kmodule_check): Ditto.
  (_stp_usermodule_check): Ditto.
* runtime/vma.c (_stp_vma_match_vdso): If the task we're trying to match
  isn't 'current', use __access_process_vm() to read data.

12 years agoproc_mem.stp: Use PF_STARTING conditionally.
Mark Wielaard [Thu, 22 Mar 2012 14:16:22 +0000 (15:16 +0100)]
proc_mem.stp: Use PF_STARTING conditionally.

Use the PF_STARTING flag only conditionally on it being defined.
Kernel commit v3.3-rc6-27-g6e27f63 - vfork: kill PF_STARTING, removed it.

12 years agodebugtypes.exp: Remove verbose debug output.
Mark Wielaard [Thu, 22 Mar 2012 14:01:04 +0000 (15:01 +0100)]
debugtypes.exp: Remove verbose debug output.

12 years agoDepend on elfutils 0.148+, document debug_types support requires 0.154+.
Mark Wielaard [Wed, 21 Mar 2012 15:56:19 +0000 (16:56 +0100)]
Depend on elfutils 0.148+, document debug_types support requires 0.154+.

12 years agoPartial fix for PR12997 - support dwarf4 .debug_types
Tom Tromey [Fri, 16 Mar 2012 16:44:14 +0000 (10:44 -0600)]
Partial fix for PR12997 - support dwarf4 .debug_types

This fix does not solve the ET_REL case pointed out in the PR.
However, it does work ok for ordinary code.

    * dwflpp.cxx (dwflpp::iterate_over_cus): Add 'want_types' argument.
    Iterate over type units.
    (dwflpp::declaration_resolve_other_cus): Update.
    (dwflpp::iterate_single_function): Update.
    (dwflpp::iterate_over_globals): Also allow DW_TAG_type_unit.
    * dwflpp.h (module_tus_read_t): New typedef.
    (dwflpp::iterate_over_cus): Update.
    (dwflpp::module_tus_read): New member.
    * tapsets.cxx (dwarf_query::query_module_dwarf): Update.
    (tracepoint_query::handle_query_module): Update.
    * testsuite/systemtap.pass1-4/debugtypes.cxx: New file.
    * testsuite/systemtap.pass1-4/debugtypes.exp: New file.
    * testsuite/systemtap.pass1-4/debugtypes.stp: New file.

I built gdb with '-gdwarf-4 -fdebug-types-section'.
Then I tried this stap script:

probe process("/home/tromey/gnu/archer/build/gdb/gdb").function("dwarf2_attr") {
      println(@cast($dwarf2_per_objfile, "struct dwarf2_per_objfile")->objfile)
}

With Fedora 16 stap:

barimba. stap -p2 /tmp/q.stp
semantic error: type definition 'struct dwarf2_per_objfile' not found: identifier '@cast' at /tmp/q.stp:2:15
        source:       println(@cast($dwarf2_per_objfile, "struct dwarf2_per_objfile")->objfile)
                              ^
Pass 2: analysis failed.  Try again with another '--vp 01' option.

After the patch, this works.

12 years agoPR13876: same another test case
Frank Ch. Eigler [Wed, 21 Mar 2012 11:09:28 +0000 (07:09 -0400)]
PR13876: same another test case

* testsuite/semko/fifty.stp: Add /bin/sh shebang to guarantee -g propagation.

12 years agoPR13876: another test case
Frank Ch. Eigler [Wed, 21 Mar 2012 01:13:39 +0000 (21:13 -0400)]
PR13876: another test case

* testsuite/semko/fifty.stp: Add test case from report.

12 years agoPR13876: avoid miscompilation of duplicated tapset function
Frank Ch. Eigler [Wed, 21 Mar 2012 01:02:19 +0000 (21:02 -0400)]
PR13876: avoid miscompilation of duplicated tapset function

It was found that the translator got confused if the same function was
defined by the tapset and the end-user script.  The same problem can
also afflict global variables.  Along the way, clean up error
formatting.

* staptree.h (semantic_error): Drop msg2 field, which was only ever
  used for the perfunctory string "vs".
* elaborate.cxx (semantic_pass_symbols): Perform duplicate
  global-variable & function testing and rejection.
  (symresolution_info::find_function): Print an extra warning for
  the case of mismatched function callee/caller arities.
  (derive_probes): Prepare chained "while resolving
  probe point" semantic_error instead of msg2 based additions.
* session.cxx (register_library_aliases): Ditto.
  (print_error): Adjust to loss of msg2.  Print tok1 / tok2
  and source-context in a more readable way.
* tapsets.cxx (visit_target_symbol_context): Use const semantic_error*
  temps to adjust to chaining changes.
* testsuite/systemtap.base/statement.exp: Adjust to changed error message.
* translate.cxx (*): Adjust to loss of semantic_error msg2.

12 years agotestsuite: current.exp should tolerate run-time WARNINGs
Frank Ch. Eigler [Wed, 21 Mar 2012 01:00:38 +0000 (21:00 -0400)]
testsuite: current.exp should tolerate run-time WARNINGs

Pass -w to stap, so as to suppress kernel warnings, as per kprobes
-EINVAL registration errors.

12 years agotestsuite: don't run client.exp tests without installcheck
Frank Ch. Eigler [Wed, 21 Mar 2012 00:59:37 +0000 (20:59 -0400)]
testsuite: don't run client.exp tests without installcheck

This is since we wish to limit testsuite runs that use as_root to
installcheck/root runs.

12 years agotestuite: fix server_args.exp in filtering stap -v output
Frank Ch. Eigler [Wed, 21 Mar 2012 00:58:26 +0000 (20:58 -0400)]
testuite: fix server_args.exp in filtering stap -v output

Some of the help text contains ( ) chars, which need to be filtered
prior to them being accidentally passed to the regexp.

12 years agoPR11441 stop testing deprecated kernel.function(number).inline
Frank Ch. Eigler [Wed, 21 Mar 2012 00:49:42 +0000 (20:49 -0400)]
PR11441 stop testing deprecated kernel.function(number).inline

commit 440d9b00db23a1cb4b1 removed the code from the translator;
let's remove their tests from the testsuite.

12 years agotestsuite: disable rlimits test for !installtest_p
Frank Ch. Eigler [Tue, 20 Mar 2012 20:52:25 +0000 (16:52 -0400)]
testsuite: disable rlimits test for !installtest_p

12 years agoPR13878: Mention the module in @cast "not found" message
Josh Stone [Tue, 20 Mar 2012 20:04:18 +0000 (13:04 -0700)]
PR13878: Mention the module in @cast "not found" message

To help understand when @cast fails to find a type, mention the module
that was searched.  This may already hinted by the e->tok source
location, but stating the module explicitly is a useful hint if the user
left the module field to be implicitly filled in.

This page took 0.071681 seconds and 5 git commands to generate.