]> sourceware.org Git - systemtap.git/commit
monitor mode: staprun revamp
authorFrank Ch. Eigler <fche@redhat.com>
Wed, 23 Mar 2016 14:48:28 +0000 (10:48 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Wed, 23 Mar 2016 15:01:13 +0000 (11:01 -0400)
commita1d9dcb556ada46de8ba87e3e55c6aab7ff480e4
tree37f7f2870361e38279b0e2aaf7f6d114f1c45132
parent4a01bc9963477e7f4fb3f83978656e05c385cf47
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.
staprun/mainloop.c
staprun/monitor.c
staprun/relay.c
staprun/staprun.h
This page took 0.0292 seconds and 5 git commands to generate.