]> sourceware.org Git - systemtap.git/log
systemtap.git
11 years agoPR14927: fix indentation and small compare() bug
Jonathan Lebon [Mon, 8 Jul 2013 18:18:15 +0000 (14:18 -0400)]
PR14927: fix indentation and small compare() bug

11 years agoPR14927: add new testcase color_parsing.exp
Jonathan Lebon [Fri, 5 Jul 2013 18:09:00 +0000 (14:09 -0400)]
PR14927: add new testcase color_parsing.exp

To make sure that the parser implemented for PR14927 is correct and
safe, this new testcase sets SYSTEMTAP_COLORS to various erroneous
values and verifies that both stap and staprun react accordingly.

11 years agoPR14927: make stap use same parser as staprun for consistency
Jonathan Lebon [Mon, 8 Jul 2013 15:34:15 +0000 (11:34 -0400)]
PR14927: make stap use same parser as staprun for consistency

In order to ensure that both stap and staprun react the same way to
various values of SYSTEMTAP_COLORS, the parsing method in staprun was
copied to replace the one in stap (with small C++ adjustments).

This will also allow us to test both stap and staprun using the same
test cases (see the next commit).

11 years agoPR14927: protect terminal from invalid vals in SYSTEMTAP_COLORS
Jonathan Lebon [Fri, 5 Jul 2013 18:26:48 +0000 (14:26 -0400)]
PR14927: protect terminal from invalid vals in SYSTEMTAP_COLORS

11 years agoPR14927: enable coloring for stap and staprun/io by default
Jonathan Lebon [Fri, 5 Jul 2013 17:25:10 +0000 (13:25 -0400)]
PR14927: enable coloring for stap and staprun/io by default

The default coloring mode was changed from 'never' to 'auto'.
Additionally, the terminal is now checked to make sure that it is not
dumb (i.e. it understands ANSI codes). Finally, to make sure that the
color sequences don't affect the testsuite, the latter was changed to
impersonate a dumb terminal.

11 years agomake STP_OOB_DATA treatment more stringent
Jonathan Lebon [Thu, 4 Jul 2013 20:55:28 +0000 (16:55 -0400)]
make STP_OOB_DATA treatment more stringent

Since all STP_OOB_DATA originally comes from _stp_vlog() in
runtime/linux/io.c, we can be sure that all warnings will be prefixed
by "WARNING: " and all errors by "ERROR: ", as defined by WARN_STRING
ERR_STRING in io.c.

Therefore, we can be more stringent in control.c and mainloop.c in the
way we identify warnings and errors. Additionally, warnings can instead
use the warn() macro and errors the err() macro so that they benefit
from coloring.

The main effect of this patch is that all calls to _stp_warn() and
_stp_error() will be colored upon reception by stapio.

11 years agoPR14927: adjust testsuite for staprun/io string changes
Jonathan Lebon [Thu, 4 Jul 2013 14:24:08 +0000 (10:24 -0400)]
PR14927: adjust testsuite for staprun/io string changes

11 years agoPR14927: change wording in some call sites to err() and perr()
Jonathan Lebon [Tue, 2 Jul 2013 20:33:30 +0000 (16:33 -0400)]
PR14927: change wording in some call sites to err() and perr()

Following the changes from the previous commit, all calls to err() and
perr() were checked so that they were consistent with the prefix
"ERROR:" added by those macros.

Where err() was used to report non-critical information, it was
replaced by eprintf(), and where it was used for warnings, it was
replaced by the warn() macro.

11 years agoPR14927: add parsing of SYSTEMTAP_COLORS
Jonathan Lebon [Tue, 2 Jul 2013 20:29:51 +0000 (16:29 -0400)]
PR14927: add parsing of SYSTEMTAP_COLORS

Add the parse_stap_color() function to parse out the color sequence of
wanted string types from SYSTEMTAP_COLORS.

11 years agoPR14927: remember original color mode to pass to staprun
Jonathan Lebon [Wed, 3 Jul 2013 15:26:50 +0000 (11:26 -0400)]
PR14927: remember original color mode to pass to staprun

11 years agoPR14927: add -C switch for color in staprun/io
Jonathan Lebon [Tue, 2 Jul 2013 15:04:36 +0000 (11:04 -0400)]
PR14927: add -C switch for color in staprun/io

Also make stap send the -C switch if itself it was called with --color.
As opposed to the --color switch of stap, the WHEN argument was made
mandatory here so that it's consistent with the others, and it doesn't
conflict with the MODULE argument (and users don't have to resort to
using e.g. '-Cauto').

A few formatting fixes in the staprun manual page.

11 years agoPR14927: tweak message coloring logic to simplify
Frank Ch. Eigler [Sat, 29 Jun 2013 23:05:47 +0000 (19:05 -0400)]
PR14927: tweak message coloring logic to simplify

... but whoops, the code is now more c++-y.  For use in
staprun/stapio/stapdyn, it'll need c-ificiation again.

11 years agoPR14927: parse SYSTEMTAP_COLOR on-the-fly
Jonathan Lebon [Fri, 28 Jun 2013 15:55:03 +0000 (11:55 -0400)]
PR14927: parse SYSTEMTAP_COLOR on-the-fly

Colors are no longer stored in memory. Instead, upon each request to
colorize(), the SYSTEMTAP_COLOR env var is parsed and queried for the
value of the key of interest.

This allows colorize() and parse_stap_color() to be more self-contained
and easier to eventually port to other parts of SystemTap, such as
staprun/io.

11 years agoFix 'buildok' testsuite failures on ia32.
David Smith [Fri, 28 Jun 2013 15:18:14 +0000 (10:18 -0500)]
Fix 'buildok' testsuite failures on ia32.

* testsuite/buildok/nd_syscalls-detailed.stp: Mark 'compat' probe alias
  tests as optional, so test will pass on ia32.
* testsuite/buildok/nd_syscalls2-detailed.stp: Dito.
* testsuite/buildok/syscalls-detailed.stp: Ditto.

11 years agoPR14927: enable support for SYSTEMTAP_COLORS env var
Jonathan Lebon [Fri, 28 Jun 2013 13:47:55 +0000 (09:47 -0400)]
PR14927: enable support for SYSTEMTAP_COLORS env var

The new SYSTEMTAP_COLORS environment variable allows users to customize
colors. See the updated man page for more info on the syntax and
behaviour of this new env var.

11 years agoPR14927: elaborate.cxx: change a warning to use print_token()
Jonathan Lebon [Tue, 25 Jun 2013 19:06:41 +0000 (15:06 -0400)]
PR14927: elaborate.cxx: change a warning to use print_token()

To be more consistent with other print_warning() calls in the file,
this warning was changed to use its second overloaded form, in which
the token is given as the second argument. This has for effect to allow
proper pretty printing of the token using print_token(), thus making
sure that the path is not repeated and that output is coloured if
necessary.

11 years agoPR14927: add colorize() functions and colorization mechanism
Jonathan Lebon [Fri, 28 Jun 2013 13:15:08 +0000 (09:15 -0400)]
PR14927: add colorize() functions and colorization mechanism

Added colorization of the following elements:
- Error type (e.g. 'semantic error')
- Source location (e.g. '<input>:1:7')
- Caret ('^')
- Token (the one above the caret)

11 years agoPR14927: lay groundwork for colors
Jonathan Lebon [Fri, 21 Jun 2013 15:34:47 +0000 (11:34 -0400)]
PR14927: lay groundwork for colors

Created a new command-line option '--color' which is capable of taking
in an argument as well. Added a new member 'color_errors' to the
systemtap_session class which gets set upon treating the new switch's
logic. Also created an entry in the man page.

11 years agoPR14927: move parser::print_error() to systemtap_session
Jonathan Lebon [Mon, 24 Jun 2013 18:05:42 +0000 (14:05 -0400)]
PR14927: move parser::print_error() to systemtap_session

The parser::print_error() method was moved from the parser class to the
systemtap_session class in anticipation for colorization. The session
class previously already took care of error printing, except for parser
errors. Making all the error-printing methods part of the same class
will simplify the implementation of colorization.

11 years agoUse explicit sys_utimes functions for at_var.exp
Josh Stone [Fri, 28 Jun 2013 03:01:53 +0000 (20:01 -0700)]
Use explicit sys_utimes functions for at_var.exp

This test wants to access a typed $utimes variable, but on architectures
with HAVE_SYSCALL_WRAPPERS the main sys_utimes has all long arguments.
And starting in 3.10, all archs have syscall wrappers, yay!  For this
test's purposes, it's perfectly fine to use the inline SYSC_utimes where
that exists.

11 years agolinux tapset: new guru-only function raise() to send a signal to current task
Frank Ch. Eigler [Fri, 28 Jun 2013 01:51:40 +0000 (21:51 -0400)]
linux tapset: new guru-only function raise() to send a signal to current task

11 years agoAUTHORS bump
Josh Stone [Fri, 28 Jun 2013 01:28:04 +0000 (18:28 -0700)]
AUTHORS bump

11 years agoPR15688: Set pragma:vma when dwflpp uses _stp_umodule_relocate
Josh Stone [Thu, 27 Jun 2013 22:39:19 +0000 (15:39 -0700)]
PR15688: Set pragma:vma when dwflpp uses _stp_umodule_relocate

* dwflpp.cxx (dwflpp::emit_address): Use pragma:vma when needed, rather
  than trying to enable_task_finder.  This also leaves the opportunity
  for this generated code to be optimized out, such that vma-tracking
  may not be needed after all.
* elaborate.cxx (embeddedcode_info::visit_embeddedcode): Before enabling
  the vma-tracker, check if runtime=dyninst for PR15052.  This turns an
  ugly pass-4 failure into a nicer pass-2 message.
* session.cxx (systemtap_session::parse_cmdline): Don't force vma here
  for userspace -d modules; dwflpp will add pragma:vma as needed.
* tapsets.cxx (dwarf_atvar_expanding_visitor::visit_atvar_op): Don't
  enable_vma_tracker manually; dwflpp will add pragma:vma as needed.
* testsuite/systemtap.base/sdt_global_var.exp: Clear this setup_kfail.

11 years agoPR11096: Add support for the "module" argument to @var
Yichun Zhang (agentzh) [Sat, 15 Jun 2013 00:44:00 +0000 (17:44 -0700)]
PR11096: Add support for the "module" argument to @var

The notation @var("varname@cuname", "module") is now supported and @var
can thus effectively be used almost everywhere like the context of stap
functions, probe timer.profile, and probe kernel.trace().

Just like @cast, multiple module names can be specified by separating
them with ":", for example, "module1:module2:module3". And they will be
attempted in turn until a match is found.

Refactored the code by introducing atvar_op as suggested by Josh Stone
to make the implementation cleaner. The fields "target_name" and
"cu_name" have been moved from target_symbol to its subclass atvar_op.

@var now searches all the CUs that matches the "cuname" specified for the
variable. And when "cuname" is missing, @var just searches all the CUs.

Accessing global variables in PIE and DSO via @var with either "cuname"
or "module" now mostly works for the default (kernel) runtime (but note
PR15688).

Thanks Josh Stone for reviewing this patch and providing a lot of
invaluable suggestions.

* parse.cxx: Add support for the optional "module" parameter to the
  parser.
* staptree.h: Remove the "target_name" field from target_symbol and make
  sym_name() virtual. Define atvar_op which inherits target_symbol. Add
  method visit_atvar_op to the visitor classes.
* staptree.cxx: Define visit_atvar_op for the visitor classes. Define
  methods of atvar_op.
* tapsets.cxx: Define visit_atvar_op for dwarf_var_expanding_visitor,
  sdt_uprobe_var_expanding_visitor, and
  tracepoint_var_expanding_visitor. Define dwarf_atvar_expanding_visitor
  to run in series with dwarf_cast_expanding_visitor in
  dwarf_derived_probe. Add dwarf_atvar_query to handle the DWARF queres
  of dwarf_atvar_expanding_visitor. Postpone the processing of @var with
  either cu name or module name or both to dwarf_atvar_expanding_visitor
  in order to eliminate code duplication.
* elaborate.h: Declare visit_atvar_op for typeresolution_info.
  void_statement_reducer.
* elaborate.cxx: Define visit_atvar_op for symbol_fetcher,
  typeresolution_info, and void_statement_reducer.
* translate.cxx: Define visit_atvar_op for c_unparser.
* testsuite/systemtap.base/: Add many more test cases for @var.

Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
11 years agoFixed PR15690 by fixing 32-bit {nd_}syscall.rt_sigprocmask probe alias.
David Smith [Thu, 27 Jun 2013 17:21:39 +0000 (12:21 -0500)]
Fixed PR15690 by fixing 32-bit {nd_}syscall.rt_sigprocmask probe alias.

* tapset/linux/syscalls2.stp: Split 'rt_sigprocmask' alias into
  'rt_sigprocmask' and 'compat_rt_sigprocmask'.
* tapset/linux/nd_syscalls2.stp: Ditto.
* tapset/linux/aux_syscalls.stp (sigset_from_compat): New C function for
  use when the real function isn't exported.
  (_stp_compat_sigset_u): New tapset function.
* buildrun.cxx (compile_pass): Add "sigset_from_compat" export test.
* testsuite/buildok/syscalls2-detailed.stp: Added 'compat_rt_sigprocmask'
  test.
* testsuite/buildok/nd_syscalls2-detailed.stp: Ditto.

11 years agofix umodname()-related issues in testsuite
Jonathan Lebon [Thu, 27 Jun 2013 15:35:33 +0000 (11:35 -0400)]
fix umodname()-related issues in testsuite

In vma_vdso.stp, calling umodname() alone was getting elided because of
the /* pure */ marker present. The test was modified so that the value
of umodname() is used (even though the if branch will never be taken).

In usymbols.exp and pf3.stp, wrapped umodname() and modname() calls
between try/catch blocks.

Reported-by: Mark Wielaard <mjw@redhat.com>
11 years agoUpdate regexps in 2 syscall testsuite testcases.
David Smith [Thu, 27 Jun 2013 16:27:13 +0000 (11:27 -0500)]
Update regexps in 2 syscall testsuite testcases.

* testsuite/systemtap.syscall/swap.c: Minor update to testcase regexp.
* testsuite/systemtap.syscall/unlink.c: Ditto.

11 years agosystemtap.spec: use %{_tmpfilesdir} vice /usr/lib/tmpfiles.d
Frank Ch. Eigler [Thu, 27 Jun 2013 14:54:08 +0000 (10:54 -0400)]
systemtap.spec: use %{_tmpfilesdir} vice /usr/lib/tmpfiles.d

11 years agoWhen configuring --with-elfutils use elfutils configure --enable-dwz.
Mark Wielaard [Thu, 27 Jun 2013 09:48:15 +0000 (05:48 -0400)]
When configuring --with-elfutils use elfutils configure --enable-dwz.

Just add the configure option unconditionally. It will be ignored
with older elfutils releases with an harmless warning.
configure: WARNING: unrecognized options: --enable-dwz

11 years ago_stp_mkdir_proc_module: mark proc_root_name static. Reduce frame size.
Mark Wielaard [Wed, 26 Jun 2013 19:01:17 +0000 (21:01 +0200)]
_stp_mkdir_proc_module: mark proc_root_name static. Reduce frame size.

11 years agoNEWS: add a udp.stp blurb
Frank Ch. Eigler [Wed, 26 Jun 2013 18:32:28 +0000 (14:32 -0400)]
NEWS: add a udp.stp blurb

11 years agosystemtap.spec: let -testsuite require -runtime-java to ensure running those tests
Frank Ch. Eigler [Wed, 26 Jun 2013 18:21:28 +0000 (14:21 -0400)]
systemtap.spec: let -testsuite require -runtime-java to ensure running those tests

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.

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