]> sourceware.org Git - systemtap.git/log
systemtap.git
12 years agoTweak relative git_version.h rules
Josh Stone [Thu, 2 Aug 2012 20:15:47 +0000 (13:15 -0700)]
Tweak relative git_version.h rules

12 years agoMerge branch 'master' of git://sourceware.org/git/systemtap
Josh Stone [Thu, 2 Aug 2012 19:57:23 +0000 (12:57 -0700)]
Merge branch 'master' of git://sourceware.org/git/systemtap

12 years agoPR14180: Fix tapset documentation for non-root tapsets
Josh Stone [Thu, 2 Aug 2012 19:38:27 +0000 (12:38 -0700)]
PR14180: Fix tapset documentation for non-root tapsets

* doc/SystemTap_Tapset_Reference/manpager: Use basenames so we can deal
  with tapsets that are from a subdirectory, like tapset/linux/.
* doc/SystemTap_Tapset_Reference/tapsets.tmpl: Update !I paths for the
  many tapsets that moved in commit d3110553.
* tapset/linux/context.stp: Defer <tapsetdescription> to tapset/context.stp

12 years agomanpager: indent loops
Josh Stone [Thu, 2 Aug 2012 18:58:33 +0000 (11:58 -0700)]
manpager: indent loops

12 years agoAdd tests for missing build id sections (for PR14407).
David Smith [Thu, 2 Aug 2012 18:35:48 +0000 (13:35 -0500)]
Add tests for missing build id sections (for PR14407).

* testsuite/systemtap.base/buildid.exp: Test removing the build id section
  from a target executable and shared library.

12 years agoPR11207: search tapset folders for .stpm files.
Serguei Makarov [Thu, 2 Aug 2012 18:04:40 +0000 (14:04 -0400)]
PR11207: search tapset folders for .stpm files.

Gathers a list of .stpm (library) files on the tapset search
path. In this patch, an index of the paths is gathered in
session.library_macro_paths, but the list is not made use of by the
preprocessor.

12 years agostapdyn & staprun: Use the top-level git_version.h
Josh Stone [Thu, 2 Aug 2012 17:55:57 +0000 (10:55 -0700)]
stapdyn & staprun: Use the top-level git_version.h

Yo dawg, I herd you like Makefile recursion, so I put some recursion in
your recursion so you can version while you version.

Less duplication + more recursion == win?  Another option is to flatten
stapdyn and staprun Makefiles altogether into the root Makefile, but for
now, this is less invasive.

Changing the includes to ../git_version.h is not strictly necessary,
since we also have "-I..", but this way developers won't get burned by
old git_version.h files sitting in staprun/ or stapdyn/.

12 years agoPR11207: install .stpm files into tapset folders.
Serguei Makarov [Thu, 2 Aug 2012 17:39:40 +0000 (13:39 -0400)]
PR11207: install .stpm files into tapset folders.

12 years agoPR14378: Better @entry squashing in kprobe.function
Josh Stone [Thu, 2 Aug 2012 17:24:42 +0000 (10:24 -0700)]
PR14378: Better @entry squashing in kprobe.function

@entry is only valid in .return, but kprobe_var_expanding_visitor was
expanding it blindly.  Then kprobe_derived_probe was failing its
assertion that add_call_probe only happens with has_return.  So the test
semko/entry04.stp was failing as it should, but rather ungracefully with
an "Assertion `has_return' failed" abort.

* tapsets.cxx (kprobe_var_expanding_visitor): Add a has_return member so
  we know our current context.
  (kprobe_var_expanding_visitor::visit_entry_op): Guard @entry expansion
  on has_return, the same way dwarf_var_expanding_visitor does.

12 years agostapdyn: Add -V option for version/copyright info
Josh Stone [Thu, 2 Aug 2012 16:36:33 +0000 (09:36 -0700)]
stapdyn: Add -V option for version/copyright info

* stapdyn/Makefile.am: Add git_version.h.
* stapdyn/Makefile.in: Regenerate.
* stapdyn/stapdyn.cxx (main): Hey buddy, here's your version.

12 years agoFixed PR14409 by delaying inode-uprobes registration until after buildid checks.
David Smith [Thu, 2 Aug 2012 15:46:14 +0000 (10:46 -0500)]
Fixed PR14409 by delaying inode-uprobes registration until after buildid checks.

* runtime/linux/uprobes-inode.c: Rework code to do the buildid check
  before registering uprobes the first time we see a target process.

12 years agoFixed PR14427 by handling old and new task_work interface.
David Smith [Thu, 2 Aug 2012 15:01:23 +0000 (10:01 -0500)]
Fixed PR14427 by handling old and new task_work interface.

* runtime/linux/autoconf-utrace-via-tracepoints.c: Just includes
  task_work.h to determine existence of task_work feature.
* runtime/linux/autoconf-task_work-struct.c: New file.
* buildrun.cxx (compile_pass): Add autoconf-task_work-struct test.
* runtime/linux/task_work_compatibility.h: New header that mask
  differences between old task_work interface and new one.
* runtime/linux/task_finder2.c: Handle removal of 'data' parameter from
  task_work struct by embedding stap_task_finder_target in
  __stp_tf_task_work structure.
* runtime/stp_task_work.c: Include task_work_compatibility.h instead of
  task_work.h.
* runtime/stp_utrace.c (utrace_task_alloc): Update init_task_work()
  function call to compatibility function call.

12 years agoPR14429: only grumble quietly about preexisting gid/uid conflicts in .spec
Frank Ch. Eigler [Thu, 2 Aug 2012 14:24:18 +0000 (10:24 -0400)]
PR14429: only grumble quietly about preexisting gid/uid conflicts in .spec

12 years agoconfigury: add --with-extra-version=STRING option
Frank Ch. Eigler [Thu, 2 Aug 2012 14:12:50 +0000 (10:12 -0400)]
configury: add --with-extra-version=STRING option

This is to allow prerelease or other special builds to tag
stap -V / staprun -V outputs with an extra version string.

* configure.ac (with_extra_version): Add option.
* session.cxx (session::version), staprun (parse_args): Print them.
  Hey buddy, what about stapdyn?
* configure, config.in: Regenerated.

12 years agoPR14180: Doing the tapset shuffle!
Josh Stone [Thu, 2 Aug 2012 02:26:01 +0000 (19:26 -0700)]
PR14180: Doing the tapset shuffle!

Many tapsets are kernel-specific, with no applicability at all
from userspace.  These have all been moved to tapset/linux/.

Some tapsets could be widely applicable, but are implemented with
kernel-specific APIs.  These have been moved to tapset/linux/, and
reimplemented in tapset/dyninst/ too.

Some tapsets are generic utility functions, that don't care at
all where they're run from.  These have been left in place.

12 years agoansi.stp: fix a couple sfunction names
Josh Stone [Wed, 1 Aug 2012 22:33:43 +0000 (15:33 -0700)]
ansi.stp: fix a couple sfunction names

12 years agostap-report: include buildtime/buildhost in the rpm listing
Frank Ch. Eigler [Wed, 1 Aug 2012 20:15:15 +0000 (16:15 -0400)]
stap-report: include buildtime/buildhost in the rpm listing

12 years agoAdd explicit build-id grep from vmlinux and debuginfo to stap-report.
Mark Wielaard [Wed, 1 Aug 2012 19:48:16 +0000 (21:48 +0200)]
Add explicit build-id grep from vmlinux and debuginfo to stap-report.

12 years agoPR11207 groundwork: fix major oops in commit e7c60c35d
Serguei Makarov [Wed, 1 Aug 2012 15:45:31 +0000 (11:45 -0400)]
PR11207 groundwork: fix major oops in commit e7c60c35d

12 years agoMake the buildid.exp testcase more robust with better error checking.
David Smith [Wed, 1 Aug 2012 14:42:47 +0000 (09:42 -0500)]
Make the buildid.exp testcase more robust with better error checking.

12 years agoPR14425: restore dummy stapfuncs.3stap man page
Frank Ch. Eigler [Wed, 1 Aug 2012 14:35:31 +0000 (10:35 -0400)]
PR14425: restore dummy stapfuncs.3stap man page

* stapfuncs.3stap: It's back, mostly blank.
* stap.1: Mention function::* etc.
* stapex.3stap: Refer to the web site examples too.

12 years agoPR11207 groundwork: swap pass 1a and 1b as groundwork for .stpm library macro loading.
Serguei Makarov [Tue, 31 Jul 2012 19:00:47 +0000 (15:00 -0400)]
PR11207 groundwork: swap pass 1a and 1b as groundwork for .stpm library macro loading.

12 years agoNote possibility of error recovery for preprocessor %( %) constructs.
Serguei Makarov [Tue, 31 Jul 2012 15:33:04 +0000 (11:33 -0400)]
Note possibility of error recovery for preprocessor %( %) constructs.

12 years agoPR11207: vary macro error string depending on def'n signature.
Serguei Makarov [Tue, 31 Jul 2012 13:29:07 +0000 (09:29 -0400)]
PR11207: vary macro error string depending on def'n signature.

Prints either "expected '%('" or "expected '%(' or '('" as makes sense.

12 years agoRange-check _fildes_index_u and test it
Josh Stone [Tue, 31 Jul 2012 02:56:18 +0000 (19:56 -0700)]
Range-check _fildes_index_u and test it

* tapset/linux/aux_syscalls.stp: Make sure the index is 0 or 1.
* testsuite/buildok/aux_syscalls-embedded.stp: Test _fildes_index_u()
  rather than the old, removed _fildes_u().

12 years agoPR14180: Move all syscall tapsets to linux/
Josh Stone [Tue, 31 Jul 2012 02:34:43 +0000 (19:34 -0700)]
PR14180: Move all syscall tapsets to linux/

Moving basically all *syscall*.stp into tapset/linux/. These are all
implemented from a kernel assumption, using either kernel.function or
kprobe.function, and the supporting functions also assume that they're
being called from a kernel environment.

12 years agoPR14180: Search for tapset in additional backend-specific paths
Josh Stone [Tue, 31 Jul 2012 00:34:02 +0000 (17:34 -0700)]
PR14180: Search for tapset in additional backend-specific paths

We already search paths in many combinations of kernel version and arch.
For each of these, search also in runtime-specific prefixes, "linux/..."
for kernel mode, and "dyninst/..." for dyninst mode.  (And while we're
at it, only do kernel versioning for kernel mode.)

12 years agoPR11207: Add a space to a macro error string
Josh Stone [Mon, 30 Jul 2012 18:43:00 +0000 (11:43 -0700)]
PR11207: Add a space to a macro error string

12 years agoPR11207: fix segfault in macro invocation parser.
Serguei Makarov [Mon, 30 Jul 2012 18:38:27 +0000 (14:38 -0400)]
PR11207: fix segfault in macro invocation parser.

12 years agoRevert "PR11207: testsuite for oneline macros feature."
Serguei Makarov [Mon, 30 Jul 2012 18:36:26 +0000 (14:36 -0400)]
Revert "PR11207: testsuite for oneline macros feature."

This reverts commit 05b137ec05922db854429770f96ce6a4a1501347.

12 years agoRevert "PR11207: support for one-line @define in macroprocessor."
Serguei Makarov [Mon, 30 Jul 2012 18:36:15 +0000 (14:36 -0400)]
Revert "PR11207: support for one-line @define in macroprocessor."

This reverts commit 2a82bed6eced5bd3634acd82eb440d46ab8206f4.

12 years agoPR11207: support for one-line @define in macroprocessor.
Serguei Makarov [Mon, 30 Jul 2012 15:18:16 +0000 (11:18 -0400)]
PR11207: support for one-line @define in macroprocessor.

Current logic for determining whether to grab a one-line or
a multi-line macro is a bit hairy but well-tested. May go through
it later with a fresh eye to streamline at least the explanatory
comments.

12 years agoPR11207: testsuite for oneline macros feature.
Serguei Makarov [Mon, 30 Jul 2012 15:16:38 +0000 (11:16 -0400)]
PR11207: testsuite for oneline macros feature.

12 years agostap-report: set $PATH, tolerate failures better
Frank Ch. Eigler [Mon, 30 Jul 2012 14:01:45 +0000 (10:01 -0400)]
stap-report: set $PATH, tolerate failures better

12 years agoparse: Separate "empty or missing" file errors
Josh Stone [Sat, 28 Jul 2012 16:55:10 +0000 (09:55 -0700)]
parse: Separate "empty or missing" file errors

... especially since there's a third state too: unreadable.

* parse.cxx (parser::parser): Consolidate to a single ctor.
  (parse<istream>): Synthesize the name "<input>" to the parser from here.
  (parse<filename>): Open the file first, check its status, and if good
  only then pass the name and ifstream to the parser.
  (parser::parse): Now here the file is never missing, just empty.

12 years agostapdyn: Try to autodetect DYNINSTAPI_RT_LIB
Josh Stone [Fri, 27 Jul 2012 21:30:31 +0000 (14:30 -0700)]
stapdyn: Try to autodetect DYNINSTAPI_RT_LIB

* stapdyn/dynutil.cxx (check_dyninst_rt): New file; Check that env
  DYNINSTAPI_RT_LIB is well set, else guess a good value for it.
* stapdyn/stapdyn.cxx (main): Call check_dyninst_rt().
* stapdyn/dynsdt.cxx (main): Ditto.
* stapdyn/Makefile.am: Build dynutil.cxx and ../util.cxx.
* stapdyn/Makefile.in: Regenerate.

12 years agostapdyn: Build dyninst targets in their own subdirectory
Josh Stone [Fri, 27 Jul 2012 19:40:04 +0000 (12:40 -0700)]
stapdyn: Build dyninst targets in their own subdirectory

* Makefile.am: Remove dyninst targets; add stapdyn/ to SUBDIRS.
* stapdyn/Makefile.am: Add dyninst targets. (base copied from staprun.)
* configure.ac: Process stapdyn/Makefile.
* run-stap.in: Adapt to stapdyn's new location.

* stapdyn/Makefile.in: Generate.
* Makefile.in, configure: Regenerate.

12 years agostapdyn: Use PRIx64 when printing GElf_Addr (uint64_t)
Josh Stone [Fri, 27 Jul 2012 19:18:25 +0000 (12:18 -0700)]
stapdyn: Use PRIx64 when printing GElf_Addr (uint64_t)

12 years agoPR11207: correctly initialize lexer::saw_tokens.
Serguei Makarov [Fri, 27 Jul 2012 19:10:38 +0000 (15:10 -0400)]
PR11207: correctly initialize lexer::saw_tokens.

12 years agoDyninst compile fixes for 32-bit systems.
David Smith [Fri, 27 Jul 2012 17:54:54 +0000 (12:54 -0500)]
Dyninst compile fixes for 32-bit systems.

* stapdyn/dynsdt.cxx (find_sdt): Fix printf types for 64-bit longs.
  (instrument_sdt): Ditto.
* stapdyn/stapdyn.cxx (instrument_uprobes): Change type from 'uint64' to
  'int64', since there are only signed 64-bit long BPatch_constExpr
  constructors.

12 years agostapdyn: Use an explicit BINDIR path to stapdyn
Josh Stone [Fri, 27 Jul 2012 17:45:36 +0000 (10:45 -0700)]
stapdyn: Use an explicit BINDIR path to stapdyn

12 years agoAdded include path to be able to compile for ARM.
Torsten Polle [Thu, 26 Jul 2012 18:40:12 +0000 (20:40 +0200)]
Added include path to be able to compile for ARM.

Compiling a script against a 3.4 ARM kerne with uprobes support results in a
compile error because struct linux_binprm is not defined. Including
linux/binfmts.h fixes the issue.

Signed-off-by: Torsten Polle <Torsten.Polle@gmx.de>
12 years agoPR14360: support old behaviour with --compatible.
Serguei Makarov [Thu, 26 Jul 2012 19:01:01 +0000 (15:01 -0400)]
PR14360: support old behaviour with --compatible.

12 years agoPR14360: document string literal concatenation in language reference.
Serguei Makarov [Thu, 26 Jul 2012 18:00:30 +0000 (14:00 -0400)]
PR14360: document string literal concatenation in language reference.

12 years agoPR11210: NEWS entry for alias suffixes feature.
Serguei Makarov [Thu, 26 Jul 2012 16:14:34 +0000 (12:14 -0400)]
PR11210: NEWS entry for alias suffixes feature.

12 years agoPR12210: couple additional recursive-expansion tests for semko.
Serguei Makarov [Thu, 26 Jul 2012 15:57:46 +0000 (11:57 -0400)]
PR12210: couple additional recursive-expansion tests for semko.

12 years agoFix permissions for testsuite/parseko/at_operators.stp.
Serguei Makarov [Thu, 26 Jul 2012 15:56:05 +0000 (11:56 -0400)]
Fix permissions for testsuite/parseko/at_operators.stp.

12 years agoStarting to populate NEWS -- describe string gluing change due to PR14360.
Serguei Makarov [Thu, 26 Jul 2012 15:54:05 +0000 (11:54 -0400)]
Starting to populate NEWS -- describe string gluing change due to PR14360.

12 years agoPR11207: initial implementation of macros (definitions visible in same file).
Serguei Makarov [Thu, 26 Jul 2012 15:02:42 +0000 (11:02 -0400)]
PR11207: initial implementation of macros (definitions visible in same file).

This patch augments systemtap's preprocessor with a simple macro facility,
as follows:

@define add(a,b) %( ((@a)+(@b)) %)
x = add(2,2)

Further details are available in the comments on the preprocessor code,
or in the proposal posted earlier on the mailing list.

12 years agoPR11207: initial testsuite for macro feature.
Serguei Makarov [Thu, 26 Jul 2012 15:00:01 +0000 (11:00 -0400)]
PR11207: initial testsuite for macro feature.

12 years agostapdyn: Don't check groups for --runtime=dyninst
Josh Stone [Tue, 24 Jul 2012 22:02:13 +0000 (15:02 -0700)]
stapdyn: Don't check groups for --runtime=dyninst

We don't need to assert stapdev/stapusr group membership for the dyninst
mode, as users are simply allowed to probe anything ptrace-able.  The
groups only apply to our kernel runtime.

12 years agoExplain add_block_tid and add_call_probe_tid
Josh Stone [Tue, 24 Jul 2012 21:07:30 +0000 (14:07 -0700)]
Explain add_block_tid and add_call_probe_tid

Commit 8cc799a5d mentioned their need, but it should be commented.

12 years agotapset/registers.stp: drop inadverdent / incomplete kerneldoc for __asmlinkage_int_arg
Frank Ch. Eigler [Tue, 24 Jul 2012 20:29:17 +0000 (16:29 -0400)]
tapset/registers.stp: drop inadverdent / incomplete kerneldoc for __asmlinkage_int_arg

12 years agoFixed PR14394 by adding compat_sys_sigprocmask() support.
David Smith [Tue, 24 Jul 2012 19:53:33 +0000 (14:53 -0500)]
Fixed PR14394 by adding compat_sys_sigprocmask() support.

* tapset/syscalls2.stp: Add compat_sys_sigprocmask() support.
* tapset/nd_syscalls2.stp: Ditto.

12 years agoMore PR13455 (signalfd/compat_signalfd support in nd_syscalls2.stp) fixes.
David Smith [Tue, 24 Jul 2012 14:54:51 +0000 (09:54 -0500)]
More PR13455 (signalfd/compat_signalfd support in nd_syscalls2.stp) fixes.

* tapset/nd_syscalls2.stp: Fix nd_syscall.compat_signalfd probe
  alias. Also fixed a dwarf variable reference in the
  __nd_syscall.compat_signalfd4 probe alias.

12 years agoFixed nd_syscall.sigaction32.return.
David Smith [Tue, 24 Jul 2012 13:36:30 +0000 (08:36 -0500)]
Fixed nd_syscall.sigaction32.return.

* tapset/nd_syscalls2.stp: Fix nd_syscall.sigaction32.return to add the
  missing '.return' to the probe alias.

12 years agoFixed PR13454 by updating pipe/pipe2 support in nd_syscalls.stp.
David Smith [Tue, 24 Jul 2012 13:13:56 +0000 (08:13 -0500)]
Fixed PR13454 by updating pipe/pipe2 support in nd_syscalls.stp.

* tapset/aux_syscalls.stp (_fildes_index_u): Renamed from _fildes_u() and
  reworked to return pipe fd values (instead of a string).
* tapset/nd_syscalls2.stp: Updated nd_syscall.pipe probe alias to handle
  sys_pipe2().
* testsuite/systemtap.syscall/nd_syscall.exp (syscall_kfails): Removed
  kfail for pipe test.

12 years agostapdyn: update configury for newer dyninst master
Josh Stone [Mon, 23 Jul 2012 22:28:48 +0000 (15:28 -0700)]
stapdyn: update configury for newer dyninst master

- Dyninst install path now uses plain $prefix/lib
- More libraries are now required in linking

12 years agostapdyn: include limits.h for PATH_MAX
Josh Stone [Mon, 23 Jul 2012 19:31:05 +0000 (15:31 -0400)]
stapdyn: include limits.h for PATH_MAX

12 years agoMerge branch 'jistone/stapdyn'
Josh Stone [Mon, 23 Jul 2012 21:56:54 +0000 (14:56 -0700)]
Merge branch 'jistone/stapdyn'

12 years agoFix @operator parsing -- special print(@hist_op(...)) case
Serguei Makarov [Mon, 23 Jul 2012 21:49:10 +0000 (17:49 -0400)]
Fix @operator parsing -- special print(@hist_op(...)) case

12 years agoAnother PR13456 fix by removing the kfail.
David Smith [Mon, 23 Jul 2012 19:39:07 +0000 (14:39 -0500)]
Another PR13456 fix by removing the kfail.

* testsuite/systemtap.syscall/nd_syscall.exp (syscall_kfails): Removed
  kfail for poll test.

12 years agoFixed PR13455 by updating signalfd/compat_signalfd support in nd_syscalls2.stp.
David Smith [Mon, 23 Jul 2012 19:20:38 +0000 (14:20 -0500)]
Fixed PR13455 by updating signalfd/compat_signalfd support in nd_syscalls2.stp.

* tapset/nd_syscalls2.stp: Updated nd_syscall.signalfd probe alias to
  handle sys_signalfd4().  Updated nd_syscall.compat_signalfd probe alias
  to handle compat_sys_signalfd4().
* testsuite/systemtap.syscall/nd_syscall.exp (syscall_kfails): Removed
  kfail for signalfd test.

12 years agoSmall fix to syscalls2.stp.
David Smith [Mon, 23 Jul 2012 19:15:38 +0000 (14:15 -0500)]
Small fix to syscalls2.stp.

* tapset/syscalls2.stp: Make syscall.compat_signalfd.return probe alias
  match syscall.compat_signalfd probe alias.

12 years agoFix use of 'kernel.function' in nd_syscalls2.stp.
David Smith [Mon, 23 Jul 2012 19:12:56 +0000 (14:12 -0500)]
Fix use of 'kernel.function' in nd_syscalls2.stp.

* tapset/nd_syscalls2.stp: Fix the nd_syscall.compat_pselect7 probe alias
  using 'kernel.function' instead of 'kprobe.function'.

12 years agostap-report: also report kernel+module build-ids
Frank Ch. Eigler [Mon, 23 Jul 2012 19:03:04 +0000 (15:03 -0400)]
stap-report: also report kernel+module build-ids

12 years agoAnother PR11424 fix: For ppc64, map ".sys_foo" to "sys_foo".
David Smith [Mon, 23 Jul 2012 18:30:31 +0000 (13:30 -0500)]
Another PR11424 fix: For ppc64, map ".sys_foo" to "sys_foo".

* tapsets.cxx (load_function_name_cache): For ppc64, map ".sys_foo"
  symbols to "sys_foo".

12 years agoCleanup comments, consistent use of 'atword' terminology.
Serguei Makarov [Mon, 23 Jul 2012 17:54:40 +0000 (13:54 -0400)]
Cleanup comments, consistent use of 'atword' terminology.

12 years agoPR11207 groundwork: lexer::scan() produces tok_junk instead of throwing errors.
Serguei Makarov [Mon, 23 Jul 2012 16:30:46 +0000 (12:30 -0400)]
PR11207 groundwork: lexer::scan() produces tok_junk instead of throwing errors.

Handling parse_errors at scan time would get too complicated when there's
a preprocessing stage between the lexer and parser (and it's no longer
clear whether a given token will be used). Hence we produce specially marked
tok_junk which store a message to use when the token is encountered at
print_error() time.

12 years agoPR11207 groundwork: add a list of @words to check macro names against.
Serguei Makarov [Mon, 23 Jul 2012 13:41:50 +0000 (09:41 -0400)]
PR11207 groundwork: add a list of @words to check macro names against.

12 years agoconfigure: look for distro-installed dyninst too
Josh Stone [Sat, 21 Jul 2012 01:20:37 +0000 (18:20 -0700)]
configure: look for distro-installed dyninst too

12 years agoPR14179: Adapt stapdyn runtime to the new layout
Josh Stone [Sat, 21 Jul 2012 00:19:00 +0000 (17:19 -0700)]
PR14179: Adapt stapdyn runtime to the new layout

There still remains more to be done to really separate kernel-specific
code in the runtime, but both kernel and stapdyn modes do work now.

12 years agoFixed PR13453 by updating inotify support in nd_syscalls.stp.
David Smith [Fri, 20 Jul 2012 20:45:39 +0000 (15:45 -0500)]
Fixed PR13453 by updating inotify support in nd_syscalls.stp.

* tapset/nd_syscalls.stp: Updated nd_syscall.inotify_add_watch() to print
  the mask argument as a string. Updated nd_syscall.inotify_init probe
  alias to handle sys_inotify_init1().
* testsuite/systemtap.syscall/nd_syscall.exp (syscall_kfails): Removed
  inotify kfail.

12 years agoFixed PR13451 by updating eventfd support in nd_syscalls.stp.
David Smith [Fri, 20 Jul 2012 19:46:42 +0000 (14:46 -0500)]
Fixed PR13451 by updating eventfd support in nd_syscalls.stp.

* tapset/nd_syscalls.stp: Updated nd_syscall.eventfd probe aliase to handle
  sys_eventfd2().
* testsuite/systemtap.syscall/nd_syscall.exp (syscall_kfails): Removed
  eventfd kfail.

12 years agoMinor fix to PR13456 epoll_create1 nd_syscalls.stp support.
David Smith [Fri, 20 Jul 2012 19:33:39 +0000 (14:33 -0500)]
Minor fix to PR13456 epoll_create1 nd_syscalls.stp support.

12 years agoFixed PR13456 by adding epoll_create1 support to nd_syscalls.stp.
David Smith [Fri, 20 Jul 2012 19:24:03 +0000 (14:24 -0500)]
Fixed PR13456 by adding epoll_create1 support to nd_syscalls.stp.

* tapset/nd_syscalls.stp: Updated nd_syscall.epoll_create probe aliase to
  handle epoll_create1.

12 years agoFixed PR13451 by updating dup2/dup3 support in nd_syscalls.stp.
David Smith [Fri, 20 Jul 2012 18:57:48 +0000 (13:57 -0500)]
Fixed PR13451 by updating dup2/dup3 support in nd_syscalls.stp.

* tapset/nd_syscalls.stp: Updated dup2/dup3 probe aliases.
* tapset/registers.stp: Removed dummy function and added
  __asmlinkage_int_arg(), needed by nd_syscall.return functions to grab
  entry values when asmlinkage() is needed.
* testsuite/systemtap.syscall/nd_syscall.exp (syscall_kfails): Removed dup
  kfail.

12 years agoMade gen_mapped_saved_return() static.
David Smith [Fri, 20 Jul 2012 15:52:43 +0000 (10:52 -0500)]
Made gen_mapped_saved_return() static.

12 years agoFixed PR14378 by supporting @entry() in kprobe.function().return probes.
David Smith [Fri, 20 Jul 2012 15:33:06 +0000 (10:33 -0500)]
Fixed PR14378 by supporting @entry() in kprobe.function().return probes.

* tapsets.cxx (gen_mapped_saved_return): Removed from the
  dwarf_var_expanding_visitor class.  Also renamed the global variables
  prefix from '_dwarf' to '_entry' (since now dwarfless kprobe probes
  support @entry()).
  (dwarf_var_expanding_visitor::gen_mapped_saved_return): Just calls
  gen_mapped_saved_return().
  (kprobe_var_expanding_visitor): New class.
  (kprobe_derived_probe::kprobe_derived_probe): Uses
  kprobe_var_expanding_visitor to support @entry().
* testsuite/semko/entry04.stp: New test.
* testsuite/semok/entry04.stp: Ditto.

12 years agoMore lexer cleanup: comment on @words change, add gettext calls..
Serguei Makarov [Fri, 20 Jul 2012 14:59:02 +0000 (10:59 -0400)]
More lexer cleanup: comment on @words change, add gettext calls..

12 years agoFix '@operator' parsing -- strictly enforce use of '@' in identifiers.
Serguei Makarov [Fri, 20 Jul 2012 14:26:40 +0000 (10:26 -0400)]
Fix '@operator' parsing -- strictly enforce use of '@' in identifiers.

Generally, the language makes a policy of not allowing people to use '@'
inside arbitrary identifiers. The new test case gives an example of
behaviour that was still allowed by the parser's older scheme for
preventing this.

Identifiers beginning in '@' are now reclassified as tok_operator by the lexer.

12 years agoAdded a comment explaining why there are 2 syscall.dup2 aliases (PR14353).
David Smith [Fri, 20 Jul 2012 13:42:28 +0000 (08:42 -0500)]
Added a comment explaining why there are 2 syscall.dup2 aliases (PR14353).

* tapset/syscalls.stp: Added comment.

12 years agoEven further tweak to glibc/kernel-headers workaround.
David Smith [Thu, 19 Jul 2012 20:45:22 +0000 (15:45 -0500)]
Even further tweak to glibc/kernel-headers workaround.

* staprun/staprun.h: Change inclusion of linux/types.h for
  linux/posix_types.h, since the former didn't work with RHEL5.

12 years agoStop expecting registration errors on non-existent kprobe.function probes (PR11424).
David Smith [Thu, 19 Jul 2012 20:29:47 +0000 (15:29 -0500)]
Stop expecting registration errors on non-existent kprobe.function probes (PR11424).

* testsuite/systemtap.base/badkprobe.exp: Remove invalid tests.

12 years agoFurther tweak to glibc/kernel-headers workaround
Josh Stone [Thu, 19 Jul 2012 01:33:12 +0000 (18:33 -0700)]
Further tweak to glibc/kernel-headers workaround

... following commit 037853b4644bb6ebd68e2f1fac11c3636f551d8e, for
https://bugzilla.redhat.com/show_bug.cgi?id=840902

Seems it's not always possible to avoid linux/types.h for the conflict
it presents with sys/select.h.  Now include linux/types.h very early, so
glibc can stomp over it with #undef and #define, rather than vice versa.

12 years agoPR14369: Fix locating SDT w/ $vars, w/o debuginfo
Josh Stone [Wed, 18 Jul 2012 22:05:59 +0000 (15:05 -0700)]
PR14369: Fix locating SDT w/ $vars, w/o debuginfo

While current SDT can work without debuginfo, trying to use local $vars
still requires a look into DWARF.  If that debuginfo is broken or
missing (as with asm probes), then we were reporting the probe entirely
absent, instead of just the $var broken.

This is undesirable if the $var access might have been optimized away,
or was part of a @defined check that should just get 0.  So now we try
using debuginfo first, but if that fails go the direct route, and bad
$vars can be resolved or error in the normal way.

12 years agoPR13934: When SDT args don't use N@OP, split on spaces
Josh Stone [Wed, 18 Jul 2012 21:09:05 +0000 (14:09 -0700)]
PR13934: When SDT args don't use N@OP, split on spaces

Assembly probes are not forced to use the N@OP form.  In this case, N is
inferred to be the native word size.  Since we don't have a nice
delimiter, just split it on spaces.  SDT-asm authors then must not put
any spaces in arguments, to avoid ambiguity.

12 years agoFixed PR11424 by using System.map data to validate dwarfless kprobe probes.
David Smith [Wed, 18 Jul 2012 18:30:59 +0000 (13:30 -0500)]
Fixed PR11424 by using System.map data to validate dwarfless kprobe probes.

* tapsets.cxx (kprobe_builder::load_function_name_cache): New function.
  (kprobe_builder::build): Use parsed System.map data to validate
  kprobe.function probe names.

12 years agoPR14360: update testsuite to reflect new string-gluing behaviour.
Serguei Makarov [Thu, 12 Jul 2012 20:35:35 +0000 (16:35 -0400)]
PR14360: update testsuite to reflect new string-gluing behaviour.

12 years agoPR14360, PR11207: clean up wildcard code in preparation for token-based macros.
Serguei Makarov [Thu, 12 Jul 2012 20:27:38 +0000 (16:27 -0400)]
PR14360, PR11207: clean up wildcard code in preparation for token-based macros.

in parse.cxx:
- get rid of ate_comment, enable "a" /* comment */ "b" string gluing
- add ate_whitespace to keep track of token adjacency
- restrict wildcard handling code to parse_probe_point()
  - this is now handled by keeping the component tokens of the wildcard
    separate, and gluing them together (conditional on adjacency)

12 years agoBZ802380: Fixed logic issue and resource leak - Coverity
Chris Meek [Thu, 12 Jul 2012 14:14:48 +0000 (10:14 -0400)]
BZ802380: Fixed logic issue and resource leak - Coverity

Coverity issues caught:

REVERSE_INULL
There were some logic issues in sdt_query::setup_note_probe_entry()
with a check for whether "name" was NULL after it was dereferenced,
as well as copying a couple possibly not '\0' terminated char *'s to
strings. These should now be fixed, and work as intended.

RESOURCE_LEAK
Also, there was a resource leak with ai_tvar_base in
dwarf_var_expanding_visitor::gen_mapped_saved_return(). That should
now also be fixed.

12 years agoexamples: have pf2/pf3 use wrapping stats arrays
Frank Ch. Eigler [Wed, 11 Jul 2012 13:27:05 +0000 (09:27 -0400)]
examples: have pf2/pf3 use wrapping stats arrays

12 years agoAdd code to keep track of task_work callbacks to avoid a possible crash.
David Smith [Mon, 9 Jul 2012 21:07:22 +0000 (16:07 -0500)]
Add code to keep track of task_work callbacks to avoid a possible crash.

* runtime/stp_task_work.c: New file.
* runtime/stp_utrace.c (utrace_init): Move STAPCONF_TASK_WORK_ADD_EXPORTED
  code to stp_task_work_init().
  (utrace_exit): Call stp_task_work_exit().
  (utrace_cleanup): Call task_work_cancel() wrapper function.
  (utrace_free): Ditto.
  (utrace_do_stop): Call task_work_add() wrapper function.
  (utrace_control): Ditto.
  (finish_report): Ditto.
  (utrace_resume): Call stp_task_work_func_done().
* runtime/linux/task_finder2.c (__stp_tf_cancel_task_work): Call
  task_work_cancel() wrapper function.
  (__stp_tf_quiesce_worker): Call stp_task_work_func_done().
  (__stp_utrace_task_finder_target_quiesce): Call task_work_add() wrapper
  function.
  (__stp_tf_mmap_worker): Call stp_task_work_func_done().
  (__stp_utrace_task_finder_target_syscall_exit): Call task_work_add() wrapper
  function.

12 years agoFix the build with glibc 2.16
Josh Stone [Mon, 9 Jul 2012 19:07:48 +0000 (12:07 -0700)]
Fix the build with glibc 2.16

With our elevated compiler warnings as errors, we got:

  mainloop.c: In function 'stp_main_loop':
  mainloop.c:581:3: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
  mainloop.c:581:3: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
  mainloop.c:583:35: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
  mainloop.c:583:35: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
  mainloop.c:631:2: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
  mainloop.c:631:2: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
  cc1: all warnings being treated as errors

This turns out to be a macro fight between glibc-2.16 and
kernel-headers, via including linux/types.h.  We apparently don't
even need that header, so removing it lets us proceed normally.

Those curious can watch this bug to see how the conflict is resolved:
https://bugzilla.redhat.com/show_bug.cgi?id=837641

12 years agoFix up buildid.exp to avoid testcase hangs.
David Smith [Tue, 3 Jul 2012 18:00:35 +0000 (13:00 -0500)]
Fix up buildid.exp to avoid testcase hangs.

* testsuite/systemtap.base/buildid.exp: Properly call "close" and "wait"
  after all "spawn" calls.  Otherwise test can hang.

12 years agoMerge branch 'master' of ssh://sources.redhat.com/git/systemtap
David Smith [Mon, 2 Jul 2012 20:48:03 +0000 (15:48 -0500)]
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap

12 years agoImprove nd_syscall testsuite for s390x.
David Smith [Mon, 2 Jul 2012 20:47:31 +0000 (15:47 -0500)]
Improve nd_syscall testsuite for s390x.

* tapset/nd_syscalls2.stp (nd_syscall.pselect7): For s390x, don't try to
  get argument 7 since it will never succeed.
  (nd_syscall.compat_pselect7): Ditto.

12 years agoPR12210: documentation and examples for alias suffix enhancement.
Serguei Makarov [Thu, 28 Jun 2012 21:23:34 +0000 (17:23 -0400)]
PR12210: documentation and examples for alias suffix enhancement.

12 years agoPR12210: testsuite for alias suffix enhancement.
Serguei Makarov [Thu, 28 Jun 2012 21:18:41 +0000 (17:18 -0400)]
PR12210: testsuite for alias suffix enhancement.

12 years agoPR12210: Basic implementation of alias suffixes.
Serguei Makarov [Thu, 28 Jun 2012 21:07:01 +0000 (17:07 -0400)]
PR12210: Basic implementation of alias suffixes.

This enhancement permits the script writer to attach a suffix when
invoking a probe alias. The components in the suffix are passed on
to the underlying probe point.

e.g. syscall.read.maxactive(10) expands to something like
kernel.function("sys_read").return.maxactive(10); the
maxactive(10) part is a suffix that is attached to the
alias expansion of syscall.read.return.

At this stage, the interaction of the feature with wildcards
is somewhat limited. Namely, alias suffixes appear in wildcard
expansions only when the old implementation would signal an
error due to lack of expansions (see documentation in the next
commit for details). This minimizes the impact on existing code,
but the restriction should be removed as soon as we figure out
a way to make the available suffixes reliably discoverable in
error messages, features such as stap -l, etc.

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