]> sourceware.org Git - systemtap.git/log
systemtap.git
8 years agodwflpp: use fixed-size buffers for ldd parsing
Josh Stone [Tue, 3 May 2016 01:43:28 +0000 (18:43 -0700)]
dwflpp: use fixed-size buffers for ldd parsing

The dynamic string allocation causes trouble on RHEL5 -- %as is always
parsed as a float under C++11, but %ms requires glibc >= 2.7.  But we
already used a fixed buffer for the line, so additional fixed buffers
are not a big deal for its substrings.

8 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
Josh Stone [Mon, 2 May 2016 23:41:33 +0000 (16:41 -0700)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

8 years agoremote: use initializer lists to build cmd vectors
Josh Stone [Mon, 2 May 2016 20:36:56 +0000 (13:36 -0700)]
remote: use initializer lists to build cmd vectors

8 years agostap-serverd: use initializer lists to build cmd vectors
Josh Stone [Mon, 2 May 2016 20:04:15 +0000 (13:04 -0700)]
stap-serverd: use initializer lists to build cmd vectors

8 years agosession: use initializer lists to build cmd vectors
Josh Stone [Mon, 2 May 2016 19:51:26 +0000 (12:51 -0700)]
session: use initializer lists to build cmd vectors

8 years agocsclient: use initializer lists to build cmd vectors
Josh Stone [Mon, 2 May 2016 19:39:45 +0000 (12:39 -0700)]
csclient: use initializer lists to build cmd vectors

8 years agobuildrun: use initializer lists to build cmd vectors
Josh Stone [Mon, 2 May 2016 19:30:54 +0000 (12:30 -0700)]
buildrun: use initializer lists to build cmd vectors

8 years agoutil.h: double-check C++11 support
Josh Stone [Mon, 2 May 2016 18:29:41 +0000 (11:29 -0700)]
util.h: double-check C++11 support

8 years agoPlug preempt leak in _stp_runtime_entryfn_put/get_context.
Mateusz Guzik [Mon, 2 May 2016 17:28:55 +0000 (12:28 -0500)]
Plug preempt leak in _stp_runtime_entryfn_put/get_context.

If _stp_runtime_entryfn_get_context returns a context, preemption
counter is always incremented. On the other hand
_stp_runtime_entryfn_put_context only decrements the counter if the
passed context matches the one currently set on the cpu.

The context can be set to NULL by _stp_runtime_contexts_free, making the
comparison false and in effect leading to a leak, e.g.:
timer: _stp_ctl_work_callback+0x0/0x1e0[stap_af8544c7eb51251ef8c
 377abff659b05_25070] preempt leak: 00000101 -> 00000102

8 years agomonitor mode: remove pipe
Felix Lu [Fri, 29 Apr 2016 19:50:29 +0000 (15:50 -0400)]
monitor mode: remove pipe

Save output to monitor ring buffer directly instead of sending it
through a pipe.

* staprun/mainloop.c: remove pipe fd from fd set
* staprun/monitor.c: remove pipe data processing, add mutex for ring
  buffer
* staprun/relay.c:
  reader_thread - add line processing logic
  init_relayfs - remove pipe
* staprun/staprun.h - remove pipe

8 years agoFix: process.library.function failed with sysroot.
Torsten Polle [Wed, 3 Dec 2014 21:17:14 +0000 (22:17 +0100)]
Fix: process.library.function failed with sysroot.

Signed-off-by: Torsten Polle <Torsten.Polle@gmx.de>
8 years agoFix: Processes are not found.
Torsten Polle [Fri, 13 Jun 2014 20:36:44 +0000 (22:36 +0200)]
Fix: Processes are not found.

If sysroot is set, module_val will get sysroot as prefix. But
is_fully_resolved() is appending sysroot once more.

Signed-off-by: Torsten Polle <Torsten.Polle@gmx.de>
8 years agoFix: Debug links are not found if the sysroot is used.
Torsten Polle [Thu, 6 Mar 2014 20:38:49 +0000 (21:38 +0100)]
Fix: Debug links are not found if the sysroot is used.

Signed-off-by: Torsten Polle <Torsten.Polle@gmx.de>
8 years agoSupport the sysroot option for modules added for symbol/unwind information
Torsten Polle [Fri, 13 Dec 2013 22:26:07 +0000 (23:26 +0100)]
Support the sysroot option for modules added for symbol/unwind information

The sysroot option failed for modules added for their symbol/unwind
information. Those user module names are prepended by sysroot.

Signed-off-by: Torsten Polle <Torsten.Polle@gmx.de>
8 years agoSpecialize hash<interned_string> for the different implementations
Josh Stone [Sat, 30 Apr 2016 01:54:29 +0000 (18:54 -0700)]
Specialize hash<interned_string> for the different implementations

We need the custom hash for boost::string_ref, but the fallback based on
std::string can just forward its hashing.

Also note C++17's std::string_view, which hashes natively.

8 years agonote the possible use of std::string_view
Josh Stone [Sat, 30 Apr 2016 01:34:07 +0000 (18:34 -0700)]
note the possible use of std::string_view

8 years agoDissolve unordered.h
Josh Stone [Sat, 30 Apr 2016 01:30:34 +0000 (18:30 -0700)]
Dissolve unordered.h

8 years agoUse std::unordered_map et al
Josh Stone [Sat, 30 Apr 2016 00:56:01 +0000 (17:56 -0700)]
Use std::unordered_map et al

8 years agoRemove the unused auto_free.h
Josh Stone [Sat, 30 Apr 2016 00:29:59 +0000 (17:29 -0700)]
Remove the unused auto_free.h

If anyone wants similar functionality again, unique_ptr and shared_ptr
can take custom deleters, e.g. std::unique_ptr(p, std::free);

8 years agoUse make_shared for creating exp_types
Josh Stone [Sat, 30 Apr 2016 00:22:05 +0000 (17:22 -0700)]
Use make_shared for creating exp_types

8 years agoAlways use std::shared_ptr rather than boost's
Josh Stone [Sat, 30 Apr 2016 00:02:01 +0000 (17:02 -0700)]
Always use std::shared_ptr rather than boost's

Also demonstrate better "auto" and "make_shared" use in stapdyn.

8 years agoAssume unique_ptr is available now
Josh Stone [Fri, 29 Apr 2016 23:11:33 +0000 (16:11 -0700)]
Assume unique_ptr is available now

8 years agostapdyn: always use decltype instead of typeof
Josh Stone [Fri, 29 Apr 2016 22:49:42 +0000 (15:49 -0700)]
stapdyn: always use decltype instead of typeof

The former is standard C++11, and the latter is a compiler extension.
They work equivalently as used here.

8 years agoautoreconf -i
Josh Stone [Fri, 29 Apr 2016 22:48:34 +0000 (15:48 -0700)]
autoreconf -i

8 years agoconfigure: make C++11 mandatory
Josh Stone [Fri, 29 Apr 2016 22:09:56 +0000 (15:09 -0700)]
configure: make C++11 mandatory

We'll use RHEL6 (GCC 4.4) as our baseline.  This doesn't have full C++11
support, but it's enough for us to see some benefit.

8 years agoImproved fake utrace locking.
David Smith [Thu, 28 Apr 2016 15:59:50 +0000 (10:59 -0500)]
Improved fake utrace locking.

* runtime/stp_utrace.c: Fixed potential locking issues by changing the
  'task_work_added' and 'report_work_added' members of 'struct
  utrace' to be atomic variables. In the process, I also renamed
  'task_work_added' to 'resume_work_added'. As atomice variables, they can
  be modified without locking the utrace struct. Also renamed the 'work'
  member of 'struct utrace' to 'resume_work' (to match up with
  'resume_work_added').

8 years agoFix PR19954 by avoiding "suspicious RCU usage" message.
David Smith [Thu, 28 Apr 2016 15:20:47 +0000 (10:20 -0500)]
Fix PR19954 by avoiding "suspicious RCU usage" message.

* runtime/transport/symbols.c (_stp_module_update_self): Properly handle
  RCU locking when retrieving the 'kallsyms' member of the module
  structure.

8 years agomonitor mode: some improvements
Felix Lu [Wed, 27 Apr 2016 20:38:59 +0000 (16:38 -0400)]
monitor mode: some improvements

Increased size of help window, fixed probe list scrolling

8 years agoPR20013: stap --dump-functions broken
Felix Lu [Wed, 27 Apr 2016 18:29:26 +0000 (14:29 -0400)]
PR20013: stap --dump-functions broken

8 years agomonitor mode: some refactoring, add a border to status window
Felix Lu [Wed, 27 Apr 2016 17:10:58 +0000 (13:10 -0400)]
monitor mode: some refactoring, add a border to status window

8 years agostaprun: reinstate -d '*' operation
Frank Ch. Eigler [Tue, 26 Apr 2016 21:02:33 +0000 (17:02 -0400)]
staprun: reinstate -d '*' operation

PR14245 created a new relay_basedir_fd variable, for use when
staprun/stapio passes staprun a file descriptor for the base directory
of the sysfs systemtap-module directory.  (This is necessary in order
to get around 0700 mount-dir permissions.)  This broke staprun -d '*'
operation, since that variable got set (badly) once within the readdir
loop, and thence made actual removes inoperative.  Now we clear out
that variable so each actual module subdirectory will get a good
cleaning.

8 years agomonitor mode: bugfix
Felix Lu [Tue, 26 Apr 2016 20:48:27 +0000 (16:48 -0400)]
monitor mode: bugfix

Fix an off by 1 error and always flush output.

8 years agomonitor mode: Use pop up panel for help message
Felix Lu [Mon, 25 Apr 2016 17:54:44 +0000 (13:54 -0400)]
monitor mode: Use pop up panel for help message

8 years agomonitor mode: simplify scrolling
Felix Lu [Fri, 22 Apr 2016 18:04:51 +0000 (14:04 -0400)]
monitor mode: simplify scrolling

Tab is now used to select the window to perform scrolling on.

8 years agoFix PR19990 by updating runtime/linux/access_process_vm.h.
David Smith [Mon, 25 Apr 2016 15:02:36 +0000 (10:02 -0500)]
Fix PR19990 by updating runtime/linux/access_process_vm.h.

* runtime/linux/access_process_vm.h (__access_process_vm_): Use
  get_user_pages_remote() when available.
* buildrun.cxx (compile_pass): Added export test for
  'get_user_pages_remote()'.

8 years agoAvoid using tcl exec command "-ignorestderr" option
William Cohen [Fri, 15 Apr 2016 19:15:22 +0000 (15:15 -0400)]
Avoid using tcl exec command "-ignorestderr" option

In older versions of tcl the exec command does not support the
"-ignorestderr" option.  Changed the code to redirected the stderr
output to /dev/null which works on both older and newer versions of
tcl.

8 years agoinstallcheck-parallel: show end of systemtap.sum when done
Frank Ch. Eigler [Thu, 14 Apr 2016 19:25:54 +0000 (15:25 -0400)]
installcheck-parallel: show end of systemtap.sum when done

8 years agoRemove empty script file warning for tapset files
Felix Lu [Wed, 13 Apr 2016 21:24:22 +0000 (17:24 -0400)]
Remove empty script file warning for tapset files

Empty tapset files warnings are now suppressed and not removed.
Empty user level scripts still have this warning.

8 years agoAutoreconf following commit 6a32afe.
Martin Cermak [Wed, 13 Apr 2016 17:24:55 +0000 (19:24 +0200)]
Autoreconf following commit 6a32afe.

8 years agoFix testsuite's installcheck-parallel behavior for stap not in $PATH.
Martin Cermak [Wed, 13 Apr 2016 17:19:49 +0000 (19:19 +0200)]
Fix testsuite's installcheck-parallel behavior for stap not in $PATH.

This fixes the testsuite's installcheck-parallel target so that it
works even when stap binary resides on some place not referenced
within $PATH.

Note that we want to stop the testing in case environment_sanity.exp
fails.  For this reason we need to avoid calling runtest using
the execrc script.

8 years agoRemove a blacklist regular expression that wasn't needed.
David Smith [Wed, 13 Apr 2016 15:11:17 +0000 (10:11 -0500)]
Remove a blacklist regular expression that wasn't needed.

* dwflpp.cxx (build_kernel_blacklist): Removed a blacklist regexp,
  "|raw_.*", since it didn't seem to match any locking functions as it was
  supposed to do.

8 years agoMove the testsuite's artifacts directory to the builddir.
Martin Cermak [Wed, 13 Apr 2016 13:31:33 +0000 (15:31 +0200)]
Move the testsuite's artifacts directory to the builddir.

This update is a response to PR10791#c15. It moves the artifacts
directory, introduced in commit 8093ef39b, to the build directory
avoiding writes to the source directory.

8 years agoModify the dry run mode for the network/socktop example.
Martin Cermak [Wed, 13 Apr 2016 13:22:10 +0000 (15:22 +0200)]
Modify the dry run mode for the network/socktop example.

We want to avoid testsuite writing into the source directory.
Before this update, when socktop has been run by check.exp as
a part of the testsuite run, it was copying the module to the
working directory.  We want to avoid this.

8 years agoFixed PR19940 by updating runtime/linux/access_process_vm.h.
David Smith [Mon, 11 Apr 2016 19:07:25 +0000 (14:07 -0500)]
Fixed PR19940 by updating runtime/linux/access_process_vm.h.

* runtime/linux/access_process_vm.h: Changed page_cache_release() to
  put_page().

8 years agoTerminate testsuite run if compiler sanity test fails.
Martin Cermak [Mon, 11 Apr 2016 07:55:20 +0000 (09:55 +0200)]
Terminate testsuite run if compiler sanity test fails.

Ensure that the testsuite run terminates right at the beginning
if compiler sanity test fails.  This notably ensures that required
headers, object files and libraries are in place for the main arch,
as well as for the compat arch in the multilib environment.

8 years agoFix PR19905 by adding support for the preadv2/pwritev2 syscalls.
David Smith [Fri, 8 Apr 2016 18:59:04 +0000 (13:59 -0500)]
Fix PR19905 by adding support for the preadv2/pwritev2 syscalls.

* tapset/linux/syscalls2.stp: Added preadv2/pwritev2 syscall probes.
* tapset/linux/nd_syscalls2.stp: Ditto.
* tapset/linux/aux_syscalls.stp (_preadv2_flags_str): New function.
* testsuite/systemtap.syscall/preadv.c: Added preadv2() testing.
* testsuite/systemtap.syscall/pwritev.c: Added pwritev2() testing.

8 years agoImprove 64-bit file offset handling in syscall.preadv and syscall.pwritev.
David Smith [Fri, 8 Apr 2016 18:40:04 +0000 (13:40 -0500)]
Improve 64-bit file offset handling in syscall.preadv and syscall.pwritev.

* tapset/linux/syscalls2.stp (syscall.preadv): Improve handling of 64-bit
  offsets.
  (syscall.pwritev): Ditto.
* testsuite/systemtap.syscall/preadv.c: Turn on 64-bit file offsets and
  add tests to make sure we're decoding them properly.
* testsuite/systemtap.syscall/pwritev.c: Ditto.

8 years agoAdd missing asmlinkage() calls to nd_syscall.{membarrier,userfaultfd}.
David Smith [Thu, 7 Apr 2016 14:04:20 +0000 (09:04 -0500)]
Add missing asmlinkage() calls to nd_syscall.{membarrier,userfaultfd}.

* tapset/linux/nd_syscalls.stp (nd_syscall.membarrier): Add missing
  asmlinkage() call.
* tapset/linux/nd_syscalls2.stp (nd_syscall.userfaultfd): Ditto.

8 years agoAdd the testsuite parallel testing feature.
Martin Cermak [Wed, 6 Apr 2016 19:37:03 +0000 (21:37 +0200)]
Add the testsuite parallel testing feature.

This merges updates from the mcermak/paralleltest branch into the master.

8 years agoFix PR19915 by correctly updating the wsize.
Martin Cermak [Wed, 6 Apr 2016 15:22:43 +0000 (17:22 +0200)]
Fix PR19915 by correctly updating the wsize.

8 years agotapset docs: ctime overloading
Frank Ch. Eigler [Tue, 5 Apr 2016 15:11:55 +0000 (11:11 -0400)]
tapset docs: ctime overloading

Vincent Bernat reported problems building with --enable-htmldocs due
to the newly overloaded ctime() function docs.  Tweak the /** */
docs for the second overload, so as to suffer errors in neither
html nor pdf build phases.

8 years agoFix typo in SystemTap_Tapset_Reference/man3
Masanari Iida [Thu, 31 Mar 2016 04:04:45 +0000 (13:04 +0900)]
Fix typo in SystemTap_Tapset_Reference/man3

This patch fix some spelling typos found in
doc/SystemTap_Tapset_Reference/man3.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
8 years agoFinish fixing PR19882 by updating support for the copy_file_range() syscall.
David Smith [Wed, 30 Mar 2016 17:23:27 +0000 (12:23 -0500)]
Finish fixing PR19882 by updating support for the copy_file_range() syscall.

* tapset/linux/syscalls.stp: Corrected argstr formatting for
  'copy_file_range'.
* tapset/linux/nd_syscalls.stp: Corrected argstr formatting and types for
  'copy_file_range'.
* testsuite/buildok/nd_syscalls-detailed.stp: Updated copy_file_range test.
* testsuite/buildok/syscalls-detailed.stp: Ditto.
* testsuite/systemtap.syscall/copy_file_range.c: Got copy_file_range()
  test working.

8 years agoPR19882: add copy_file_range syscall supportt
Abegail Jakop [Tue, 29 Mar 2016 23:03:32 +0000 (19:03 -0400)]
PR19882: add copy_file_range syscall supportt

tapset/linux/nd_syscalls.stp: kprobe based syscall probe for
copy_file_range syscall
tapset/linux/syscalls.stp: kernel function based syscall probe for
copy_file_range syscall
buildok/[nd_]syscalls-detailed.stp: basic buildok tests for the new
probe points
copy_file_range.c: test file to check new tapset functionality

8 years agoAdd tests for 2 new functions in buildok/aux_syscalls-embedded.stp.
David Smith [Wed, 30 Mar 2016 14:54:21 +0000 (09:54 -0500)]
Add tests for 2 new functions in buildok/aux_syscalls-embedded.stp.

8 years agoCleaned up 'pure' and 'unprivileged' annotations in aux_syscalls.stp.
David Smith [Wed, 30 Mar 2016 14:49:30 +0000 (09:49 -0500)]
Cleaned up 'pure' and 'unprivileged' annotations in aux_syscalls.stp.

* tapset/linux/aux_syscalls.stp: Cleaned up. Marked _membarrier_cmd_str()
  as a string function. Audited all functions and constants to make sure
  they are marked as 'pure' and 'unprivileged' when needed.

8 years agoFix PR19876 by adding tapset support for the 'userfaultfd' system call.
David Smith [Tue, 29 Mar 2016 19:53:20 +0000 (14:53 -0500)]
Fix PR19876 by adding tapset support for the 'userfaultfd' system call.

* tapset/linux/syscalls2.stp: Add support for the 'userfaultfd' system
  call.
* tapset/linux/nd_syscalls.stp: Ditto.
* tapset/linux/aux_syscalls.stp (_userfaultfd_flags_str): New function.
  (_sys_pipe2_flag_str): Added O_DIRECT to the list of supported flags.
* testsuite/buildok/syscalls2-detailed.stp: Add userfaultfd test.
* testsuite/buildok/nd_syscalls2-detailed.stp: Ditto.
* testsuite/systemtap.syscall/userfaultfd.c: Add new
  syscall.exp/nd_syscall.exp test case.

8 years agoFix PR19875 by adding tapset support for the 'membarrier' system call.
David Smith [Tue, 29 Mar 2016 16:29:40 +0000 (11:29 -0500)]
Fix PR19875 by adding tapset support for the 'membarrier' system call.

* tapset/linux/syscalls.stp: Add support for the 'membarrier' system
  call.
* tapset/linux/nd_syscalls.stp: Ditto.
* tapset/linux/aux_syscalls.stp (_membarrier_cmd_str): New function.
* testsuite/buildok/syscalls-detailed.stp: Add membarrier test.
* testsuite/buildok/nd_syscalls-detailed.stp: Ditto.
* testsuite/systemtap.syscall/membarrier.c: Add new
  syscall.exp/nd_syscall.exp test case.

8 years agoFix the interactive stap's buildok-interactive.exp test case.
David Smith [Tue, 29 Mar 2016 16:25:01 +0000 (11:25 -0500)]
Fix the interactive stap's buildok-interactive.exp test case.

* testsuite/lib/stapi.exp (stapi_start): Set the interactive stap's
  termibnal to 4096 columns, to avoid problems with long pathnames needing
  to scroll.
* testsuite/systemtap.pass1-4/buildok-interactive.exp: Tweak switch
  statements so that tcl will know when the arguments stop. This was
  bothering RHEL5's ancient tcl (8.4.3).

8 years agoAdd kernel support-range to stap -V output and other PRERELEASE markers.
Frank Ch. Eigler [Tue, 29 Mar 2016 14:10:07 +0000 (10:10 -0400)]
Add kernel support-range to stap -V output and other PRERELEASE markers.

8 years agoRHBZ1321628: temporarily suppress CONFIG_STACK_VALIDATION=
Frank Ch. Eigler [Mon, 28 Mar 2016 19:10:13 +0000 (15:10 -0400)]
RHBZ1321628: temporarily suppress CONFIG_STACK_VALIDATION=

Something in kernel 4.6.0-rc0 is interfering with our makefiles.

8 years agocopyright year bump
Frank Ch. Eigler [Mon, 28 Mar 2016 16:14:16 +0000 (12:14 -0400)]
copyright year bump

8 years agoPR19874: reset 60s alarm for "stap -c CMD"
Frank Ch. Eigler [Mon, 28 Mar 2016 12:54:11 +0000 (08:54 -0400)]
PR19874: reset 60s alarm for "stap -c CMD"

Brown paper bag bug.  Test case included.

8 years agoroutine configury prep for future 3.1 release
Frank Ch. Eigler [Mon, 28 Mar 2016 02:19:50 +0000 (22:19 -0400)]
routine configury prep for future 3.1 release

8 years agopre-release docs rebuild release-3.0
Frank Ch. Eigler [Mon, 28 Mar 2016 00:33:04 +0000 (20:33 -0400)]
pre-release docs rebuild

Updated the tapset-doc-filter overload.py to more accurately
process overloaded entities.  One should count by 'programlisting'
nodes, not by 'para', which can repeat within any single overload.

8 years agoAUTHORS bump
Frank Ch. Eigler [Sun, 27 Mar 2016 20:46:14 +0000 (16:46 -0400)]
AUTHORS bump

8 years agoPR19873: staprun -o BADFILE -c CMD cleanup
Frank Ch. Eigler [Sun, 27 Mar 2016 18:45:01 +0000 (14:45 -0400)]
PR19873: staprun -o BADFILE -c CMD cleanup

* staprun/mainloop.c (start_cmd): Close fd >= 3 to ensure no dangling
  reference to the stap module /.cmd file.  Set an alarm timeout, in
  case the parent process goes away and forgets to send us our SIGUSR
  to exec the CMD.

8 years agostaprun: tweak the -o path-pattern length limiting
Frank Ch. Eigler [Sun, 27 Mar 2016 18:43:56 +0000 (14:43 -0400)]
staprun: tweak the -o path-pattern length limiting

cpuNNN is too limited, considering we can have cpus beyond serial
number 999.  Bump it way up.  999999 cpus should be enough for
anybody.

8 years agotestsuite examples check.exp: Don't try to clean up output files.
Frank Ch. Eigler [Sun, 27 Mar 2016 18:42:00 +0000 (14:42 -0400)]
testsuite examples check.exp: Don't try to clean up output files.

Scraping file name patterns out of a test_installcheck command line
is fragile, undocumented, and unnecessary.  Plus if the code failed,
it could error out of the whole .exp file.  Stop trying to clean
this up.

8 years agomade some tasty update-po soup
Frank Ch. Eigler [Sat, 26 Mar 2016 01:22:09 +0000 (21:22 -0400)]
made some tasty update-po soup

8 years agoPR19833: turn cleanup_module / init_module inside out
Frank Ch. Eigler [Sat, 26 Mar 2016 00:44:43 +0000 (20:44 -0400)]
PR19833: turn cleanup_module / init_module inside out

Sort of ... at least, make the synthetic systemtap_kernel_module_{init,exit}
unctions the outermost rather than innermost wrapping layer.  This is because
in the procfs case, the synthetic _exit function can run first (if the
module's being rmmod'd without an STP_EXIT message), and the subsequent
transport / belated-stap-probe-cleanup code can run second.  That's bad
if the former tries to nuke /proc/systemtap/$DIR while the latter still
has subdirectories/files it wants to clean up (such as for procfs.read
objects).

So now we make the /proc/systemtap/$DIR [de]construction be fairly far out.

8 years agostap driver: close $HOME/.systemtap/rc file after reading
Frank Ch. Eigler [Fri, 25 Mar 2016 18:48:05 +0000 (14:48 -0400)]
stap driver: close $HOME/.systemtap/rc file after reading

The ifstream stayed open too long (and was even passed to child processes).

8 years agotranslate.cxx monitor_status probe: add try/catch
Frank Ch. Eigler [Fri, 25 Mar 2016 00:20:20 +0000 (20:20 -0400)]
translate.cxx monitor_status probe: add try/catch

Tolerate overflow of the procfs output buffer used for collecting the
monitor_status JSON content.  Also, come up with a reasonable WAG for
how much data we might write.  It could be far more than 8K if we're
talking about scripts with hundreds of probes.

8 years agomonitor mode: show some status even for exited script
Frank Ch. Eigler [Fri, 25 Mar 2016 00:19:27 +0000 (20:19 -0400)]
monitor mode: show some status even for exited script

Retain the parsed json object from refresh to refresh, so in case
the module exits, we still can draw a curses window from the last
available content.  (Print a reasonable error message otherwise.)

8 years agoMonitor mode: Don't display EXITED in default help
Felix Lu [Thu, 24 Mar 2016 19:06:20 +0000 (15:06 -0400)]
Monitor mode: Don't display EXITED in default help

The else block was being executed in help state.

8 years agoMonitor mode: add faster output scrolling hotkeys
Felix Lu [Thu, 24 Mar 2016 15:41:51 +0000 (11:41 -0400)]
Monitor mode: add faster output scrolling hotkeys

8 years agoMonitor mode: add option to hide status window
Felix Lu [Thu, 24 Mar 2016 15:14:30 +0000 (11:14 -0400)]
Monitor mode: add option to hide status window

This allows users to use the entire window for output.

8 years agoMake sure monitor pipe file descriptors are marked close-on-exec.
David Smith [Thu, 24 Mar 2016 14:35:25 +0000 (09:35 -0500)]
Make sure monitor pipe file descriptors are marked close-on-exec.

* staprun/relay.c (init_relayfs): Make sure pipe fds are marked
  close-on-exec.
* staprun/common.c (pipe_cloexec): New function.
* staprun/staprun.h: Add pipe_cloexec() prototype.

8 years agostaprun/monitor.c: build under -std=c90-ish
Frank Ch. Eigler [Thu, 24 Mar 2016 10:42:31 +0000 (06:42 -0400)]
staprun/monitor.c: build under -std=c90-ish

No  ... for(int i ...  for you!

8 years agostaprun monitor: handle !HAVE_MONITOR_LIBS case differently
Frank Ch. Eigler [Thu, 24 Mar 2016 10:24:57 +0000 (06:24 -0400)]
staprun monitor: handle !HAVE_MONITOR_LIBS case differently

Instead of stub inlines in staprun.h, put real stub functions into
monitor.c, which is now compiled even iun the !HAVE_MONITOR_LIBS case.

8 years agoRHBZ1319085 cont'd: #undef delay() before redefining it
Frank Ch. Eigler [Thu, 24 Mar 2016 10:23:28 +0000 (06:23 -0400)]
RHBZ1319085 cont'd: #undef delay() before redefining it

8 years agoelaborate.cxx: tweak monitor mode globals representaton
Frank Ch. Eigler [Thu, 24 Mar 2016 00:42:02 +0000 (20:42 -0400)]
elaborate.cxx: tweak monitor mode globals representaton

Fix the quoting in the generated procfs("monitor_status") probe
so that values of globals are properly quoted in the JSON stream.

8 years agostapio main loop: always time out on pselect()
Frank Ch. Eigler [Wed, 23 Mar 2016 22:02:15 +0000 (18:02 -0400)]
stapio main loop: always time out on pselect()

The main thread's pselect() call must now get a timeout setting too,
because it is responsible for orderly shutdown of the stap module in
case of interrupts.  Without a polling timeout, the pselect() can just
sit there, with other reader threads happily continuing their work,
as though the ^C never took effect.

8 years agoFix staprun compile error when HAVE_MONITOR_LIBS isn't defined.
David Smith [Wed, 23 Mar 2016 20:44:10 +0000 (15:44 -0500)]
Fix staprun compile error when HAVE_MONITOR_LIBS isn't defined.

* staprun/common.c (monitor_winch): Add empty function when
  HAVE_MONITOR_LIBS isn't defined, to make the compiler happy. This is
  necessary since the function's address is used in setup_main_signals().
* staprun/staprun.h: When HAVE_MONITOR_LIBS isn't defined, change
  monitor_winch() from an inline function to a declaration.

8 years agoAvoid "make distclean" removing removing various man pages
William Cohen [Wed, 23 Mar 2016 20:10:17 +0000 (16:10 -0400)]
Avoid "make distclean" removing removing various man pages

The man pages are not generated by the regular "make". They are now
generated using a special step and are now part of the sources.  The
"make distclean" should not remove these prebuilt pages.

8 years agoRHBZ1320691: correct path to /sbin/new-kernel-pkg
Frank Ch. Eigler [Wed, 23 Mar 2016 18:24:15 +0000 (14:24 -0400)]
RHBZ1320691: correct path to /sbin/new-kernel-pkg

This name works on older distros as well as /usr-move ones.

8 years agotapset: add ctime() 0-argument overload
Frank Ch. Eigler [Wed, 23 Mar 2016 17:56:50 +0000 (13:56 -0400)]
tapset: add ctime() 0-argument overload

8 years agofix monitor mode: output was being limited to first n rows
Felix Lu [Wed, 23 Mar 2016 17:40:28 +0000 (13:40 -0400)]
fix monitor mode: output was being limited to first n rows

8 years agomonitor mode: staprun revamp
Frank Ch. Eigler [Wed, 23 Mar 2016 14:48:28 +0000 (10:48 -0400)]
monitor mode: staprun revamp

A group of changes for usability & stability of the staprun side of
--monitor mode.  The gist of it is to let staprun persist awhile after
a script exits (whether interactively commanded with 'q', or with the
script exiting due to an exit/error), so that its outputs can be seen.

* monitor.c (monitor_state): Add new "exited" and "exited_help" states.
  (monitor_render): Remove code that reads input from module.
  Support exited_help subset text.
  (monitor_remember_output_line): New utility function to strndup
  module output lines into our circular buffer.
  (monitor_input): Revamp logic to use read(2) syscalls instead of
  temporary fdopen() FILEs to read from module-output pipe, for
  several reasons.
  (monitor_exited): New function to enter exited state.
* relay.c (reader_thread): Use write(2) loop when feeding output
  pipe/file, in case it gets full.
  (init_relayfs): Drop F_SETPIPE_SZ; it is not needed with write loop
  here and proper nonblocking read on other side.
* mainloop.c (signal_thread): Keep it running after each signal, just
  in case a ^C is repeated.  Encode SIGQUIT with a set to 'load_only'
  instead of pending_interrupts count.
  (stp_main_loop): Treat several startup-time errors as worthy of
  stap module removal/cleanup rather than detaching.  Within main
  loop proper, call cleanup_and_exit upon pending_interrupts, as
  the single standard spot where a stap module shutdown from any
  cause should come.  Redirect warning/error messages to monitor
  output buffer.  Notify monitor code of received STP_EXIT message.
* staprun.h: Provide inline-void stub functions for the !MONITOR_LIBS
  case.

8 years agoAdd logging to systemtap.base/strftime.exp.
David Smith [Tue, 22 Mar 2016 16:22:31 +0000 (11:22 -0500)]
Add logging to systemtap.base/strftime.exp.

* testsuite/systemtap.base/strftime.exp: Add logging so that we can better
  see what is going on.

8 years agoAdd some missing documentation
Felix Lu [Tue, 22 Mar 2016 13:54:54 +0000 (09:54 -0400)]
Add some missing documentation

Add "private" keyword in stapref and use of "next" in functions.

8 years agoFix PR17393 by improving the way we execute "system" commands.
David Smith [Mon, 21 Mar 2016 22:08:59 +0000 (17:08 -0500)]
Fix PR17393 by improving the way we execute "system" commands.

* staprun/common.c (open_cloexec): New function.
  (openat_cloexec): Ditto.
  (closefrom): ditto.
* staprun/staprun.h: Add prototypes for new functions.
* staprun/ctl.c (init_ctl_channel): Before trying to open the control
  channel, make sure it isn't open already. Use openat_cloexec() and
  open_cloexec() when opening the control channel. Remove unneeded call to
  set_clexec().
* staprun/relay.c (open_outfile): Use open_cloexec(). Remove unneeded call
  to set_clexec().
  (init_relayfs): Ditto.
* staprun/relay_old.c (open_relayfs_files): Ditto.
  (init_oldrelayfs): Ditto.
* staprun/mainloop.c (start_cmd): Add comment explaining the closefrom()
  isn't needed here.
  (system_cmd): Wait until the child has closed everything (by calling
  closefrom) before returning.
* staprun/staprun.c (term_signal_handler): Remove unneeded call to
  close_ctl_channel(), since remove_module() now calls it.

8 years agoMonitor mode: clamp probe list scrolling
Felix Lu [Mon, 21 Mar 2016 20:31:07 +0000 (16:31 -0400)]
Monitor mode: clamp probe list scrolling

Previously, the probe list could be scrolled beyond the number of probes
available and display an empty list. This also made it harder to scroll
up. Also, the number of script probes is now extracted using the json list.

8 years agoMonitor mode: display number of script probes
Felix Lu [Mon, 21 Mar 2016 14:56:42 +0000 (10:56 -0400)]
Monitor mode: display number of script probes

8 years agoRemove monitor mode global mangling
Felix Lu [Mon, 21 Mar 2016 14:13:27 +0000 (10:13 -0400)]
Remove monitor mode global mangling

Commit 87103d2b32ea873721 does not mangle variable names
during the search so the synthetic monitor_enabled variables could
not be found. Those synthetic variables are now not mangled to
allow them to be found.

8 years agomonitor mode: add 'q' keystroke to quit
Frank Ch. Eigler [Sun, 20 Mar 2016 23:18:49 +0000 (19:18 -0400)]
monitor mode: add 'q' keystroke to quit

It'll be nice to have a sequence other than ^C to cause an exit, so
that e.g. we can review output / diagnostics after the script quit.
Switching to 'h' to flip between help screen and normal mode, to avoid
accidental 'q'.

8 years agomonitor mode: deconflict with private global mangling
Frank Ch. Eigler [Sun, 20 Mar 2016 22:22:01 +0000 (18:22 -0400)]
monitor mode: deconflict with private global mangling

The synthesized probe body for monitor mode control needs to refer to
globals that may be declared private inside a tapset, in order to
clear them.  It needs to pierce the mangling-based name-hiding, so
that when the synthetic fragment is symbol-resolved, it will find the
mangled private globals to manipulate.  This is implemented by an
optional mode-flag in the symresolution_info class to suppress
global-mangling.

The test script was:

   stap --monitor -p4 -e 'probe nd_syscall.* {}' -v

8 years agotranslator: PR13283 redux, optimize string comparison again
Frank Ch. Eigler [Sun, 20 Mar 2016 22:20:49 +0000 (18:20 -0400)]
translator: PR13283 redux, optimize string comparison again

With the function-overloading machinery now assuring that function
calls translate to full temporaries to hold return values, we no
longer need to make yet another copy just to evaluate string
comparisons.

8 years agoPR13283: make strcmp test case run in -u mode also
Frank Ch. Eigler [Sun, 20 Mar 2016 22:20:16 +0000 (18:20 -0400)]
PR13283: make strcmp test case run in -u mode also

8 years agoprocfs write probe: optimize with /* stable */
Frank Ch. Eigler [Sun, 20 Mar 2016 13:43:18 +0000 (09:43 -0400)]
procfs write probe: optimize with /* stable */

The synthetic ...procfs_value_get function used in procfs().write
probes should be considered stable, so its calls can be optimized.

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