]> sourceware.org Git - systemtap.git/log
systemtap.git
8 years agosystemtap.spec: add systemd as BuildRequires & Requires if %{with_systemd}
Igor Zhbanov [Fri, 29 Jul 2016 17:51:21 +0000 (13:51 -0400)]
systemtap.spec: add systemd as BuildRequires & Requires if %{with_systemd}

It should have both "Requires: systemd" and "BuildRequires: systemd".
BuildRequires because it uses %{_unitdir} and %{_tmpfilesdir}, and
Requires because of systemctl in %post.

8 years agoPR20416 cont'd: kprobe.function.return @entry too
Frank Ch. Eigler [Wed, 27 Jul 2016 23:15:51 +0000 (19:15 -0400)]
PR20416 cont'd: kprobe.function.return @entry too

Bonus round: jistone identified a twin in need of the same fix.

8 years agoPR20416: handle @entry(@perf("..."))
Frank Ch. Eigler [Wed, 27 Jul 2016 22:43:56 +0000 (18:43 -0400)]
PR20416: handle @entry(@perf("..."))

The dwarf_var_expanding_visitor::visit_entry_op function inherited
some old logic from expanding $var's in .function().return probes.
This logic is not approproate for the more formal way by which current
code synthesizes a .call probe to collect @entry(EXPR) values.  Now we
pass the EXPR tree to the .call probe unmodified, for resolution
there, rather than in a fake non-.return context here.  This makes
@entry(@perf("...")) expressions work.

8 years agodejagnu testsuite driver: collect output during startup smoke test
Frank Ch. Eigler [Wed, 27 Jul 2016 22:23:34 +0000 (18:23 -0400)]
dejagnu testsuite driver: collect output during startup smoke test

Stop suppressing stderr; if something's wrong (like missing
kernel-debuginfo), let's show the user the whole message.

8 years agoFix a locking problem in the task_finder.
David Smith [Tue, 26 Jul 2016 17:57:59 +0000 (12:57 -0500)]
Fix a locking problem in the task_finder.

* runtime/linux/task_finder.c (stap_start_task_finder): Be sure to ulock
  the task if we exit early.
* runtime/linux/task_finder2.c (stap_start_task_finder): Ditto.

8 years agoAdd a non-optimized test to testsuite/systemtap.base/at_var.exp.
Ravi Bangoria [Tue, 26 Jul 2016 16:20:05 +0000 (11:20 -0500)]
Add a non-optimized test to testsuite/systemtap.base/at_var.exp.

* testsuite/systemtap.base/at_var.exp: Add non-optimized test. Also, don't
  bother trying to run the executable if compilation failed.

8 years agoSuppress empty builder error message
Felix Lu [Mon, 25 Jul 2016 20:58:43 +0000 (16:58 -0400)]
Suppress empty builder error message

8 years agoUse the standard testsuite 'kill' procedure in unprivileged_probes.exp.
David Smith [Mon, 25 Jul 2016 15:57:43 +0000 (10:57 -0500)]
Use the standard testsuite 'kill' procedure in unprivileged_probes.exp.

8 years agoImprove session state and transport state handling.
David Smith [Mon, 25 Jul 2016 15:24:27 +0000 (10:24 -0500)]
Improve session state and transport state handling.

* translate.cxx (emit_module_init): At the start, only set the session
  state to STAP_SESSION_STARTING if we were in the
  STAP_SESSION_UNINITIALIZED state. Once the session is initialized, set
  the state to STAP_SESSION_RUNNING (if we're still in the
  STAP_SESSION_STARTING state).
* runtime/common_session_state.h: Add new 'STAP_SESSION_UNITIALIZED' state.
* runtime/dyninst/common_session_state.h (stp_session_init): Set initial
  session state to STAP_SESSION_UNITIALIZED.
* runtime/linux/common_session_state.h: Ditto.
* runtime/dyninst/linux_defs.h (atomic_cmpxchg): New function.
* runtime/transport/transport.c: Merge '_stp_start_called' and
  '_stp_exit_called' flags into a single flag called
  '_stp_transport_state'.

8 years agoMerge branch 'csanting/PR19489'
Cody Santing [Mon, 25 Jul 2016 14:30:19 +0000 (10:30 -0400)]
Merge branch 'csanting/PR19489'

8 years agopfaults.stp: correct the fault_entry_time index
Josh Stone [Thu, 21 Jul 2016 17:11:31 +0000 (10:11 -0700)]
pfaults.stp: correct the fault_entry_time index

Commit 31131f187a73 removed most manual tid() memoization, but missed
this particular use, and stap complained about the never-assigned 'id'.

8 years agoDon't use as_root() to run stap within tapset_functions.exp
Martin Cermak [Thu, 21 Jul 2016 16:17:16 +0000 (18:17 +0200)]
Don't use as_root() to run stap within tapset_functions.exp

Most of the other as_root() in the testsuite is for stuff that
genuinely has to be root, like loading some test kernel module
that we'll probe.  For running the testsuite under a regular
user, stap{user,sys,dev} group membership mechanism should be
used instead.

8 years agostapprobes.3: Spell out that $context variables are probe-point specific.
Frank Ch. Eigler [Wed, 6 Jul 2016 17:34:05 +0000 (13:34 -0400)]
stapprobes.3: Spell out that $context variables are probe-point specific.

8 years agoUse our standard testsuite 'kill' procedure in several tests.
David Smith [Mon, 18 Jul 2016 14:04:30 +0000 (09:04 -0500)]
Use our standard testsuite 'kill' procedure in several tests.

* testsuite/systemtap.base/flightrec1.exp: Use our "kill" procedure,
  instead of doing "exec kill ...".
* testsuite/systemtap.base/flightrec2.exp: Ditto.
* testsuite/systemtap.base/flightrec3.exp: Ditto.
* testsuite/systemtap.base/flightrec4.exp: Ditto.
* testsuite/systemtap.base/flightrec5.exp: Ditto.
* testsuite/systemtap.base/ipaddr.exp: Ditto.
* testsuite/systemtap.base/pr13158.exp: Ditto.
* testsuite/systemtap.base/remote.exp: Ditto.
* testsuite/systemtap.base/stapsh-unix.exp: Ditto.
* testsuite/systemtap.base/target_set.exp: Ditto.

8 years agoFix handling of internal transport flags.
David Smith [Fri, 15 Jul 2016 16:14:21 +0000 (11:14 -0500)]
Fix handling of internal transport flags.

* runtime/transport/transport.c: Remove unused '_stp_transport_mutex'
  mutex. Commit 440c8ee removed the mutex protection of the
  '_stp_start_called' and '_stp_exit_called' flags, so those flags have
  been converted to be atomics so that concurrent use of those flags see
  the correct values.

8 years agoMake sure the unprivileged_myproc.exp testcase kills its processes.
David Smith [Fri, 15 Jul 2016 16:00:33 +0000 (11:00 -0500)]
Make sure the unprivileged_myproc.exp testcase kills its processes.

* testsuite/systemtap.unprivileged/unprivileged_myproc.exp: Use library
  'kill' proc to make sure the test executables die.
* testsuite/lib/systemtap.exp (kill): Add 'AS_ROOT' argument, to kill the
  pid as root.

8 years agoUpdate sendmmsg syscall test.
David Smith [Wed, 13 Jul 2016 17:16:09 +0000 (12:16 -0500)]
Update sendmmsg syscall test.

* testsuite/systemtap.syscall/sendmmsg.c: Update test to avoid a failur on
  32-bit RHEL6.

8 years agoTweak autocast-defined interactions further
Josh Stone [Sat, 9 Jul 2016 01:21:49 +0000 (18:21 -0700)]
Tweak autocast-defined interactions further

- collapse basic @defined($foo) right away.
- last-ditch collapse other @defined(expr) to 1 or 0 depending on pe_unknown.
- run that last-ditch effort *before* turning on assert_resolvability.
- only run extra dead_control_remover for optimized runs
- in var_expanding_visitor, pass *any* unchanged expr through, so they
  may be decided later.  (e.g. for @choose_defined ternaries)

8 years agoIncrease the difficulty of semok/autocast14.stp
Josh Stone [Wed, 22 Jun 2016 19:09:05 +0000 (12:09 -0700)]
Increase the difficulty of semok/autocast14.stp

8 years agoPR18079: support nested autocast / @defined
Frank Ch. Eigler [Wed, 22 Jun 2016 15:43:33 +0000 (11:43 -0400)]
PR18079: support nested autocast / @defined

We now perform const-folding & dead-code-elision during the type
resolution loop, whenever an autocast expression gets evaluated.  This
way, @defined(foo()->mm) type expressions can work as nature intended.

This requires @defined() not to be short-circuit evaluated to 0 during
a random const_folding process, so a flag is introduced to control its
preservation or collapsing.  For the last (assert_resolvability) pass
in the type resolution loop, this flag is set to true, so that
genuinely unresolvable @defined($expressions) do get mapped to 0 in
time for a last elision.

8 years agopfaults.stp: correct the fault_entry_time index
Josh Stone [Thu, 21 Jul 2016 17:11:31 +0000 (10:11 -0700)]
pfaults.stp: correct the fault_entry_time index

Commit 31131f187a73 removed most manual tid() memoization, but missed
this particular use, and stap complained about the never-assigned 'id'.

8 years agoDon't use as_root() to run stap within tapset_functions.exp
Martin Cermak [Thu, 21 Jul 2016 16:17:16 +0000 (18:17 +0200)]
Don't use as_root() to run stap within tapset_functions.exp

Most of the other as_root() in the testsuite is for stuff that
genuinely has to be root, like loading some test kernel module
that we'll probe.  For running the testsuite under a regular
user, stap{user,sys,dev} group membership mechanism should be
used instead.

8 years agostapprobes.3: Spell out that $context variables are probe-point specific.
Frank Ch. Eigler [Wed, 6 Jul 2016 17:34:05 +0000 (13:34 -0400)]
stapprobes.3: Spell out that $context variables are probe-point specific.

8 years agoUse our standard testsuite 'kill' procedure in several tests.
David Smith [Mon, 18 Jul 2016 14:04:30 +0000 (09:04 -0500)]
Use our standard testsuite 'kill' procedure in several tests.

* testsuite/systemtap.base/flightrec1.exp: Use our "kill" procedure,
  instead of doing "exec kill ...".
* testsuite/systemtap.base/flightrec2.exp: Ditto.
* testsuite/systemtap.base/flightrec3.exp: Ditto.
* testsuite/systemtap.base/flightrec4.exp: Ditto.
* testsuite/systemtap.base/flightrec5.exp: Ditto.
* testsuite/systemtap.base/ipaddr.exp: Ditto.
* testsuite/systemtap.base/pr13158.exp: Ditto.
* testsuite/systemtap.base/remote.exp: Ditto.
* testsuite/systemtap.base/stapsh-unix.exp: Ditto.
* testsuite/systemtap.base/target_set.exp: Ditto.

8 years agoFix handling of internal transport flags.
David Smith [Fri, 15 Jul 2016 16:14:21 +0000 (11:14 -0500)]
Fix handling of internal transport flags.

* runtime/transport/transport.c: Remove unused '_stp_transport_mutex'
  mutex. Commit 440c8ee removed the mutex protection of the
  '_stp_start_called' and '_stp_exit_called' flags, so those flags have
  been converted to be atomics so that concurrent use of those flags see
  the correct values.

8 years agoMake sure the unprivileged_myproc.exp testcase kills its processes.
David Smith [Fri, 15 Jul 2016 16:00:33 +0000 (11:00 -0500)]
Make sure the unprivileged_myproc.exp testcase kills its processes.

* testsuite/systemtap.unprivileged/unprivileged_myproc.exp: Use library
  'kill' proc to make sure the test executables die.
* testsuite/lib/systemtap.exp (kill): Add 'AS_ROOT' argument, to kill the
  pid as root.

8 years agoUpdate sendmmsg syscall test.
David Smith [Wed, 13 Jul 2016 17:16:09 +0000 (12:16 -0500)]
Update sendmmsg syscall test.

* testsuite/systemtap.syscall/sendmmsg.c: Update test to avoid a failur on
  32-bit RHEL6.

8 years agoMerge branch 'fche/pr18079'
Josh Stone [Tue, 12 Jul 2016 22:22:10 +0000 (15:22 -0700)]
Merge branch 'fche/pr18079'

8 years agoPR19489: Update send syscalls to use buffer_quoted
Cody Santing [Tue, 12 Jul 2016 19:50:03 +0000 (15:50 -0400)]
PR19489: Update send syscalls to use buffer_quoted

tapset/linux/nd_syscalls2.stp: send and sendto use new user_buffer_quoted function
tapset/linnux/syscalls2.stp: send and sendto use new user_buffer_quoted function
testsuite/systemtap.syscall/send.c: Update expected output of testcases
testsuite/systemtap.syscall/sendto.c:Update expected output of test cases

8 years agoTweak autocast-defined interactions further
Josh Stone [Sat, 9 Jul 2016 01:21:49 +0000 (18:21 -0700)]
Tweak autocast-defined interactions further

- collapse basic @defined($foo) right away.
- last-ditch collapse other @defined(expr) to 1 or 0 depending on pe_unknown.
- run that last-ditch effort *before* turning on assert_resolvability.
- only run extra dead_control_remover for optimized runs
- in var_expanding_visitor, pass *any* unchanged expr through, so they
  may be decided later.  (e.g. for @choose_defined ternaries)

8 years agoUpdate aux_syscalls.stp for android 3.0 kernels.
Alexander Lochmann [Fri, 8 Jul 2016 15:30:12 +0000 (10:30 -0500)]
Update aux_syscalls.stp for android 3.0 kernels.

* tapset/linux/aux_syscalls.stp: Include syscall.h for kernels (like
  android 3.0 kernels) with no asm/syscall.h

8 years agoUpdate fanotify.c syscall test case.
David Smith [Fri, 8 Jul 2016 15:26:57 +0000 (10:26 -0500)]
Update fanotify.c syscall test case.

* testsuite/systemtap.syscall/fanotify.c (main): Fix small test case bug
  found by new *buffer_quoted functions.

8 years agoFix testsuite redirection problems.
David Smith [Fri, 8 Jul 2016 14:02:54 +0000 (09:02 -0500)]
Fix testsuite redirection problems.

* testsuite/systemtap.server/server.exp: Fix command redirection to avoid
  creation of '&1' file.
* testsuite/systemtap.stress/tapset_functions.exp: Use command
  redirection.

8 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
Cody Santing [Thu, 7 Jul 2016 20:18:31 +0000 (16:18 -0400)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

8 years agoPR19489: Update probe aliases to use new *buffer_quoted functions
Cody Santing [Thu, 7 Jul 2016 20:09:47 +0000 (16:09 -0400)]
PR19489: Update probe aliases to use new *buffer_quoted functions

tapset/linux/nd_syscalls.stp: add_key uses new function
tapset/linux/nd_syscalls2.stp: pwrite, pwrite32, and write use new function
tapset/linux/syscalls.stp: add_key uses new function
tapset/linux/syscalls2.stp: pwrite and pwrite32 use new function
tapset/linux/tty.stp: write and read use new function
tapset/uconversions.stp: Update typo in documentation comments

8 years agoFix cputime_to_msecs() macro for broken android 3.0 kernels.
Alexander Lochmann [Thu, 7 Jul 2016 19:22:46 +0000 (14:22 -0500)]
Fix cputime_to_msecs() macro for broken android 3.0 kernels.

* tapset/linux/task_time.stp (cputime_to_msecs): Fix macro definition for
  certain android kernels that have an extra semicolon on the
  cputime_to_usecs() macro.

8 years agoUpdated PR_SET_MM_* flag list for kernels that don't support all the flags.
Alexander Lochmann [Thu, 7 Jul 2016 15:57:34 +0000 (10:57 -0500)]
Updated PR_SET_MM_* flag list for kernels that don't support all the flags.

8 years agoPR19953: netfilter packet content dumping
Felix Lu [Thu, 30 Jun 2016 18:54:18 +0000 (14:54 -0400)]
PR19953: netfilter packet content dumping

* tapset/linux/conversions.stp: New overloaded instance of
  kernel_buffer_quoted using MAXSTRINGLEN by default.
  Mark kernel_buffer* with /* pure */.
* tapset/linux/netfilter.stp: New data_str and data_hex variables
  containing buffer contents.
* translate.cxx: Increase memory dump limit to PAGE_SIZE for memory
  dumping sk_buff page fragments in c_unparser::visit_print.
* systemtap.examples/network/packet_contents.stp: Example script.
* systemtap.examples/network/packet_contents.txt: Example demo.

8 years agoMerge branch 'csanting/PR19489'
Cody Santing [Mon, 4 Jul 2016 16:50:25 +0000 (12:50 -0400)]
Merge branch 'csanting/PR19489'

8 years agoPR19489: Update user/kernel_buffer_quoted_warn tapset functions to _error
Cody Santing [Mon, 4 Jul 2016 16:42:55 +0000 (12:42 -0400)]
PR19489: Update user/kernel_buffer_quoted_warn tapset functions to _error

/NEWS: Include information on new functions
/tapset/linux/aux_syscalls.stp: Uses new buffer mode of _stp_text_str
/tapset/linux/conversions.stp: Update kernel_buffer_quoted_warn to _error
/tapset/uconversions.stp: Updated user_buffer_quoted_warn to _error

8 years agoPR19489: Add *_buffer_quoted tapset functions
Cody Santing [Mon, 4 Jul 2016 14:20:50 +0000 (10:20 -0400)]
PR19489: Add *_buffer_quoted tapset functions

runtime/stp_string.c: Update _stp_text_str to handle '\0' and take a buffer flag
runtime/stp_string.h: Update _stp_text_str prototype
tapset/linux/aux_syscalls.stp: Update calls to _stp_text_str
tapset/linux/conversions.stp: Add user_buffer_quoted and _warn tapset functions
tapset/linux/syscalls2.stp: Update syscall.write to use user_buffer_quoted
tapset/string.stp: Update calls to _stp_text_str
tapset/uconversions.stp: Add kernel_buffer_quoted and _warn tapset functions

8 years agoPartial PR19905 fix: Fix nd_syscall.{preadv2,pwritev2).
David Smith [Fri, 1 Jul 2016 18:59:51 +0000 (13:59 -0500)]
Partial PR19905 fix: Fix nd_syscall.{preadv2,pwritev2).

* tapset/linux/nd_syscalls2.stp (nd_syscall.preadv2): Fix grabbing the
  'flags' argument.
  (nd_syscall.pwritev2): Ditto.

8 years agoTest cover PR20307 (commit e5c209c).
Martin Cermak [Fri, 1 Jul 2016 07:28:40 +0000 (09:28 +0200)]
Test cover PR20307 (commit e5c209c).

8 years agoPR20307: fix references to private global in tapset
Frank Ch. Eigler [Thu, 30 Jun 2016 16:08:07 +0000 (12:08 -0400)]
PR20307: fix references to private global in tapset

Previous code could not resolve a reference to a private global
(defined in a tapset) within a probe alias (from that same tapset).
We now try matching up the mangled name in addition to the plain one
in symresolution_info::find_var() when searching the
session.library_files[].globals.

8 years agoadd private keyword syntax highlighting
Felix Lu [Thu, 30 Jun 2016 15:08:18 +0000 (11:08 -0400)]
add private keyword syntax highlighting

8 years agoAvoid null pointer exception in the ioscheduler.elv_add_request probe.
Martin Cermak [Wed, 29 Jun 2016 17:03:11 +0000 (19:03 +0200)]
Avoid null pointer exception in the ioscheduler.elv_add_request probe.

This update makes the ioscheduler.elv_add_request probe gracefully handle
situation where $q->elevator is NULL (RHBZ1269062).

8 years agoPartial 20236 fix: Add user_TYPE_error functions that throw errors.
David Smith [Tue, 28 Jun 2016 15:12:25 +0000 (10:12 -0500)]
Partial 20236 fix: Add user_TYPE_error functions that throw errors.

* tapset/uconversions.stp: Add new functions 'user_TYPE_error()' (where
  TYPE is 'char', 'short', 'ushort', 'int', 'long', 'ulong', 'int8',
  'uint8', 'int16', 'uint16', 'int32', 'uint32', or 'int64'). These
  funtions thow an error if the value to be read isn't
  accessible. Reimplement 'user_TYPE()' and 'user_TYPE_warn()' functions
  in terms of user_TYPE_error() functions.
* tapset/linux/aux_syscalls.stp: Replace '__user_pointer' with
  'user_long_error'.
* testsuite/buildok/conversions-embedded.stp: Add tests for new functions.

8 years agoFix PR20281 by throwing an error if module has_path, which is empty.
Martin Cermak [Tue, 28 Jun 2016 14:34:22 +0000 (16:34 +0200)]
Fix PR20281 by throwing an error if module has_path, which is empty.

8 years agoDon't error on missing systemtap.sum
Martin Cermak [Tue, 28 Jun 2016 14:25:33 +0000 (16:25 +0200)]
Don't error on missing systemtap.sum

Don't report error if systemtap.sum isn't available to tail.
This was producing optically disturbing error message e.g. in case
the testsuite got run without dejagnu installed.

8 years agoUpdate the Czech version of manpages.
Martin Cermak [Tue, 28 Jun 2016 14:21:12 +0000 (16:21 +0200)]
Update the Czech version of manpages.

8 years agoImplement PR12748 by providing the syscall_table tapset files.
Martin Cermak [Tue, 28 Jun 2016 12:21:04 +0000 (14:21 +0200)]
Implement PR12748 by providing the syscall_table tapset files.

This patch provides architecture specific syscall tables, tapset
script functions syscall_num() and syscall_name() for acessing
them, test coverage, and a script for re-generating the syscall
tables based on strace source code.

* scripts/dump-syscalls.sh: Helper script for re-generating the
  syscall tables based on strace source code.
* tapset/linux/syscall_table.stp: Tapset script providing
  functions syscall_num() and syscall_name().
* tapset/linux/arm/syscall_num.stp: Syscall table.
* tapset/linux/arm64/syscall_num.stp: Ditto.
* tapset/linux/i386/syscall_num.stp: Ditto.
* tapset/linux/powerpc/syscall_num.stp: Ditto.
* tapset/linux/s390/syscall_num.stp: Ditto.
* tapset/linux/x86_64/syscall_num.stp: Ditto.
* testsuite/systemtap.syscall/sys.stp: A testsuite bit.
* testsuite/systemtap.syscall/syscall.exp: Ditto.
* testsuite/systemtap.syscall/tapset/syscall.stp: Ditto.

8 years agoFix PR20298 by updating the unprivileged_embedded_C.exp test case.
David Smith [Mon, 27 Jun 2016 17:57:05 +0000 (12:57 -0500)]
Fix PR20298 by updating the unprivileged_embedded_C.exp test case.

* testsuite/systemtap.unprivileged/unprivileged_embedded_C.exp: Several
  changes. Now only tests embedded C functions (since we can't really know
  if pure script functions are privileged or not). Look for tapset files
  in tapset/linux and in tapset/linux/${ARCH}. Now test all the embedded C
  functions intead of a subset. Add a "transitive" test, to make sure
  privileged embedded C functions can't be called by script functions.

8 years agoAdd the '-p4' options when exemplifying the module compilation
Nikolay Borisov [Mon, 27 Jun 2016 16:46:35 +0000 (19:46 +0300)]
Add the '-p4' options when exemplifying the module compilation

Currently the example command which supposedly should compile the
instrumentation module is missing the '-p4' option, meaning that
upon running it will compile and run the module. In order to make
the command more in sync with what this particular chapter is about,
add the -p4 options so that after running the command the user gets
to copy the resulting module.

Signed-off-by: Nikolay Borisov <n.borisov.lkml@gmail.com>
8 years agoRelocate ia64-specific _ia64_pipe[01] aux syscall functions.
David Smith [Mon, 27 Jun 2016 15:53:13 +0000 (10:53 -0500)]
Relocate ia64-specific _ia64_pipe[01] aux syscall functions.

* tapset/linux/syscalls2.stp (_ia64_pipe0): Move arch-specific function to
  tapset/linux/ia64/aux_syscalls.stp.
  (_ia64_pipe1): Ditto.
* tapset/linux/ia64/aux_syscalls.stp: Moved ia64-specific functions here.
* testsuite/systemtap.unprivileged/unprivileged_embedded_C.exp: Removed
  filtering of _ia64_pipe[01] functions.

8 years agoIncrease the difficulty of semok/autocast14.stp
Josh Stone [Wed, 22 Jun 2016 19:09:05 +0000 (12:09 -0700)]
Increase the difficulty of semok/autocast14.stp

8 years agoPR18079: support nested autocast / @defined
Frank Ch. Eigler [Wed, 22 Jun 2016 15:43:33 +0000 (11:43 -0400)]
PR18079: support nested autocast / @defined

We now perform const-folding & dead-code-elision during the type
resolution loop, whenever an autocast expression gets evaluated.  This
way, @defined(foo()->mm) type expressions can work as nature intended.

This requires @defined() not to be short-circuit evaluated to 0 during
a random const_folding process, so a flag is introduced to control its
preservation or collapsing.  For the last (assert_resolvability) pass
in the type resolution loop, this flag is set to true, so that
genuinely unresolvable @defined($expressions) do get mapped to 0 in
time for a last elision.

8 years agoFix PR20286 by documenting that timer probes can get skipped.
David Smith [Tue, 21 Jun 2016 21:37:40 +0000 (16:37 -0500)]
Fix PR20286 by documenting that timer probes can get skipped.

* man/stapprobes.3stap: Document the fact that timer probes set to fire at
  a very high rate can get skipped if the time for them to run has passed.

8 years agoImprove error messages
Felix Lu [Tue, 21 Jun 2016 20:47:24 +0000 (16:47 -0400)]
Improve error messages

List the probe builders tried during resolution.

* dwflpp.cxx: Display error message when using wildcard for linenumber
  mode if no matches.
* elaborate.cxx:
  - match_node::find_and_build: Accumulate builders tried
    when no probes were resolved.
  - derive_probes: Display builders in error chain.
* elaborate.h: New name() for derived_probe_builder.

8 years agoFix PR20282 by updating loc2c-runtime.h for aarch64.
David Smith [Tue, 21 Jun 2016 18:17:15 +0000 (13:17 -0500)]
Fix PR20282 by updating loc2c-runtime.h for aarch64.

* runtime/linux/loc2c-runtime.h: Use BUILD_BUG() instead of
  __get_user_bad()/__put_user_bad() when available.

8 years agoConvert more embedded-C constants to use @const().
David Smith [Tue, 21 Jun 2016 17:31:30 +0000 (12:31 -0500)]
Convert more embedded-C constants to use @const().

* tapset/linux/dentry.stp: Convert embedded-C constants to use @const().
* tapset/linux/ioblock.stp: Ditto.
* tapset/linux/nd_syscalls.stp: Ditto.
* tapset/linux/nd_syscalls2.stp: Ditto.
* tapset/linux/signal.stp: Ditto.

8 years agoTestsuite resume mode only works with its own files.
Martin Cermak [Tue, 21 Jun 2016 14:07:02 +0000 (16:07 +0200)]
Testsuite resume mode only works with its own files.

This update makes the testsuite resume mode only work with its own
files, not touching logs that the user might have set aside for
his/her own reference in the testsuite directory.  After this
update, the log names "reserved" for the testsuite resume mode
functionality are systemtap.temp{1,2}.{log,sum}.

8 years agoFix handling of the [nd_]syscall.fanotify_mark 'mask' convenience variable.
David Smith [Fri, 17 Jun 2016 15:06:13 +0000 (10:06 -0500)]
Fix handling of the [nd_]syscall.fanotify_mark 'mask' convenience variable.

* tapset/linux/syscalls.stp (syscall.fanotify_mark): Fix compat handling
  of the 64-bit 'mask' parameter.
* tapset/linux/nd_syscalls.stp (syscall.fanotify_mark): Ditto.

8 years agoPartial 20236 fix: Cleanup memory accesses and always call lookup_bad_addr().
David Smith [Fri, 17 Jun 2016 14:16:15 +0000 (09:16 -0500)]
Partial 20236 fix: Cleanup memory accesses and always call lookup_bad_addr().

* runtime/linux/loc2c-runtime.h: Fairly serious rewrite of the
  deref/store_deref macros. Instead of custom assembly language macros for
  each arch, now we just use the kernel's routines.
  (__stp_deref_nocheck): New macro.
  (_stp_deref_nofault): New macro.
  (__stp_store_deref_nocheck): New macro.
  (_stp_store_deref_nofault): New macro.
  (kderef_buffer): Rewrote using lookup_bad_addr() and
  __stp_deref_nocheck(), allowing us to do 1 address check at the start of
  the function instead of checking byte by byte.
  (kderef_string): Ditto.
  (_stp_store_deref_string): New macro.
  (store_kderef_string): Rewrite in terms of _stp_store_deref_string().
  (store_uderef_string): Ditto.
* runtime/linux/copy.c (_stp_strncpy_from_user): Always use the kernel's
  strncpy_from_user(). Call lookup_bad_addr() on target address.
  (_stp_copy_from_user): Call lookup_bad_addr() on target address.
* runtime/stp_string.h (_stp_read_address): Delete
  macro. _stp_deref_nofault() can be used instead.
* runtime/stp_string.c (_stp_decode_utf8): Use new macro
  _stp_deref_nofault() instead of _stp_read_address().
* runtime/unwind.c: Ditto.
* runtime/unwind/unwind.h (read_ptr_sect): Ditto.
* runtime/addr-map.h: New file.
* runtime/addr-map.c: Include addr-map.h.
* runtime/runtime.h: Include addr-map.h so that early code can use
  lookup_bad_addr().
* runtime/linux/addr-map.c (lookup_bad_addr): Updated prototype.
* runtime/dyninst/addr-map.c (lookup_bad_addr): Update function
  prototype. Add copyright header.
* runtime/dyninst/loc2c-runtime.h (_stp_deref_nofault): New macro to match
  linux runtime changes.

8 years agotestsuite: refactor pthreadprobes.exp
Josh Stone [Thu, 16 Jun 2016 23:32:50 +0000 (16:32 -0700)]
testsuite: refactor pthreadprobes.exp

- move the main script into its own pthreadprobes.stp
- reduce repetition with macros, aliases, and an array of counters
- suppress warnings from stapdyn so individual failures can be checked

8 years agoFix typo in testsuite/systemtap.examples/profiling/timeout.stp.
David Smith [Thu, 16 Jun 2016 18:10:17 +0000 (13:10 -0500)]
Fix typo in testsuite/systemtap.examples/profiling/timeout.stp.

8 years agoMake some small improvements to [nd_]syscall.fanotify_mark for RHEL7.
David Smith [Thu, 16 Jun 2016 17:26:06 +0000 (12:26 -0500)]
Make some small improvements to [nd_]syscall.fanotify_mark for RHEL7.

* tapset/linux/syscalls.stp (syscall.fanotify_mark): Call
  __syscall_gate_compat_simple to avoid compat calls in the real syscall.
* tapset/linux/nd_syscalls.stp (nd_syscall.fanotify_mark): Ditto.
* testsuite/systemtap.syscall/fanotify.c: Make the fanotify file
  descriptor non-blocking, to avoid the testcase hanging on read.

8 years agoPR11637: Merge set_user_*() functions with master
Cody Santing [Thu, 16 Jun 2016 14:35:20 +0000 (10:35 -0400)]
PR11637: Merge set_user_*() functions with master

8 years agoPR11637: Updated probe point for test case
Cody Santing [Wed, 15 Jun 2016 17:04:06 +0000 (13:04 -0400)]
PR11637: Updated probe point for test case

8 years agoRHBZ1346112: let stap-server create ssl-cert on first run rather than install
Frank Ch. Eigler [Wed, 15 Jun 2016 14:58:01 +0000 (10:58 -0400)]
RHBZ1346112: let stap-server create ssl-cert  on first run rather than install

This way different container-images get different certs.

8 years agoPR11637: Completed test cases, updated documentation
Cody Santing [Wed, 15 Jun 2016 13:47:50 +0000 (09:47 -0400)]
PR11637: Completed test cases, updated documentation

/NEWS: Updated NEWS to include information about set_user_*() functions
/doc/SystemTap_Tapset_Referemce/tapsets.tmpl: Include new functions in tapsets documentation
/testsuite/systemtap.base/set_user.c: Generates user space address for use in test case
/testsuite/systemtap.base/set_user.stp: Updated test case to test all functions
/testsuite/systemtap.base/set_user_fail.stp: Removed test case

8 years agoFix pausing of probes in monitor mode
Felix Lu [Tue, 14 Jun 2016 16:41:59 +0000 (12:41 -0400)]
Fix pausing of probes in monitor mode

Commit 8df0d9e8fb2cc6 caused the probe conditions to be added later in
semantic_pass.

* elaborate.cxx: Add probe conditions early on.
* parse.cxx: parse_synthetic_probe - Set synthetic probe flag.
* staptree.h: struct probe - New synthetic flag.

8 years agoPartial 20236 fix: Add access_ok() to lookup_bad_addr().
David Smith [Tue, 14 Jun 2016 13:34:04 +0000 (08:34 -0500)]
Partial 20236 fix: Add access_ok() to lookup_bad_addr().

* runtime/linux/addr-map.c (lookup_bad_addr): Now calls access_ok(), which
  required the addition of a 'type' argument. In addition, there are now 2
  versions of lookup_bad_addr(), the new one doesn't bother searching the
  bad address database, since we don't populate that yet.
* runtime/dyninst/addr-map.c (lookup_bad_addr): Added dummy 'type'
  argument.
* runtime/linux/loc2c-runtime.h: Add either VERIFY_READ or VERIFY_WRITE to
  every lookup_bad_addr() call.

8 years agoRename @module_sizeof to @cast_module_sizeof
Josh Stone [Mon, 13 Jun 2016 18:08:08 +0000 (11:08 -0700)]
Rename @module_sizeof to @cast_module_sizeof

8 years agoAdd @cast_sizeof and @module_sizeof macros
Josh Stone [Mon, 13 Jun 2016 17:49:08 +0000 (10:49 -0700)]
Add @cast_sizeof and @module_sizeof macros

These embody the '& @cast(0, ...) [1]' pointer trick.

8 years agoAdd more syscall flags from mman.h
Josh Stone [Fri, 10 Jun 2016 20:55:59 +0000 (13:55 -0700)]
Add more syscall flags from mman.h

A few new MAP_*, PROT_*, and MADV_* flags are added to aux_syscalls.stp
and the relevant tests.

Some architectures have even more flags for compatibility, but don't do
anything with them.  I only included those that appear actively used.

8 years agoUpdate 4 syscall tests for rawhide.
David Smith [Fri, 10 Jun 2016 19:52:57 +0000 (14:52 -0500)]
Update 4 syscall tests for rawhide.

* testsuite/systemtap.syscall/recvmmsg.c: Skip a test that causes a
  SEGFAULT on rawhide's glibc.
* testsuite/systemtap.syscall/recvmsg.c: Ditto.
* testsuite/systemtap.syscall/sendmsg.c: Ditto.
* testsuite/systemtap.syscall/sendmmsg.c: Create our own version of
  sendmmsg(), since rawhide's glibc likes to substitute sendmsg() for
  sendmmsg().

8 years agoFix PR20192 by getting rid of RCU warnings.
David Smith [Fri, 10 Jun 2016 14:26:19 +0000 (09:26 -0500)]
Fix PR20192 by getting rid of RCU warnings.

* runtime/linux/runtime_context.h: Make sure all accesses to the contexts
  array use rcu functions.

8 years agoRHBZ1230463: systemtap.spec: remove glibc-headers buildrequires
Frank Ch. Eigler [Wed, 8 Jun 2016 15:01:19 +0000 (11:01 -0400)]
RHBZ1230463: systemtap.spec: remove glibc-headers buildrequires

We are reliably informed that this is unnecessary, and may
become harmful someday if glibc changes its subpackaging scheme.

8 years agoFix PR20211 by aimplementing the "resume mode" of the testsuite.
Martin Cermak [Wed, 8 Jun 2016 10:47:00 +0000 (12:47 +0200)]
Fix PR20211 by aimplementing the "resume mode" of the testsuite.

Once the SYSTEMTAP_TESTSUITE_RESUME environmental variable is set
to some non-zero value, the testsuite can run in "resume mode".

In this mode, tests, that have previously been run, are not being
re-executed, and their existing test results are being reused and
merged instead.

This can be useful e.g. when some of the tests causes kernel panic
or stall. Using the "resume mode", it is possible to reboot the
testing box, and re-run the testsuite skipping already executed
tests (incl. the one that caused the panic or stall - which will
stay "unfinished").

The "make list-unfinished" lists all such unfinished testcases.
Those need additional investigation.

The "resume mode" can be used with "make installcheck", or
"make installcheck-parallel".

8 years ago11637: Added test cases, added to set_user_* functions
Cody Santing [Tue, 7 Jun 2016 15:29:12 +0000 (11:29 -0400)]
11637: Added test cases, added to set_user_* functions

tapset/uconversion-guru.stp : Added deref_fault handlers, /* guru */ tag as well as comments.
testsuite/systemtap.base/set_user.c: Used to generate user space address
testsuite/systemtap.base/set_user.exp: Added to incorporate into testsuite
testsuite/systemtap.base/set_user.stp: Calls set_user_* functions and confirms values written to correct address
testsuite/systemtap.base/set_user_fail.stp:  Attempt to write to kernel space address

8 years agoRun publicanize.sh as a part of update-docs.
Martin Cermak [Tue, 7 Jun 2016 09:11:05 +0000 (11:11 +0200)]
Run publicanize.sh as a part of update-docs.

* doc/Tapset_Reference_Guide/publicanize.sh: Use abspaths.
* scripts/update-docs: Run publicanize.sh too.

8 years agoMake syscall.kexec_load and syscall.kexec_load.return optional.
David Smith [Mon, 6 Jun 2016 14:39:38 +0000 (09:39 -0500)]
Make syscall.kexec_load and syscall.kexec_load.return optional.

* tapset/linux/syscalls.stp: Make syscall.kexec_load and
  syscall.kexec_load.return optional. kexec_load can be configured out of
  the kernel.

8 years agoUse std::to_string to lex_cast from integers
Josh Stone [Thu, 2 Jun 2016 20:12:02 +0000 (13:12 -0700)]
Use std::to_string to lex_cast from integers

I don't know any case where this makes a performance difference, but it
does reduce stap's .text by about 2%.

8 years agosys/sdt.h: add troubleshooting blurb
Frank Ch. Eigler [Thu, 2 Jun 2016 14:20:02 +0000 (10:20 -0400)]
sys/sdt.h: add troubleshooting blurb

8 years agoFix PR20189 by updating the vfs tapset.
David Smith [Wed, 1 Jun 2016 15:45:07 +0000 (10:45 -0500)]
Fix PR20189 by updating the vfs tapset.

* tapset/linux/vfs.stp: Handle removal of PAGE_CACHE_SIZE by defining our
  own _STP_PAGE_SIZE which is either PAGE_CACHE_SIZE or PAGE_SIZE.

8 years agoFix PR20187 by updating socket.recvmsg.
David Smith [Wed, 1 Jun 2016 14:49:03 +0000 (09:49 -0500)]
Fix PR20187 by updating socket.recvmsg.

* tapset/linux/socket.stp: Fix 'size' convenience variable of
  socket.recvmsg for newer kernels.

8 years agoPR11637: Added set_user_* functionality
Cody Santing [Tue, 31 May 2016 15:06:09 +0000 (11:06 -0400)]
PR11637: Added set_user_* functionality

runtime/linux/loc2c-runtime.h: added store_uderef_string function
tapset/uconversions-guru.stp: new functions allow writing to user space memory

8 years agofix parser, delay consuming ')'
Felix Lu [Fri, 27 May 2016 20:29:35 +0000 (16:29 -0400)]
fix parser, delay consuming ')'

8 years agoFix PR20136 by using the @const() operator across the tapsets.
Martin Cermak [Fri, 27 May 2016 19:44:53 +0000 (21:44 +0200)]
Fix PR20136 by using the @const() operator across the tapsets.

8 years agoRe-fix PR19926 by simplifying previous implementation.
Martin Cermak [Fri, 27 May 2016 19:41:49 +0000 (21:41 +0200)]
Re-fix PR19926 by simplifying previous implementation.

This reimplementation of the @const() operator (0a7eb12d191)
is based on PR20136, comment 3. It moves all the logic to the
parser.  No elaboration involved.

8 years agoMake expect_op_any lazier
Josh Stone [Fri, 27 May 2016 19:16:43 +0000 (12:16 -0700)]
Make expect_op_any lazier

- Work directly from an initializer_list instead of making a vector.
- Don't construct the error message until we're sure there's an error.

8 years agoFix build for RHEL6
Felix Lu [Fri, 27 May 2016 18:43:55 +0000 (14:43 -0400)]
Fix build for RHEL6

8 years agoFix PR20161 by handling VM_FAULT_MINOR being removed from rawhide kernels.
David Smith [Fri, 27 May 2016 18:08:36 +0000 (13:08 -0500)]
Fix PR20161 by handling VM_FAULT_MINOR being removed from rawhide kernels.

* tapset/linux/memory.stp (vm_fault_contains): Handle VM_FAULT_MINOR being
  undefined by treating it the same way we did when it had the value of 0.

8 years agoFix PR20158 by updating the runtime for the 4.6 kernel.
David Smith [Fri, 27 May 2016 16:19:03 +0000 (11:19 -0500)]
Fix PR20158 by updating the runtime for the 4.6 kernel.

* buildrun.cxx (compile_pass): Added autoconf-stacktrace_ops-int-address.c
  compile test.
* stack.c: (print_stack_address): If STAPCONF_STACKTRACE_OPS_INT_ADDRESS
  is defined, the function returns a int instead of being a void
  function.
* runtime/linux/autoconf-stacktrace_ops-int-address.c: New autoconf-style
  test.

8 years agoPR20056: add missing ==
Felix Lu [Thu, 26 May 2016 20:45:10 +0000 (16:45 -0400)]
PR20056: add missing ==

8 years agoPR20056: add a comment
Felix Lu [Thu, 26 May 2016 20:20:00 +0000 (16:20 -0400)]
PR20056: add a comment

8 years agoPR20056: improve parser error message
Felix Lu [Thu, 26 May 2016 20:06:19 +0000 (16:06 -0400)]
PR20056: improve parser error message

* parse.cxx: new function expect_op_any, use new function for expecting
  a list of alternatives.

8 years agoFix PR20131 by making wildcard library paths work in probe specifications.
David Smith [Thu, 26 May 2016 19:17:58 +0000 (14:17 -0500)]
Fix PR20131 by making wildcard library paths work in probe specifications.

* tapsets.cxx (dwarf_builder::build): Fix logic error with commit
  c30ff77. If the library path isn't fully resolved, then use the path the
  user specified.
* testsuite/systemtap.base/listing_mode.exp: Decrease failures by being
  more forgiving about getting a full library path in 'stap -l' output.

8 years agoPR19624: add test cases
Cody Santing [Tue, 24 May 2016 20:22:43 +0000 (16:22 -0400)]
PR19624: add test cases

testsuite/parseko/duplicateparam01.stp
testsuite/parseko/duplicateparam02.stp
testsuite/parseko/duplicateparam03.stp

8 years agoPR19624: Duplicate function paramater names are not detected
Cody Santing [Tue, 24 May 2016 19:01:43 +0000 (15:01 -0400)]
PR19624: Duplicate function paramater names are not detected

parse.cxx (do_parse_functiondecl): detects duplicate parameter names

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