| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
* runtime/staprun/relay.c (reader_thread): Check switch_file thread flags
inside inner read-write loop. And clear the flags after switching file.
|
|
|
|
|
|
|
| |
* runtime/staprun/staprun.h: Put ppoll() declaration here (so that
relay_old.c can use it).
* runtime/staprun/relay.c (ppoll): Made ppoll() non-static so that
relay_old.c can use it.
|
|
|
|
|
|
|
|
|
|
| |
* runtime/staprun/relay.c (switch_outfile): New function for file switching.
(reader_thread): Don't assign empty_handler to SIGUSR2, and switch output
file when receiving signal(SIGUSR2) on ppoll.
(switchfile_handler): Send SIGUSR2 signal to reader threads for file
switching.
(init_relayfs): Assign switchfile_handler to SIGUSR2.
* staprun.1.in: Add FILE SWITCHING BY SIGNAL section.
|
|
|
|
|
|
|
|
| |
* runtime/staprun/common.c (make_outfile_name): Moved from relay.c, fix not to
open /dev/null.XXX output files, and add 'bulk' argument for bulkmode.
* runtime/staprun/relay.c (make_outfile_name): Moved to common.c.
* runtime/staprun/relay_old.c (open_oldoutfile): Fix to use fopen() and store
FILE * to percpu_tmpfile[cpu].
|
|
|
|
|
|
| |
When the relay threads encounter an error, they now send SIGTERM to the
rest of the process before the thread exit, so we get a clean shutdown.
For EPIPE in particular, error messages are also suppressed.
|
|
|
|
|
|
|
|
|
| |
This fixes a bug in stapio, which checks written data size and switches
new file when it exceeds a limit. The problem is that written-data-size
counter ignores the first written-data size when switching files. So,
actual file size always exceeds the limit. This changes stapio to
initialize written-data-size counter with the size of the data which
will be written in new file.
|
|
|
|
|
| |
Add strftime subset format support for output file name to systemtap.
This format will be evaluated when opening a new output file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add file-switching option(-S size[,N]) to stapio. This option has two
arguments, 'size' and 'N', and requires -o option.
- When the size of output file exceeds specified 'size'MB, staprun switches
output file to the next file. For this purpose, all output file has a serial
number as a suffix only when user specifies this option.
- Using this option in bulk mode, the output file name will be
'FILE_cpuX.SERIAL'.
- When the number of files exceeds specified N, staprun removes the oldest
file. This argument can be omitted.
|
|
|
|
|
|
|
| |
PR5368
* relay_old.c (init_oldrelayfs): Don't start threads
if load_only.
* relay.c (init_relayfs): Ditto.
|
|
|
|
|
|
|
| |
* common.c (set_clexec): New.
* staprun.h: Add prototype for set_clexec.
* relay*.c, ctl.c: Call set_clexec after
file opens.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Merge from setuid-branch. Changes also by Martin Hunt
<hunt@redhat.com>.
* staprun.c (init_staprun): Drop CAP_SYS_ADMIN when we're done
with it.
(main): Calls parse_modpath instead of path_parse_modname. Just
call parse_modpath with argv[optind]. Let it allocate and set
modpath and modname. If no modulename was given, display usage
and exit. Drop CAP_SYS_NICE when we're done with it. Set
atexit(exit_cleanup) so cleanup always gets called and modules get
removed. Call handle_symbols.
(run_stapio): Set argv[0] to stapio so that it executes as itself
instead of staprun.
(cleanup): Only do cleanups once and only try to remove module
when appropriate.
(exit_cleanup): New. Calls cleanup().
(mountfs): Sets uid to root before making directory and then
restores uid.
(setup_ctl_channel): Uses DEBUGFS define and improved
error message.
(setup_relayfs): Ditto.
(setup_oldrelayfs): Uses DEBUGFS and RELAYFS defines.
(run_stp_check): Replaced by mountfs().
(mountfs): New function. Replaces an external script with C code.
(init_staprun): Calls mountfs() instead of run_stp_check().
* staprun.h: Renamed path_parse_modname to parse_modpath. Added
MODULE_NAME_LEN define. Added [_][p]err macros. Removed
VERSION_CMD.
* mainloop.c (cleanup_and_exit): Make sure initialized is 2
before exiting with code 2.
(stp_main_loop): Set initialized to 2 when STP_TRANSPORT
is received. Call cleanup_and_exit() with proper status.
(start_cmd): exit 1 instead of -1.
(system_cmd): Ditto.
(init_staprun): Renamed init_stapio.
(cleanup_and_exit): Set exit status.
* cap.c: New file.
* common.c: New file.
* stapio.c: New file.
* staprun_funcs.c: New file.
* Makefile: Removed.
* symbols.c (get_sections): Move the filter code up so that
uninteresting section names are filtered out before
attempting to open them.
(do_kernel_symbols): Better detect overfow conditions and realloc
new space.
(do_module): After sending all modules, send a null message to
indicate we are finished.
* ctl.c (init_ctl_channel): When attempting to attach, if the
control channel doesn't exist, print a better error message.
* relay_old.c (init_oldrelayfs): Errors out if
open_relayfs_files() couldn't open any files.
PR 4795
* mainloop.c (send_request): Fixed buffer overflow check.
* staprun.h: Added buffer overflow checking versions of
strcpy/sprintf/snprintf.
* common.c (path_parse_modname): Checks for overflows on
strcpy/sprintf/snprintf.
(read_buffer_info): Ditto.
* ctl.c (init_ctl_channel): Ditto.
* relay.c (init_relayfs): Ditto.
* relay_old.c (open_relayfs_files): Ditto.
(init_oldrelayfs): Ditto.
* staprun_funcs.c (insert_module): Ditto.
(check_path): Ditto.
* symbols.c (get_sections): Ditto.
|
|
|
|
|
| |
* relay.c (init_relayfs): Fixed a buffer size bug introduced by
the last change.
|
|
|
|
|
|
| |
* relay.c (init_relayfs): Make sure buffers are big enough to hold
a full path.
* relay_old.c (init_oldrelayfs): Ditto.
|
| |
|
|
|
|
| |
* relay.c (init_relayfs): Send message to check for bulkmode.
|
|
|
|
|
| |
* relay.c: Fix ppoll() call and some race conditions involving
signals.
|
|
|
|
|
| |
* relay.c (reader_thread): Set timeout for streaming to
200ms.
|
|
|
|
|
| |
* relay.c (reader_thread): For bulk mode, set timeout to NULL
so ppoll never times out.
|
|
|
|
|
| |
* relay.c (ppoll): Add a compatibility function for
glibc < 2.4.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Signal handler cleanup.
* mainloop.c (fatal_handler): New. Cleanly handle
unexpected fatal signals.
(setup_main_signals): New. Set signals once mainloop
is entered.
(setup_signals): New. Block certain signals during initialization.
Set handler for fatal signals.
* relay.c (reader_thread): Use ppoll(). Terminate on
SIGUSR2 after reading any remaining data.
(close_relayfs): Remove sleep hack. Send SIGUSR2 to all threads.
Runtime debug messages.
* staprun.h: Change dbug() to accept a debuglevel and
enable it.
* *.c: Modify dbug() calls.
|
|
|
|
|
|
| |
Patch from David Smith
* mainloop.c (stp_main_loop): Properly handle write()
return value. Fixes build problem with some compilers.
|
|
|
|
|
| |
* relay.c (close_relayfs): Give threads some time to
run before closing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* mainloop.c (run_stp_check): Just use system() call.
(init_staprun): Remove _stp_pid module parameter.
(cleanup_and_exit): If closed==2, just exit without removing module.
(driver_poll): Remove. We no longer require stap running.
(_stp_main_loop): Remove call to driver_poll.
* ctl.c (init_ctl_channel): Don't put files in systemtap_pid,
revert back to systemtap/modulename.
* relay.c: Revert back to systemtap/modulename paths.
* relay_old.c: Ditto.
* staprun.c: Add -L and -A args.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* staprun.h (VERSION_CMD): Command to use for version check.
Changes to support runtime decision on new or old transport.
* mainloop.c (init_staprun): Check the kernel version at runtime
instead of at compile time.
(cleanup_and_exit): Call the correct relayfs close function.
(stp_main_loop): Call the correct relayfs init function.
* relay.c: Remove ifdef wrapper. File is always compiled and used
if the kernel version is appropriate.
* relay_old.c: Ditto.
|
|
* staprun.c: Renamed from stpd.c. Removed quiet and print_only
options. Added "-x" option as an alias for "-t". Removed "-m"
option. Updated arg processing to leave 4 slots for modoptions[].
Bump the priority of staprun.
* ctl.c: New. Transport control channel functions.
* relay.c: New. Relayfs control functions for new transport.
* relay_old.c: New. Relayfs control functions for older
versions of relayfs.
* mainloop.c: New. Staprun main loop.
* staprun.h: Renamed from librelay.h. Cleaned up.
* stap_merge.c: Renamed. Updated for modified save format.
|