summaryrefslogtreecommitdiffstats
path: root/runtime/staprun/mainloop.c
Commit message (Collapse)AuthorAgeFilesLines
* Module signing and verification using a separate file for the module signature.Dave Brolley2009-05-041-5/+5
|
* PR6930: stapio: support file switchingMasami Hiramatsu2009-03-201-11/+4
| | | | | | | | | | | | | | | 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.
* PR6930: stapio: run in background as a daemonMasami Hiramatsu2009-03-201-0/+35
| | | | | | | Add '-D'(daemon mode) option to staprun/stapio for daemon mode. In this mode, stapio shows just its pid and detachs from console. Since it has no stdio, this mode requires -o option. stapio will exit when it receives SIGTERM or detects some error.
* PR6930: staprun: supports error message to syslogMasami Hiramatsu2009-03-201-1/+1
| | | | | Add an interface (eprintf) to output error messages to syslogd, because staprun has no stderr after detaching from console.
* PR9947: move runtime cleanup out of the work queueJosh Stone2009-03-131-0/+8
| | | | | | | | | | | | The kernel lockdep checking found a possible deadlock if a forced rmmod tried to destroy _stp_work_queue at the same time that the work queue was unregistering tracepoints. An unlikely scenario, but still possible. Now the work queue will just issue a STP_REQUEST_EXIT down to usermode, and usermode will echo back an STP_EXIT that triggers the actual probe cleanup. This way the unregistrations are happening in exactly the same context as the registrations were.
* 2009-01-28 David Smith <dsmith@redhat.com>David Smith2009-01-281-0/+47
| | | | | | PR9788 * mainloop.c (cleanup_and_exit): Added workaround for bug 9788 by fork'ing/exec'ing staprun.
* PR7063: honor SYSTEMTAP_STAPRUN and SYSTEMTAP_STAPIO environment variablesRoland McGrath2008-12-031-6/+13
|
* PR4783: remove traces of stap{run,io} self-renicingFrank Ch. Eigler2008-11-281-1/+0
|
* PR6964: configurably revert to signal-based "stap -c CMD" startup ↵Frank Ch. Eigler2008-11-121-29/+61
| | | | synchronization
* PR6964: temporary workaround for fedora utrace kernel bug 467568Wenji Huang2008-10-281-0/+19
|
* BZ467652: support old-style stap -c "FOO > BAR" usage by backing down to ↵Frank Ch. Eigler2008-10-231-7/+27
| | | | sh -c if needed.
* fix wordexp error handling, for invalid shell-like stap -c "command > file"Frank Ch. Eigler2008-10-151-3/+9
| | | | Reported-By: Wade Mealing <wmealing@redhat.com>
* "stap -c" cleanup part 2 - use wordexp / execvp instead of "sh -c" to ↵Frank Ch. Eigler2008-09-061-28/+30
| | | | execute cmd string
* task_finder <-> target_pid coupling; staprun/target_cmd fork under ptrace ↵Frank Ch. Eigler2008-09-051-298/+328
| | | | control
* transport/symbol rework: kernel-only probes workingFrank Ch. Eigler2008-06-291-1/+1
|
* STP_RELOCATE message for kernel relocatability (re)adaption, starting ↵Frank Ch. Eigler2008-06-291-22/+1
| | | | implementation
* PR6429: remove stapio STP_UNWIND support and associated elfutils dependencyFrank Ch. Eigler2008-06-031-12/+0
|
* More signal cleanup.Martin Hunt2008-05-051-9/+4
|
* Fix problem handling SIG_CHLDMartin Hunt2008-05-051-2/+14
|
* Cleanup signal handling for staprun.Martin Hunt2008-05-051-46/+71
|
* Move send_request out of common.c because staprun no longer sends anything.Martin Hunt2008-04-221-0/+23
|
* Change staprun to exec stapio. Add "-d" option to staprun.Martin Hunt2008-04-211-30/+34
|
* rebased unwind_branch on top of current masterFrank Ch. Eigler2008-03-251-75/+84
|
* PR4037 and fixes to better synchronize staprun and stapio.hunt2008-01-151-1/+2
|
* 2007-11-09 Martin Hunt <hunt@redhat.com>hunt2007-11-091-1/+1
| | | | | * mainloop.c (stp_main_loop): Bump recvbuf to 8196 for compatibility with old transport.
* 2007-10-12 Martin Hunt <hunt@redhat.com>hunt2007-10-121-1/+1
| | | | | | | | | | | | | | | | Changes to separate the symbols from the command channel. * cap.c (init_cap): Add CAP_DAC_OVERRIDE. * staprun.h: Change init_ctl_channel prototype. * ctl.c (init_ctl_channel): Modify to open either a command or symbol channel. Use ".cmd" and ".symbols" as the new names. * mainloop.c (init_stapio): Call init_ctl_channel(0); * staprun.c (cleanup): Call stop_symbol_thread(). (main): Call start_symbol_thread(). * staprun_funcs.c (handle_symbols): Make a thread. (start_symbol_thread): New. (stop_symbol_thread): New.
* 2007-09-14 Martin Hunt <hunt@redhat.com>hunt2007-09-141-37/+2
| | | | | | | | | * ctl.c (init_ctl_channel): Return 1 if the ctl file opened was for the old relayfs transport. * mainloop.c (init_stapio): Don't call using_old_transport(). Use the return of init_ctl_channel() instead. (using_old_transport): Deleted.
* 2007-08-31 Martin Hunt <hunt@redhat.com>hunt2007-08-311-0/+1
| | | | | | * mainloop.c (start_cmd): Set the priority to forked processes back to normal. (system_cmd): Ditto.
* 2007-08-31 Martin Hunt <hunt@redhat.com>hunt2007-08-311-0/+3
| | | | | * mainloop.c (start_cmd): Set the priority to forked processes back to normal.
* 2007-08-21 Martin Hunt <hunt@redhat.com>hunt2007-08-211-3/+14
| | | | | * mainloop.c (start_cmd): Send SIGINT to target_cmd, not stapio.
* 2007-08-14 David Smith <dsmith@redhat.com>dsmith2007-08-141-195/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 2007-06-04 Martin Hunt <hunt@redhat.com>hunt2007-06-041-11/+16
| | | | | | | * mainloop.c (cleanup_and_exit): Disable signals while exiting. (fatal_handler): Use return values from write() to avoid warnings.
* 2007-05-24 Martin Hunt <hunt@redhat.com>hunt2007-05-241-1/+1
| | | | * mainloop.c (cleanup_and_exit): Fix typo.
* 2007-05-22 Martin Hunt <hunt@redhat.com>hunt2007-05-221-1/+1
| | | | * mainloop.c (init_staprun): Change dbug() call.
* 2007-05-08 Martin Hunt <hunt@redhat.com>hunt2007-05-081-39/+90
| | | | | | | | | | | | | | | | | | 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.
* 2007-05-07 Martin Hunt <hunt@redhat.com>hunt2007-05-071-3/+15
| | | | | | Patch from David Smith * mainloop.c (stp_main_loop): Properly handle write() return value. Fixes build problem with some compilers.
* 2007-04-02 Martin Hunt <hunt@redhat.com>hunt2007-04-021-6/+17
| | | | | | | | | | | | | * relay_old.c (close_oldrelayfs): If just detaching, call pthread_cancel. (open_relayfs_files): Just return 0 if relay_fd[cpu] not opened. (init_oldrelayfs): Scan percpu files to calculate ncpus. * mainloop.c (init_staprun): Call old transport init when necessary. (cleanup_and_exit): Ignore signals when cleaning up. * ctl.c (read_buffer_info): For old transport, need to read transport parameters.
* 2007-03-26 Martin Hunt <hunt@redhat.com>hunt2007-03-261-62/+42
| | | | | | | | | | | | | | | | * 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.
* 2007-03-20 Martin Hunt <hunt@redhat.com>hunt2007-03-201-0/+1
| | | | | | * symbols.c (send_module): If send returns < 0 then cleanup and exit. (do_kernel_symbols): Ditto.
* *** empty log message ***hunt2007-03-181-3/+1
|
* 2007-03-18 Martin Hunt <hunt@redhat.com>hunt2007-03-181-7/+22
| | | | | | | | | | | | * 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.
* 2007-03-14 Martin Hunt <hunt@redhat.com>hunt2007-03-141-0/+374
* 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.