]> sourceware.org Git - systemtap.git/log
systemtap.git
11 years agoudp tapset: add source/dest ip/port variables, akin to those of tcp
Frank Ch. Eigler [Wed, 26 Jun 2013 16:49:20 +0000 (12:49 -0400)]
udp tapset: add source/dest ip/port variables, akin to those of tcp

* systemtap.examples/network/tcpdumplike.stp: Slightly extended to demo this.

11 years agoremoved network/tcp.stp sample; lacked meta file, duplicates tcpdumplike.stp
Frank Ch. Eigler [Wed, 26 Jun 2013 16:44:46 +0000 (12:44 -0400)]
removed network/tcp.stp sample; lacked meta file, duplicates tcpdumplike.stp

11 years agoparser: note PR13371 in eschewing \FOO processing during lexing.
Frank Ch. Eigler [Tue, 25 Jun 2013 18:50:35 +0000 (14:50 -0400)]
parser: note PR13371 in eschewing \FOO processing during lexing.

11 years agoAdd a new test for probing 'kprobe.module("foo").function("bar") (PR15675).
David Smith [Tue, 25 Jun 2013 18:43:58 +0000 (13:43 -0500)]
Add a new test for probing 'kprobe.module("foo").function("bar") (PR15675).

* testsuite/systemtap.base/kprobe_module.stp: Add new test for
  'kprobe.module("foo").function("bar")'.
* testsuite/systemtap.base/kmodule.exp: Run new kprobe_module.stp test.

11 years agomiscellany: support '\x' hex codes in string literal
Serguei Makarov [Tue, 25 Jun 2013 18:43:09 +0000 (14:43 -0400)]
miscellany: support '\x' hex codes in string literal

11 years agoFix PR15675 by making 'probe kprobe.module("foo").function("bar") work.
Yang Wen [Tue, 25 Jun 2013 18:40:29 +0000 (13:40 -0500)]
Fix PR15675 by making 'probe kprobe.module("foo").function("bar") work.

* tapsets.cxx (kprobe_derived_probe_group::emit_module_decls): Fix emitted
  kprobe_resolve() to lookup "module:function" symbols correctly.

11 years agoUpdate PR15673 fix in loc2c-runtime.h.
David Smith [Tue, 25 Jun 2013 18:34:08 +0000 (13:34 -0500)]
Update PR15673 fix in loc2c-runtime.h.

* runtime/loc2c-runtime.h: If STP_SKIP_BADVARS is defined, don't have two
  different CATCH_DEREF_FAULT definitions.

11 years agoFixed PR10395 by making the kmodule.exp testcase use a custom module.
David Smith [Tue, 25 Jun 2013 17:38:40 +0000 (12:38 -0500)]
Fixed PR10395 by making the kmodule.exp testcase use a custom module.

* testsuite/systemtap.base/kmodule.exp: Instead of depending on the 'ext3'
  module (which is no longer a module on newer kernels), build and install
  our own test module, run the test, then remove the module.
* testsuite/systemtap.base/kprobe_module.stp: Changed to probe the new
  test module.
* testsuite/systemtap.base/stap_kmodule.Makefile: New file.
* testsuite/systemtap.base/stap_kmodule.c: Ditto.

11 years agoMark externalvar.exp as KFAIL on stapdyn, PR15052
Josh Stone [Tue, 25 Jun 2013 00:10:08 +0000 (17:10 -0700)]
Mark externalvar.exp as KFAIL on stapdyn, PR15052

11 years agoPR15673: Enable deref.exp for stapdyn, and fix writes
Josh Stone [Mon, 24 Jun 2013 23:20:03 +0000 (16:20 -0700)]
PR15673: Enable deref.exp for stapdyn, and fix writes

* runtime/dyninst/copy.c (__copy_to_user): Fix the to/from pwrite args.
* runtime/loc2c-runtime.h (CATCH_DEREF_FAULT): Move here for all to use.
* testsuite/systemtap.base/deref.exp: Enable test for all runtimes.
* testsuite/systemtap.base/deref.stp: Use a known function pointer
  value, not the kernel-centric "current".

11 years agoUpdated testsuite/systemtap.examples/process/mutex_contention.stp example.
Peter Feiner [Mon, 24 Jun 2013 18:11:42 +0000 (13:11 -0500)]
Updated testsuite/systemtap.examples/process/mutex_contention.stp example.

Stats that were supposed to be collected per FUTEX_WAIT call site were
being collected per mutex init stack. So, in the "aggregate stats" section
of the report, you'd see a bunch of stacks with pthread_mutex_init at the
top, which was very confusing because a futex isn't contended when it's
created.

11 years agoEnsure there's a session for setup_dwfl_kernel
Josh Stone [Mon, 24 Jun 2013 18:02:57 +0000 (11:02 -0700)]
Ensure there's a session for setup_dwfl_kernel

It was tripping on the assert added in commit 044a265a, when running in
any mode that didn't previously set current_session_for_find_debuginfo.
e.g. stap -e 'probe begin { exit() }' -p3 -d /usr/bin/ls

11 years agoFixed PR13977 by updating the rlimit.exp testcase.
David Smith [Mon, 24 Jun 2013 16:07:56 +0000 (11:07 -0500)]
Fixed PR13977 by updating the rlimit.exp testcase.

* testsuite/systemtap.base/rlimit.exp: Added 2 fixes. Add
  '--disable-cache' to the 'CPU small' subtest. Remove the 'STACK small'
  subtest since some kernels ignore the small stack limit.

11 years agoImproved error handling and cleanup logic in uprobes_filtering.exp.
David Smith [Fri, 21 Jun 2013 18:36:45 +0000 (13:36 -0500)]
Improved error handling and cleanup logic in uprobes_filtering.exp.

11 years agoFix a typo in naming a subtest of rlimit.exp
Josh Stone [Fri, 21 Jun 2013 18:32:19 +0000 (11:32 -0700)]
Fix a typo in naming a subtest of rlimit.exp

11 years agoFix the build for !HAVE_SELINUX after commit 56098c79
Josh Stone [Fri, 21 Jun 2013 17:54:40 +0000 (10:54 -0700)]
Fix the build for !HAVE_SELINUX after commit 56098c79

11 years agostapsh.8: new man page
Frank Ch. Eigler [Thu, 20 Jun 2013 15:27:35 +0000 (11:27 -0400)]
stapsh.8: new man page

11 years agoFix PR15659 by updating the mount test for the nd_syscall/syscall tests.
David Smith [Thu, 20 Jun 2013 15:52:45 +0000 (10:52 -0500)]
Fix PR15659 by updating the mount test for the nd_syscall/syscall tests.

* testsuite/systemtap.syscall/mount.c (main): Expect EPERM or ENOENT from
  failed umount() calls.

11 years agoFixed readability issues in mutex-contention.stp example. No actual code change.
David Smith [Thu, 20 Jun 2013 15:49:59 +0000 (10:49 -0500)]
Fixed readability issues in mutex-contention.stp example. No actual code change.

11 years agostapdyn: add stapdyn.8 man page
Frank Ch. Eigler [Thu, 20 Jun 2013 15:02:01 +0000 (11:02 -0400)]
stapdyn: add stapdyn.8 man page

11 years agoPR15656: Check allow_execmod for stapdyn attach
Josh Stone [Thu, 20 Jun 2013 01:23:24 +0000 (18:23 -0700)]
PR15656: Check allow_execmod for stapdyn attach

We already check for deny_ptrace and allow_execstack before stapdyn can
proceed, but it turns out that allow_execmod is also important for
Dyninst to attach to processes (e.g. stapdyn -x PID).

* stapdyn/dynutil.cxx (check_dyninst_sebools): If we're going to be
  attaching to a process, check allow_execmod too.
* stapdyn/stapdyn.cxx (main): Indicate whether we're attaching.

11 years agoAvoid uprobes crash on error.
Torsten Polle [Wed, 19 Jun 2013 21:05:48 +0000 (16:05 -0500)]
Avoid uprobes crash on error.

* runtime/linux/uprobes/uprobes.c (uprobe_free_process): Make sure the
  uprobe_proceess' hlist field is initialized before trying to deleted it,
  to avoid a NULL pointer dereference.
* runtime/linux/uprobes2/uprobes.c (uprobe_free_process): Ditto.

11 years agouprobes_filtering.exp: add dependency on inode-uprobes
Jonathan Lebon [Wed, 19 Jun 2013 20:09:23 +0000 (16:09 -0400)]
uprobes_filtering.exp: add dependency on inode-uprobes

Added a check for the presence of inode-based uprobes, otherwise this
test is irrelevant. Also changed behaviour to conform to other tests
by declaring as untested when installtest_p() is false, rather than
only returning.

Also removed an outdated comment about ignorestderr.

11 years agotestsuite/systemtap.base: add new testcase uprobes_filtering.exp
Jonathan Lebon [Wed, 19 Jun 2013 14:12:48 +0000 (10:12 -0400)]
testsuite/systemtap.base: add new testcase uprobes_filtering.exp

This new testcase uses the newly implemented define UPROBES_HITCOUNT
(see previous commit) to verify that uprobes filtering work as it
should.

If prefiltering is supported by the kernel (from 3.9), then it verifies
that UPROBE_HANDLER_REMOVE is obeyed and that the prehandler() is not
called over and over for unwanted processes, allowing the stap script
to run at full speed.

In both cases (whether or not prefiltering is supported), it also
verifies that the probe handlers are called only for the processes of
interest and no other (i.e. it makes sure that the filtering in
stapiu_probe_prehandler() works).

11 years agouprobes-inode.c: add UPROBES_HITCOUNT
Jonathan Lebon [Fri, 14 Jun 2013 19:06:46 +0000 (15:06 -0400)]
uprobes-inode.c: add UPROBES_HITCOUNT

Added a new directive 'UPROBES_HITCOUNT' which causes stapiu to keep
track of the number of times stapiu_probe_prehandler() and
stapiu_probe_handler() are called. Upon exiting, stapiu_exit() prints
these numbers.

These are important statistics which allow us to verify that uprobe
filtering is working as it should.

11 years agotranslator: for --vp 05, print log of dwarf module/filename matches during elfutils...
Frank Ch. Eigler [Wed, 19 Jun 2013 17:52:38 +0000 (13:52 -0400)]
translator: for --vp 05, print log of dwarf module/filename matches during elfutils search

11 years agoAnother 'as_non_root' improvement.
David Smith [Tue, 18 Jun 2013 20:46:48 +0000 (15:46 -0500)]
Another 'as_non_root' improvement.

11 years agoFix tcl and logic errors in rlimit.exp.
David Smith [Tue, 18 Jun 2013 19:18:47 +0000 (14:18 -0500)]
Fix tcl and logic errors in rlimit.exp.

* testsuite/systemtap.base/rlimit.exp: To make sure "sudo stap" works
  correctly, use the full path.
* testsuite/lib/systemtap.exp (as_non_root): If we're running as root, use
  user "nobody" to run commands.

11 years agoFix a tcl error in testsuite/systemtap.base/library.exp.
David Smith [Tue, 18 Jun 2013 17:32:06 +0000 (12:32 -0500)]
Fix a tcl error in testsuite/systemtap.base/library.exp.

* testsuite/systemtap.base/library.exp (globbing_test): When a timeout
  happens, fail properly.

11 years agoMade several parseko/semko tests executable.
David Smith [Tue, 18 Jun 2013 17:28:29 +0000 (12:28 -0500)]
Made several parseko/semko tests executable.

* testsuite/parseko/fiftyone.stp: Made executable.
* testsuite/parseko/perf03.stp: Ditto.
* testsuite/parseko/perf04.stp: Ditto.
* testsuite/parseko/regex_notlit.stp: Ditto.
* testsuite/parseko/twentyeight.stp: Ditto.
* testsuite/semko/badregex01.stp: Ditto.

11 years agoRevert use of -javaagent
Lukas Berk [Tue, 18 Jun 2013 16:20:34 +0000 (12:20 -0400)]
Revert use of -javaagent

There are two methods of invoking and running byteman operations on
java processes, modifying the java arguments to make use of -javaagent,
or utilizing byteman to use the VMAttach runtime libraries.  While
use of -javaagent may work in simple use cases, for our needs using
byteman operations should always be the preferred option.  This commit
also removes duplicate argument specifications (-Dorg.jboss-listener-port)

*java/stapbm.in - remove use of -javaagent and revert to byteman operations

11 years agoAdd the dyninst include path to the cscope target
Josh Stone [Fri, 14 Jun 2013 20:51:08 +0000 (13:51 -0700)]
Add the dyninst include path to the cscope target

11 years agoconfigure.ac: change `sqlite3' to straight 'sqlite3'
Josh Stone [Fri, 14 Jun 2013 20:40:01 +0000 (13:40 -0700)]
configure.ac: change `sqlite3' to straight 'sqlite3'

Vim syntax highlighting gets confused by the unpaired "`", and this
string is only used for a config.h comment, so just use plain "'".

11 years agoPlace HelperSDT in its own package, use -javaagent for byteman invocation
Lukas Berk [Fri, 14 Jun 2013 19:46:06 +0000 (15:46 -0400)]
Place HelperSDT in its own package, use -javaagent for byteman invocation

In order to use stapbm with jboss-as, we need to package our HelperSDT class
along with this we need to use -javaagent to invoke the byteman commands (simply
a syntax change, actual functionality from our persepctive remains the same)
Due to the package name (org.systemtap.byteman.helper) we need to change the
directory HelperSDT.java is located in and autoreconf the makefile changes

*java/HelperSDT.c: change class name to include full package name
*java/HelperSDT.h: likewise
*java/Makefile.am: change location of HelperSDT.java to match package name
*java/Makefile.in: likewise
*java/HelperSDT.java: move to org/systemtap/byteman/helper to match package name
*java/stapbm.in: alter helper name to include package and invoke byteman operations
 using the -javaagent syntax
*Makefile.in: Regnerate with autoconf 2.69
*aclocal.m4: likewise
*config.in: likewise
*configure: likewise
*doc/Makefile.in: likewise
*doc/SystemTap_Tapset_Reference/Makefile.in: likewise
*doc/beginners/Makefile.in: likewise
*man/Makefile.in: likewise
*re2c-migrate/Makefile.in: likewise
*stapdyn/Makefile.in: likewise
*staprun/Makefile.in: likewise
*testsuite/Makefile.in: likewise
*testsuite/aclocal.m4: likewise
*testsuite/configure: likewise

11 years agoPR15619: Check prior stapdyn signals while waiting to exit
Josh Stone [Thu, 13 Jun 2013 22:21:42 +0000 (15:21 -0700)]
PR15619: Check prior stapdyn signals while waiting to exit

* stapdyn/mutator.cxx (mutator::run): When running without mutatees
  (which is really only done by the testsuite), use a proper signal mask
  and check for signals that may have already arrived.

11 years agoPR15624: Use 64-bit offsets in stapdyn modules
Josh Stone [Thu, 13 Jun 2013 22:14:05 +0000 (15:14 -0700)]
PR15624: Use 64-bit offsets in stapdyn modules

This is important for our memory deref functions, which could very well
try to pread/pwrite an "offset" which is greater than INT32_MAX.  Such
signed overflow results in EINVAL from the kernel.

* runtime/dyninst/runtime_defines.h: #define _FILE_OFFSET_BITS 64.
* runtime/dyninst/copy.c (__copy_from_user, __copy_to_user): Cast
  void* to off_t through uintptr_t for size and sign correctness.
* testsuite/systemtap.printf/pretty-bits.exp: Don't use kernel<header>
  for userspace, although this requires a trick to deal with tcl exec.
* testsuite/systemtap.printf/pretty-char.exp: Ditto.

11 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
David Smith [Thu, 13 Jun 2013 20:41:22 +0000 (15:41 -0500)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

11 years agoSmall initializion code fix needed for PR14791.
David Smith [Thu, 13 Jun 2013 20:39:42 +0000 (15:39 -0500)]
Small initializion code fix needed for PR14791.

* runtime/dyninst/session_attributes.c (_stp_init_session_attributes):
  Initialize 'outfile_name'.

11 years agonew test case for user_string_n_quoted()
Jonathan Lebon [Thu, 13 Jun 2013 20:32:20 +0000 (16:32 -0400)]
new test case for user_string_n_quoted()

This test case ensures that user_string_n_quoted() truncates strings
properly and without an off-by-one error. Also see PR15617.

11 years agouconversions.stp: fix pointer cast to be 32-bit compatible
Jonathan Lebon [Thu, 13 Jun 2013 20:21:54 +0000 (16:21 -0400)]
uconversions.stp: fix pointer cast to be 32-bit compatible

Reported-by: Josh Stone <jistone@redhat.com>
11 years ago(nd_)syscall.exp: adapt tests and fix umask test failure
Jonathan Lebon [Thu, 13 Jun 2013 15:02:29 +0000 (11:02 -0400)]
(nd_)syscall.exp: adapt tests and fix umask test failure

The recent changes in the *syscall tapsets were causing failures in a
few of the C files tested as part of nd_syscall.exp and syscall.exp.
These files had their expected output changed to match what is now
output.

Also, umask.c had been failing from before only because a '0' is
printed, not '00' as expected.

11 years agofix clamp_t arguments in user_string_n_quoted()
Jonathan Lebon [Thu, 13 Jun 2013 14:20:45 +0000 (10:20 -0400)]
fix clamp_t arguments in user_string_n_quoted()

The 'len' parameter passed to _stp_text_str() was incorrectly set to
1 higher than need be. The function _stp_text_str() does not count the
trailing NULL. In contrast, the function _stp_strncpy_from_user() does,
which is also used in this tapset, in which case 'len' should indeed be
incremented (see e.g. user_string_n()). This may have been the source
of the confusion.

11 years agoUse user_string_n_quoted() instead of text_strn() to truncate
Jonathan Lebon [Thu, 13 Jun 2013 13:07:54 +0000 (09:07 -0400)]
Use user_string_n_quoted() instead of text_strn() to truncate

Using text_strn() outside of user_string_quoted() resulted in having
two sets of surrounding quotes added. This did not occur before commit
2f65948, in which all user_string() calls were changed to
user_string_quoted(). So instead of using text_strn(), we can directly
use user_string_n_quoted(), which takes care of both quoting and
truncating in one place.

11 years agoPR15044: update testsuite to conform to uconversions.stp
Jonathan Lebon [Tue, 11 Jun 2013 18:47:34 +0000 (14:47 -0400)]
PR15044: update testsuite to conform to uconversions.stp

Due to user_string_quoted() now returning strings surrounded by quotes,
the test scripts utrace_syscall_args.stp and memory1.stp were updated.

Also, the try/catch block around user_string_n() in conversions.stp
were removed so that it counts instead as one more ERROR. Changed the
number of expected errors/warnings from 20 to 22 to account for the
error we now get from user_string_n() as well as from user_string(),
which now throws an error (see previous commit).

Updated all the other conversions_*.stp scripts so that they include
the two new functions. Also, they all had a duplicate probe for
user_string_n(), which messed up the count.

11 years agouconversions.stp: make use of similar funcs to promote code re-use
Jonathan Lebon [Tue, 11 Jun 2013 16:07:35 +0000 (12:07 -0400)]
uconversions.stp: make use of similar funcs to promote code re-use

Multiple functions were changes so that they now just call a more
generic function. The functions changed are: user_string(),
user_string2(), user_string2_warn(), and user_string_quoted().

11 years agoPR15044: make probe aliases use user_string_quoted()
Jonathan Lebon [Mon, 10 Jun 2013 20:05:03 +0000 (16:05 -0400)]
PR15044: make probe aliases use user_string_quoted()

Many probe aliases previously used user_string(). Now, they all use
user_string_quoted(), which never raises an error. Thus, the function
user_string() has been modified to throw an error if an address can't
be read.

By contrast, user_string_quoted() (and also user_string_n_quoted()) now
return the pointer itself as a string in case of failure, whereas
successfully retrieved strings are surrounded by double-quotes.

11 years agoReformat and add to stapdyn/README presentation list
Josh Stone [Wed, 12 Jun 2013 21:22:22 +0000 (14:22 -0700)]
Reformat and add to stapdyn/README presentation list

11 years agoNote the PR15614 limitation in stapdyn/README
Josh Stone [Wed, 12 Jun 2013 21:21:32 +0000 (14:21 -0700)]
Note the PR15614 limitation in stapdyn/README

11 years agoFix PR14791 by adding a '-o FILE' option to stapdyn.
David Smith [Wed, 12 Jun 2013 18:42:45 +0000 (13:42 -0500)]
Fix PR14791 by adding a '-o FILE' option to stapdyn.

* stapdyn/stapdyn.cxx (usage): Add '-o FILE' description (and better
  descriptions in general).
  (main): Add '-o' option support.
* stapdyn/mutator.cxx (init_session_attributes): If output file name was
  specified, set it with global_setter().
* stapdyn/dynutil.cxx: Add 'stapdyn_outfile_name' global.
* stapdyn/dynutil.h: Ditto.
* runtime/dyninst/transport.c (stap_strfloctime): New function (copied
  from staprun/common.c).
  (_stp_dyninst_transport_thread_func): Add output file support.
* buildrun.cxx (make_dyninst_run_command): Add '-o' output file name
  option.
* runtime/dyninst/session_attributes.c (stp_session_attribute_setter):
  Handle '@outfile_name' session attribute.
* runtime/dyninst/session_attributes.h: Added 'outfile_name' to
  _stp_session_attributes.
* testsuite/systemtap.base/strftime.exp: Add dyninst support.
* testsuite/systemtap.printf/end1.exp: Ditto.
* testsuite/systemtap.printf/mixed_out.exp: Ditto.
* testsuite/systemtap.printf/out1.exp: Ditto.
* testsuite/systemtap.printf/out2.exp: Ditto.
* testsuite/systemtap.printf/out3.exp: Ditto.

11 years agoPR14573: Add stapdyn register support for powerpc
Josh Stone [Wed, 12 Jun 2013 00:26:07 +0000 (17:26 -0700)]
PR14573: Add stapdyn register support for powerpc

* runtime/dyninst/regs.c (_stp_print_regs): Add a ppc version.
* runtime/dyninst/uprobes.c (stapdu_dummy_uregs): Just use {} to
  initialize, because {0} doesn't work for ->gpr[].
* runtime/dyninst/uprobes-regs.c (enter_dyninst_uprobe_regs): Ditto on
  initializing pt_regs, and add a loop to fill ppc dwarf registers.
* stapdyn/mutatee.cxx (get_dwarf_registers): Add ppc registers, but note
  that only 6 can be passed thanks to a Dyninst argument limitation.

11 years agoPR15029: Reflect script errors in stapdyn's exit status
Josh Stone [Tue, 11 Jun 2013 22:03:43 +0000 (15:03 -0700)]
PR15029: Reflect script errors in stapdyn's exit status

This adds a new stapdyn.h function to query the script/module's exit
status.  One wishes session_exit had returned this in the first place...

Tests beginenderror.exp and trycatch.exp were failing on dyninst, and
are now working with this fix.

* runtime/dyninst/stapdyn.h: Declare stp_dyninst_exit_status();
* runtime/dyninst/runtime.h: Implement it from a static global.
* runtime/dyninst/transport.c: Set that global on "ERROR:" messages,
  like stapio does with its error_detected flag.
* stapdyn/mutator.cxx (mutator::exit_status): New, looks for the new
  function in the module to get status.
* stapdyn/stapdyn.cxx (main): Call mutator::exit_status().

11 years agostapdyn: Let the module request to exit
Josh Stone [Tue, 11 Jun 2013 01:50:06 +0000 (18:50 -0700)]
stapdyn: Let the module request to exit

This adds a transport message STP_DYN_REQUEST_EXIT, on which the module
within stapdyn will signal stapdyn that we want to exit.  This also lets
stapdyn without any -c cmd work better, as it can wait around for the
exit signal.

11 years agoPR14665: improve stapdyn's signal handling
Josh Stone [Wed, 5 Jun 2013 19:52:39 +0000 (12:52 -0700)]
PR14665: improve stapdyn's signal handling

This changes stapdyn's signal handling to be a bit more like staprun's.
The signals considered now are SIGHUP, SIGINT, SIGTERM, and SIGQUIT,
with the latter being a more immediate exit.  The others will wait
around for any created process to finish, but this is debatable.

The heuristic of counting signals is gone, as it just didn't work very
well.  Instead this just tracks a mask of signals we've seen.  We also
don't try to kill the target process anymore, since staprun doesn't do
that either.  If a user hits CTRL-C on the command line, that will go
to the whole process group which includes the target.

11 years agoSimplify testsuite/systemtap.base/list.exp with procs
Josh Stone [Mon, 10 Jun 2013 23:18:24 +0000 (16:18 -0700)]
Simplify testsuite/systemtap.base/list.exp with procs

11 years agoPR15587: fix inline statement line numbers
Josh Stone [Mon, 10 Jun 2013 22:59:52 +0000 (15:59 -0700)]
PR15587: fix inline statement line numbers

* tapsets.cxx (query_srcfile_line): As with full function statements,
  use the destination lineno for inline statment probes, rather than the
  q->line from the user (which is 0 for wildcards).
* list.exp: Test probe listing for statements in an inline function.

11 years agoPR15278: Make use of UPROBE_HANDLER_REMOVE
Josh Stone [Mon, 10 Jun 2013 21:13:23 +0000 (14:13 -0700)]
PR15278: Make use of UPROBE_HANDLER_REMOVE

When a uprobe handler is called in a process we didn't want (thanks to
shared inodes), we already skip it if it's not in our process list.  Now
we also return UPROBE_HANDLER_REMOVE to let uprobes know the probe can
be removed from this particular process, so only participating processes
will incur breakpoint overhead.  We do have to be careful that task
finder's process coverage is complete though, so we don't remove probes
from a process that just wasn't tracked yet.

* runtime/linux/task_finder2.c (stap_task_finder_complete): New test to
  see if task_finder has hooked all processes yet; set after post_init.
* runtime/linux/uprobes-inode.c (stapiu_probe_prehandler): In processes
  which we're about to skip, use UPROBE_HANDLER_REMOVE if task finder
  says it has complete coverage.

11 years agoPR15044: modified and added tests in conversions.stp test script
Jonathan Lebon [Mon, 10 Jun 2013 13:40:12 +0000 (09:40 -0400)]
PR15044: modified and added tests in conversions.stp test script

Added a test for user_string2_warn() and user_string2_n_warn().
Modified Expect script to allow for 2 more errors and warnings, which
correspond to the two functions added. Also modified user_string_n()
test to use try/catch blocks.

11 years agoPR15044: rewrite the vma_vdso.stp test
Jonathan Lebon [Thu, 6 Jun 2013 17:24:13 +0000 (13:24 -0400)]
PR15044: rewrite the vma_vdso.stp test

The new vma_vdso.stp test script now uses the try/catch blocks to
determine whether umodname() failed or not.

11 years agoPR15044: keep cute return val and conditional check for last_error only
Jonathan Lebon [Mon, 10 Jun 2013 15:49:29 +0000 (11:49 -0400)]
PR15044: keep cute return val and conditional check for last_error only

In order to avoid the kernel panic which occurred due to a null pointer
(see previous commit), all patches in PR15044 were rechecked so that
the return value is always valid (by keeping its cute message) and the
conditional version check is done solely for assigning to last_error.

11 years agoPR15044: ucontext.stp: fix name == NULL bug on error
Jonathan Lebon [Fri, 7 Jun 2013 20:19:23 +0000 (16:19 -0400)]
PR15044: ucontext.stp: fix name == NULL bug on error

The 'name' variable was not assigned a value if _stp_umod_lookup()
failed. This means the call to strlcpy() happened even though 'name'
was NULL. Now, name is always assigned a value, even if
_stp_umod_lookup() fails.

11 years agoPR15044: added error-checking in string.stp
Jonathan Lebon [Thu, 6 Jun 2013 18:35:28 +0000 (14:35 -0400)]
PR15044: added error-checking in string.stp

Since commit 14138e5 changed the return value of _stp_text_str() from
void to int, other functions that use it, such as text_str() and
text_strn(), can make use of the return value to set their own return
strings to an empty string.

11 years agoPR15044: reversed patches in functions too popular in probe aliases
Jonathan Lebon [Thu, 6 Jun 2013 16:03:54 +0000 (12:03 -0400)]
PR15044: reversed patches in functions too popular in probe aliases

The following functions had their cutesy errors restored:
    - tapset/linux/ip.stp: format_ipaddr()
    - tapset/errno.stp: returnstr()
    - tapset/uconversions.stp: user_string()

These functions are used by many probe aliases, especially in the
*syscall* tapsets and for format_ipaddr(), in the network-related
tapsets, such as rpc.stp, tcp.stp, and netfilter.stp. Thus, it is not
ideal to throw an error in case of failure. See the discussion in the
associated bug report for more information.

11 years agoPR15044: hardcoded version 2.3
Jonathan Lebon [Wed, 5 Jun 2013 20:00:21 +0000 (16:00 -0400)]
PR15044: hardcoded version 2.3

Replaced all the snippets flagged with "PR15044" containing
STAP_COMPAT_VERSION to version 2.3.

11 years agoFix 'nd_syscall.io_getevents' probe.
David Smith [Mon, 10 Jun 2013 16:15:13 +0000 (11:15 -0500)]
Fix 'nd_syscall.io_getevents' probe.

* tapset/linux/nd_syscalls.stp: Split 'nd_syscall.io_getevents' into
  'nd_syscall.io_getevents' and 'nd_syscall.compat_io_getevents', since
  the kernel function 'compat_sys_io_getevents' gets a 'struct
  compat_timespec', not a 'struct timespec'.
* testsuite/buildok/nd_syscalls-details.stp: Add
  'nd_syscall.compat_io_getevents' and
  'nd_syscall.compat_io_getevents.return' tests.

11 years agoFix 'syscall.io_getevents' probe.
David Smith [Mon, 10 Jun 2013 16:06:27 +0000 (11:06 -0500)]
Fix 'syscall.io_getevents' probe.

* tapset/linux/syscalls.stp: Split 'syscall.io_getevents' into
  'syscall.io_getevents' and 'compat_syscall.io_getevents', since the
  kernel function 'compat_sys_io_getevents' gets a 'struct
  compat_timespec', not a 'struct timespec'.
* testsuite/buildok/syscalls-details.stp: Add
  'compat_syscall.io_getevents' and 'compat_syscall.io_getevents.return'
  tests.

11 years agoFixed s390x utrace_syscall_args.exp test failure.
David Smith [Fri, 7 Jun 2013 18:24:54 +0000 (13:24 -0500)]
Fixed s390x utrace_syscall_args.exp test failure.

* testsuite/systemtap.base/utrace_syscall_args.stp: Correctly handle odd
  s390x mmap() arguments in a structure.

11 years agoImprove buildok.exp by kfailing the unwind tests on ia64.
David Smith [Thu, 6 Jun 2013 21:13:17 +0000 (16:13 -0500)]
Improve buildok.exp by kfailing the unwind tests on ia64.

* testsuite/systemtap.pass1-4/buildok.exp: Mark the unwind tests as kfails
  on ia64, since the dwarf unwinder isn't ported there.

11 years agoFix multiple inclusion guard macro in runtime/compatdefs.h.
David Smith [Thu, 6 Jun 2013 21:04:56 +0000 (16:04 -0500)]
Fix multiple inclusion guard macro in runtime/compatdefs.h.

11 years agoFix uconversion.stp function summaries to be a single line
William Cohen [Thu, 6 Jun 2013 16:10:22 +0000 (12:10 -0400)]
Fix uconversion.stp function summaries to be a single line

The tool that extracts the information from the comments for the
tapset documentation needs the summary to be on a single line.  If the
summary continues to another line, the tool thinks the second line is
part of the description and will fail generating output because there
are multiple description for the same function.

11 years agoPR15575: Remove now-unnecessary ntohs() in a few places
Josh Stone [Wed, 5 Jun 2013 21:08:22 +0000 (14:08 -0700)]
PR15575: Remove now-unnecessary ntohs() in a few places

Now that __tcp_sock_dport/sport return host order, there are a few
related places which no longer need their own ntohs().

Reported-by: Jonathan Lebon <jlebon@redhat.com>
11 years agoPR15044: replaced error return by catchable exception in ucontext.stp
Jonathan Lebon [Tue, 4 Jun 2013 16:08:49 +0000 (12:08 -0400)]
PR15044: replaced error return by catchable exception in ucontext.stp

11 years agomemory.stp: fix documentation typo
Jonathan Lebon [Mon, 3 Jun 2013 18:21:05 +0000 (14:21 -0400)]
memory.stp: fix documentation typo

11 years agoPR15044: remove error return string in ip.stp
Jonathan Lebon [Mon, 3 Jun 2013 18:13:06 +0000 (14:13 -0400)]
PR15044: remove error return string in ip.stp

11 years agolinux/context-symbols: fix small typo in cutesy error return
Jonathan Lebon [Mon, 3 Jun 2013 17:51:06 +0000 (13:51 -0400)]
linux/context-symbols: fix small typo in cutesy error return

Fixes a typo in the return value which could affect backwards
compatibility with versions <= 2.2.

11 years agoPR15044: change _stp_text_str() from void to int and clean up tapset
Jonathan Lebon [Fri, 31 May 2013 18:38:02 +0000 (14:38 -0400)]
PR15044: change _stp_text_str() from void to int and clean up tapset

The tapset functions user_string_quoted() and user_string_n_quoted()
now no longer return "NULL" and _stp_text_str() in stp_string.c no
longer returns "<unknown>". Instead, _stp_text_str() was changed to
return an int which the tapset checks for to detect an error.

11 years agoPR15044: cleaned up functions in uconversions.stp
Jonathan Lebon [Thu, 30 May 2013 19:59:02 +0000 (15:59 -0400)]
PR15044: cleaned up functions in uconversions.stp

Made multiple changes to the way functions report errors. Also added
two new functions to help the cause: user_string2_warn() and
user_string2_n_warn().

11 years agoPR15044: clean up funcs in errno.stp and string.stp
Jonathan Lebon [Thu, 30 May 2013 19:11:44 +0000 (15:11 -0400)]
PR15044: clean up funcs in errno.stp and string.stp

In errno.stp, made returnstr() report an error if there are no
registers available rather than returning 0. In string.stp, changed
stringat() to report an error if pos is out of bounds.

Minor typo fix in logging.stp.

11 years agostapregex PR15064: update docs
Serguei Makarov [Wed, 5 Jun 2013 19:38:56 +0000 (15:38 -0400)]
stapregex PR15064: update docs

11 years agoPR15575: Return host order in __tcp_sock_dport/sport
Josh Stone [Wed, 5 Jun 2013 01:23:41 +0000 (18:23 -0700)]
PR15575: Return host order in __tcp_sock_dport/sport

The dport and sport are in network order in inet_sock.  When these
tapset functions extract them, they should convert to host order.

Reported-by: "bcall" on freenode #systemtap
11 years agoerrsnoop sample: reduce memory consumption
Frank Ch. Eigler [Tue, 4 Jun 2013 20:49:33 +0000 (16:49 -0400)]
errsnoop sample: reduce memory consumption

The previous version of the code used a stats- (per-cpu-) array with a
5-tuple of index keys, three of them strings.  Multiplying all that
out could could yield several hundred MB of requested kernel RAM at
startup.  Not that anything's wrong with that, but let's not be so
gluttinous.

The new code uses one formatted string as the key column.

11 years agostapregex PR15064: additional testsuite for chr classes
Serguei Makarov [Tue, 4 Jun 2013 18:14:41 +0000 (14:14 -0400)]
stapregex PR15064: additional testsuite for chr classes

11 years agostapregex PR15064 oops: actual proper \ escaping in chr class
Serguei Makarov [Tue, 4 Jun 2013 17:03:36 +0000 (13:03 -0400)]
stapregex PR15064 oops: actual proper \ escaping in chr class

11 years agostapregex PR15064: add remaining essential character classes
Serguei Makarov [Mon, 3 Jun 2013 21:04:06 +0000 (17:04 -0400)]
stapregex PR15064: add remaining essential character classes

This completes POSIX ERE support (ostensibly), but the chr classes
are largely untested at the moment; future commits will add testcases.

11 years agostapregex PR15064 testsuite OOPS: escaping support for ':' in testcase format
Serguei Makarov [Mon, 3 Jun 2013 21:03:38 +0000 (17:03 -0400)]
stapregex PR15064 testsuite OOPS: escaping support for ':' in testcase format

11 years agostapregex PR15064: groundwork for named chr class support
Serguei Makarov [Mon, 3 Jun 2013 18:45:31 +0000 (14:45 -0400)]
stapregex PR15064: groundwork for named chr class support

Current support is missing most of the standard chr classes,
need to find a good and proper reference for them.

* stapregex.cxx (regex_parser::parse_char_range): respect [: :] brackets
  when slurping character classes.
* re2c-regex.h (Range::Range): fix lack of deep-copy in copy constructor
  for ranges.
* re2c-regex.cxx (namedCharacterClasses): new global table of char ranges.
  (Scanner::namedChrClass): new function.
  (Scanner::ranToRA): new function.
  (Scanner::ranToRE): change to use ranToRA.
  (Scanner::getRange): check for '[:' digraph and replace named chr class.

11 years agostapregex: fix spacing in re2c_error message
Serguei Makarov [Mon, 3 Jun 2013 17:12:48 +0000 (13:12 -0400)]
stapregex: fix spacing in re2c_error message

11 years agoPR15064: re-enable basic testcases
Serguei Makarov [Mon, 3 Jun 2013 14:56:40 +0000 (10:56 -0400)]
PR15064: re-enable basic testcases

11 years ago(Re)Fix BZ15198 by updating syscall.sigaltstack probe.
David Smith [Tue, 4 Jun 2013 19:26:30 +0000 (14:26 -0500)]
(Re)Fix BZ15198 by updating syscall.sigaltstack probe.

* tapset/linux/syscalls2.stp: Use generic 'sigaltstack' probe alias when
  CONFIG_GENERIC_SIGALTSTACK is set or we're running on a 3.9 (or higher)
  kernel (where CONFIG_GENERIC_SIGALTSTACK is the default).
* tapset/linux/nd_syscalls2.stp: Ditto.
* tapset/linux/i386/nd_syscalls.stp: Only use arch-specific 'sigaltstack'
  probe alias if CONFIG_GENERIC_SIGALTSTACK isn't set or we're running on
  a earlier kernel than 3.8.
* tapset/linux/i386/syscalls.stp: Ditto.
* tapset/linux/ia64/nd_syscalls.stp: Ditto.
* tapset/linux/ia64/syscalls.stp: Ditto.
* tapset/linux/powerpc/nd_syscalls.stp: Ditto.
* tapset/linux/powerpc/syscalls.stp: Ditto.
* tapset/linux/s390/nd_syscalls.stp: Ditto.
* tapset/linux/s390/syscalls.stp: Ditto.
* tapset/linux/x86_64/nd_syscalls.stp: Ditto.
* tapset/linux/x86_64/syscalls.stp: Ditto.

11 years agoEliminate the possibility of ioblktime.stp global array overflow
William Cohen [Tue, 4 Jun 2013 16:05:12 +0000 (12:05 -0400)]
Eliminate the possibility of ioblktime.stp global array overflow

In some cases the global array tracking IO operations in flight could
overflow when the machine is doing many IO operations (RHBZ743591).
The possiblity of overflow is addressed by increasing the amount of
space allocated for the global array and using the '%' specifier for
the global array.

11 years agoFixed PR15572 by updating the ipmip.stp tapset.
David Smith [Tue, 4 Jun 2013 16:06:33 +0000 (11:06 -0500)]
Fixed PR15572 by updating the ipmip.stp tapset.

* tapset/linux/ipmib.stp: Updated the 'ipmib.InNoRoutes' and
  'ipmib.InAddrErrors' probe aliases for the 3.10 kernel. Those probe
  aliases now probe the return of the ip_route_input_noref() kernel
  function.

11 years agoUpdate testsuite/buildok/nfs_proc-embedded.stp for nfs_proc.stp changes.
David Smith [Tue, 4 Jun 2013 13:36:12 +0000 (08:36 -0500)]
Update testsuite/buildok/nfs_proc-embedded.stp for nfs_proc.stp changes.

11 years agoFixed PR15523 by updating the socket.stp tapset.
David Smith [Tue, 4 Jun 2013 13:31:48 +0000 (08:31 -0500)]
Fixed PR15523 by updating the socket.stp tapset.

* tapset/linux/socket.stp: Reimplemented functions as macros. The old
  functions were deprecated. Used those new macros throughout the tapset,
  to avoid trying to use NULL pointers.
* NEWS: Mentioned function deprecations.
* testsuite/buildok/socket-embedded.stp: No longer test deprecated
  functions.

11 years agoFixed readability issues in tapset/linux/socket.stp. No code change.
David Smith [Mon, 3 Jun 2013 16:35:12 +0000 (11:35 -0500)]
Fixed readability issues in tapset/linux/socket.stp. No code change.

11 years agoActually deprecate items marked as deprecated in nfs_proc.stp.
David Smith [Mon, 3 Jun 2013 16:23:53 +0000 (11:23 -0500)]
Actually deprecate items marked as deprecated in nfs_proc.stp.

* tapset/linux/nfs_proc.stp: The 'stap_NFS_CLIENT' and '__getfh_inode'
  functions had a comment stating they were deprecated. Actually make it
  happen.
* NEWS: Mentioned function deprecations.

11 years agoHandle CONFIG_USER_NS/CONFIG_UIDGID_STRICT_TYPE_CHECKS in the runtime.
Alexander Y. Fomichev [Fri, 31 May 2013 19:46:56 +0000 (14:46 -0500)]
Handle CONFIG_USER_NS/CONFIG_UIDGID_STRICT_TYPE_CHECKS in the runtime.

* runtime/linux/task_finder.c: Add CONFIG_UIDGID_STRICT_TYPE_CHECKS code.
* runtime/linux/task_finder2.c: Ditto.
* runtime/transport/control.c: Ditto.
* runtime/transport/transport.c: Ditto.
* runtime/linux/autoconf-uidgid.c: New autoconf test.
* buildrun.cxx (compile_pass): Add STAPCONF_LINUX_UIDGID_H autoconf test.
* runtime/procfs.c: Include uidgid_compatibility.h.
* runtime/proc_fs_compatibility.h: Move KUIDT_INIT()/KGIDT_INIT() macros
  to uidgid_compatibility.h.
* runtime/transport/debugfs.c: Use KUIDT_INIT/KGIDT_INIT macros.
* runtime/transport/relay_v2.c: Ditto
* runtime/uidgid_compatibility.h: New file.

11 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
Lukas Berk [Fri, 31 May 2013 15:37:05 +0000 (11:37 -0400)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

11 years agoAdjust stapbm.in and docs to avoid recurssion
Lukas Berk [Fri, 31 May 2013 15:33:03 +0000 (11:33 -0400)]
Adjust stapbm.in and docs to avoid recurssion

*NEWS: added news blurb
*java/stapbm.in: due to change in tapset-method.cxx and only probing
 probe begin, we're able to remove java recursion gaurds
 and simply
*main/stapprobes.3stap: update docs reflecting requirement of jvm pid's
to be prexisting and if a string is passed for
process name, it needs to be listed in a jps -l
invocation
*tapset-method.cxx: switch process("java").begin probe to probe begin
    in order to avoid recurssion due to byteman operations

11 years agoFixed BZ920444 by using macros to handle nfs parameter changes.
David Smith [Fri, 31 May 2013 14:05:23 +0000 (09:05 -0500)]
Fixed BZ920444 by using macros to handle nfs parameter changes.

* tapset/linux/nfs_proc.stpm: New file.
* tapset/linux/nfs_proc.stp: Remove __i2n_ip_proto(),
  __nfs_read_data_info(), and __nfs_write_data_info() functions. Callers
  of those functions now use new macros in nfs_proc.stpm. The advantage
  the macros have, besides clarity, is that they preserve type
  information. Kernel commit 0b7c01533aa9f4a228d07d2768d084acb3a387bc
  changed the commit functions to take a nfs_commit_data structure instead
  of a nfs_write_data_structure. Because functions lose type information,
  systemtap didn't notice this change.

11 years agoFixed readability issues in tapset/linux/nfs_proc.stp. No actual code change.
David Smith [Thu, 30 May 2013 14:49:19 +0000 (09:49 -0500)]
Fixed readability issues in tapset/linux/nfs_proc.stp. No actual code change.

11 years agoDouble-check DW_AT_comp_dir before we try to use it
Josh Stone [Wed, 29 May 2013 20:52:58 +0000 (13:52 -0700)]
Double-check DW_AT_comp_dir before we try to use it

In building tracepoints, we try a late search for the kernel source tree
using DW_AT_comp_dir, and add extra includes based on that path.  That
comp_dir is not always reliable though; for instance, Ubuntu leaves it
something like "/build/buildd/linux...", which is not an installed path.

(See also http://brainstorm.ubuntu.com/idea/11327)

* tapsets.cxx (tracepoint_builder::init_dw): Verify that the given
  DW_AT_comp_dir actually exists before we use it.

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