summaryrefslogtreecommitdiffstats
path: root/runtime/transport/control.c
Commit message (Collapse)AuthorAgeFilesLines
* runtime shutdown errors: simplify, improve error specificityFrank Ch. Eigler2009-10-131-3/+3
| | | | | | | | * transport/control.c (*_cmd): Return -Ecodes rather than "-1" from file_operations callbacks. * staprun/ctl.c (init_ctl_channel): Return distinct error codes. * staprun/staprun.c (remove_module): Skip connection attempt to .ctl file; just do delete_module() with O_NONBLOCK.
* fix typo: KERN_ERROR -> KERN_ERR from last commitFrank Ch. Eigler2009-09-081-1/+1
|
* PR10575: emit KERN_ERRORs on transport control message failuresFrank Ch. Eigler2009-09-081-0/+3
| | | | | | | | Suspecting that some kernel->user control messages may be getting lost, let's more robustly log these occurrences. * runtime/transport/control.c (_stp_ctl_send): printk(KERN_ERROR) instead of ignoring errors.
* Implemented ring_buffer iterators.David Smith2009-07-151-2/+1
| | | | | | | | | | | | | | | | * runtime/transport/ring_buffer.c (_stp_ring_buffer_empty_cpu): New function. (_stp_ring_buffer_empty): Ditto. (_stp_ring_buffer_iterator_increment): Ditto. (_stp_tracing_wait_pipe): Calls _stp_ring_buffer_empty() instead of ring_buffer_empty(). (_stp_peek_next_event): Looks at iterators first. (_stp_find_next_event): Calls _stp_ring_buffer_empty_cpu() and increments iterator. (_stp_data_read_trace): Opens and closes ring_buffer iterators. (_stp_data_poll_trace): Calls _stp_ring_buffer_empty(). (__stp_relay_wakeup_timer): Ditto. * runtime/transport/control.c (_stp_ctl_write_cmd): Increased level required to get a debug print.
* Make sure all DEBUG_TRANS output uses printk.David Smith2009-06-031-13/+15
| | | | | | | | * runtime/transport/control.c (_stp_ctl_write_cmd): Calls dbug_trans2 instead of _dbug (so that printk is used instead of the transport itself). (_stp_ctl_write_dbug): Ditto. * runtime/debug.h (dbug_trans2): New macro.
* Fixed STP_TRANSPORT_VERSION 1 behavior.David Smith2009-06-031-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * runtime/transport/control.c (_stp_ctl_write_dbug): Added support for more messages. * runtime/transport/relay_v2.c (_stp_transport_data_fs_start): New function. (_stp_transport_data_fs_stop): Ditto. (_stp_transport_data_fs_close): Moved some functionality into _stp_transport_data_fs_stop() and calls _stp_transport_data_fs_stop() also. (_stp_transport_data_fs_init): Moved some functionality into _stp_transport_data_fs_start() and calls _stp_transport_data_fs_start() also. * runtime/transport/relayfs.c (_stp_transport_data_fs_start): New function. (_stp_transport_data_fs_stop): Ditto. (_stp_transport_data_fs_close): Moved some functionality into _stp_transport_data_fs_stop() and calls _stp_transport_data_fs_stop() also. (_stp_transport_data_fs_init): Moved some functionality into _stp_transport_data_fs_start() and calls _stp_transport_data_fs_start() also. * runtime/transport/ring_buffer.c (_stp_transport_data_fs_start): New empty function. (_stp_transport_data_fs_stop): Ditto. * runtime/transport/transport.h: Added _stp_transport_data_fs_start() and _stp_transport_data_fs_stop() prototypes. * runtime/transport/transport.c (_stp_cleanup_and_exit): Calls _stp_transport_data_fs_stop(). (_stp_transport_close): Calls _stp_transport_fs_close() earlier. (_stp_transport_init): Calls _stp_transport_data_fs_start().
* Merge commit 'origin/master' into pr7043David Smith2009-05-211-1/+6
|\ | | | | | | | | | | | | Conflicts: runtime/print.c runtime/transport/transport.c runtime/transport/transport_msgs.h
| * PR9947: move runtime cleanup out of the work queueJosh Stone2009-03-131-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Start of support for older transport and cleanup.David Smith2009-05-061-0/+1
| | | | | | | | | | | | | | | | * runtime/transport/control.c: Added inclusion of linux/delay.h to get declaration of msleep(). * runtime/transport/relay_v2.c: New skeleton file for transport version 2. * runtime/transport/ring_buffer.c: Cleanup. * runtime/transport/transport.c: Ditto.
* | More cleanup.David Smith2009-02-251-2/+6
|/ | | | | | | | | | | | | | | | 2009-02-25 David Smith <dsmith@redhat.com> * debug.h: Removed unused variable '_stp_transport_state'. * print_new.c (stp_print_flush): Ifdef'ed out call to utt_reserve(). * runtime.h: Added _stp_warn() prototype. * transport/control.c: Includes control.h, mempool.c, and symbols.c. Renamed '_stp_attached' to '_stp_ctl_attached'. * transport/control.h: Removed _stp_pool_q declaration. * transport/debugfs.c (_stp_register_ctl_channel_fs): Uses _stp_get_module_dir(). * transport/transport.c: Cleanup. * transport/transport.h: Ditto.
* Removed unused functions and variables.David Smith2009-02-181-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-02-18 David Smith <dsmith@redhat.com> * io.c (_stp_log): Removed unused function. * map.c (_stp_cmp): Replace _stp_log() with dbug(). * mempool.c (_stp_mempool_resize): Removed unused function. * print.c (next_fmt): Removed unused function. * procfs.c: Removed unused variable '_stp_num_procfs_files'. * regs.c (_stp_ret_addr): Removed unused function. * string.c (_stp_text_str): Removed unused variable 'len'. * string.h: Removed unused variable '_stdout_' and function declaration for deleted function '_stp_vsprintf'. * sym.c: Removed unused variables. * unwind.c (_stp_create_unwind_hdr): Removed unused function. 2009-02-18 David Smith <dsmith@redhat.com> * control.c: Removed unused variable '_stp_current_buffers'. * procfs.c (_stp_set_buffers): Removed unused function. (_stp_register_ctl_channel_fs): Removed unused variables and label. * symbols.c (u32_swap): Removed unused function. (generic_swap): Ditto. (_stp_sort): Ditto. (_stp_section_is_interesting): Ditto. * transport.c (_stp_transport_init): Removed unused variable 'ret'.
* Reduced control channel code duplication.David Smith2009-02-171-35/+21
| | | | | | | | | | | | 2009-02-17 David Smith <dsmith@redhat.com> * control.c: Contains generic control channel functions. * procfs.c: Specific procfs control channel functions. All generic control channel functions moved to control.c. * debugfs.c: New file containing debugfs specific control channel functions. * control.h: New file. * transport.c: Updated file inclusion.
* Use 'static' as much as possibleJosh Stone2009-01-281-1/+1
| | | | | | | | | | This change just inserts 'static' on runtime, tapset, and generated C functions and globals, so the compiler can do a better job of optimizing. My tests with small scripts show ~10% reduction in compile time and ~20% reduction in module size. Larger scripts may show less benefit, but I expect purely positive results.
* PR6736: changelogs for post-merge compiled unwind/symbols data reorganizationFrank Ch. Eigler2008-07-101-1/+0
|
* transport/symbol rework: kernel-only probes workingFrank Ch. Eigler2008-06-291-1/+4
|
* STP_RELOCATE message for kernel relocatability (re)adaption, starting ↵Frank Ch. Eigler2008-06-291-3/+4
| | | | implementation
* Remove STP_UNWIND support in _stp_ctl_write_dbugWenji Huang2008-06-131-4/+0
|
* PR6429: remove stapio STP_UNWIND support and associated elfutils dependencyFrank Ch. Eigler2008-06-031-3/+0
|
* Change staprun to exec stapio. Add "-d" option to staprun.Martin Hunt2008-04-211-1/+1
|
* control.c (_stp_ctl_write_dbug): Insert missing break.Martin Hunt2008-03-251-0/+1
|
* rebased unwind_branch on top of current masterFrank Ch. Eigler2008-03-251-203/+22
|
* 2008-02-27 Martin Hunt <hunt@redhat.com>hunt2008-02-271-124/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | * sym.h (_stp_module): Add text_size, lock, and unwind data pointer. * sym.c (_stp_find_module_by_addr): New function. (_stp_kallsyms_lookup): Call _stp_find_module_by_addr(). (_stp_get_unwind_info): New. * runtime.h: Move debug macros to debug.h. Include it. * debug.h: New file. * map.c: Update debug calls. * map-gen.c: Update debug calls. * pmap-gen.c: Update debug calls. * mempool.c: New file. * symbols.c: Use rwlocks. Use new dbug macros. Handle unwind info if present. * transport.c: Include mempool.c. Update dbug and kbug calls to new macros. * transport_msgs.h (_stp_command_name): Add struct containing message names for debugging. * control.c, procfs.c: Use new dbug macros. Use new mempool functions.
* 2008-01-28 Martin Hunt <hunt@redhat.com>hunt2008-01-281-4/+4
| | | | * control.c, procfs.c, symbols.c: Use DEFINE_SPINLOCK
* PR4037 and fixes to better synchronize staprun and stapio.hunt2008-01-151-17/+28
|
* Add support for memory allocation tracking.hunt2008-01-151-6/+6
|
* 2007-11-01 Martin Hunt <hunt@redhat.com>hunt2007-11-011-11/+6
| | | | | | * procfs.c, control.c, transport.c: Recognize when stapio is detached and disable delayed work. Enable when attached. Cleanup code to destroy workqueue on exit.
* 2007-10-12 Martin Hunt <hunt@redhat.com>hunt2007-10-121-46/+206
| | | | | | | | | | * transport.c (_stp_ask_for_symbols): Don't ask for transport_info yet. Need to wait until symbols are received. (_stp_work_queue): Rename _stp_ready_q to _stp_ctl_ready_q. * procfs.c: Create a ".symbols" channel and use it for STP_MODULE and STP_SYMBOLS. Rename "cmd" channel to ".cmd". * control.c: Ditto.
* 2007-09-21 Martin Hunt <hunt@redhat.com>hunt2007-09-211-1/+1
| | | | | From Alan Brunelle * control.c (_stp_ctl_read_cmd): Cast count to an int before printing.
* 2007-09-20 Martin Hunt <hunt@redhat.com>hunt2007-09-201-3/+2
| | | | | * transport.h: Increase default buffer size. * control.c (_stp_ctl_read_cmd): Check buffer size.
* 2007-08-17 Martin Hunt <hunt@redhat.com>hunt2007-08-171-0/+3
| | | | | | | | PR3857 From Masami Hiramatsu * utt.c (utt_subbuf_start_callback): Use overwrite flag. * control.c (_stp_ctl_open_cmd): Set overwrite_flag off. (_stp_ctl_close_cmd): Set overwrite flag on.
* 2007-08-14 David Smith <dsmith@redhat.com>dsmith2007-08-141-12/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge from setuid-branch. Changes also by Martin Hunt <hunt@redhat.com>. * control.c (_stp_ctl_write): Make sure we don't overflow. (_stp_ctl_open_cmd): Do not allow multiple opens of the control file. (_stp_ctl_write_cmd): Once STP_START is received, ignore everything except STP_EXIT. Create another state variable "initialized". Don't respond to STP_SYMBOLS or STP_MODULES unless initialized is 0. Also check that current pid is the same as the pid that did insmod. (_stp_register_ctl_channel): Bug fix - sets owner/group after checking for NULL. * procfs.c (_stp_ctl_write): Make sure we don't overflow. (_stp_ctl_open_cmd): Do not allow multiple opens of the control file. (_stp_ctl_write_cmd): Once STP_START is received, ignore everything except STP_EXIT. Create another state variable "initialized". Don't respond to STP_SYMBOLS or STP_MODULES unless initialized is 0. Also check that current pid is the same as the pid that did insmod. (_stp_register_ctl_channel): Set ownership of cmd file and percpu files for bulkmode. * relayfs.c (utt_trace_setup): Set ownership of percpu files. Improved error handling. (utt_trace_remove): Improved error checking. * utt.c (utt_remove_tree): Improved error checking. (utt_trace_cleanup): Ditto. (utt_create_buf_file_callback): Set file ownership. (utt_create_global_buf_file_callback): Set file ownership. * transport.h: Delcare _stp_uid, _stp_gid, and _stp_init_pid. * transport.c (_stp_transport_init): Set _stp_uid, _stp_gid, and _stp_init_pid.
* 2007-06-21 Martin Hunt <hunt@redhat.com>hunt2007-06-211-0/+6
| | | | | * control.c (_stp_ctl_write_cmd): Add support for STP_BULK. * transport_msgs.h (enum): Add STP_BULK.
* Fix mode in procfs cmd file.hunt2007-06-181-1/+1
|
* 2007-06-18 Martin Hunt <hunt@redhat.com>hunt2007-06-181-1/+1
| | | | * control.c (_stp_register_ctl_channel): Fix mode of cmd file.
* * control.c: Explicit type cast for picky compilers.wcohen2007-05-161-1/+1
|
* *** empty log message ***hunt2007-05-161-1/+1
|
* 2007-05-15 Martin Hunt <hunt@redhat.com>hunt2007-05-161-7/+10
| | | | | | * control.c: Change default buffer number and size. (_stp_ctl_write): Add debug statements. Check size of message to avoid overwriting buffer.
* 2007-03-28 Martin Hunt <hunt@redhat.com>hunt2007-03-281-0/+15
| | | | | | * control.c (_stp_ctl_open_cmd): Set _stp_pid. (stp_ctl_close_cmd): Clear _stp_pid. * transport.h: Declare _stp_pid;
* 2007-03-26 Martin Hunt <hunt@redhat.com>hunt2007-03-261-4/+2
| | | | | | | | * symbols.c (_stp_do_module): If a module has no symbols, just return NULL instead of an errorcode. * control.c, procfs.c, relayfs.c, transport.c, utt.c, utt.h: Revert back to using systemtap/modulename instead of systemtap_pid.
* 2007-03-14 Martin Hunt <hunt@redhat.com>hunt2007-03-141-0/+275
| | | | | | | | | | | | | | | | * transport_msgs.h: ifdef old messages as such. Add support for new transport. * relayfs.c: Simplify and add new interface to look like utt. * utt.[ch]: New files. Similar to the proposed utt interface. These setup and teardown relayfs on debugfs. * control.c: New file. Implements a simple control channel. A small subset of procfs.c. * procfs.c: This is now only used for old kernels lacking newer relayfs. Change STP_RELAYFS to STP_BULKMODE. Use new messages from transport_msgs.h. Don't support RELAYFS_CHANNEL_VERSION >= 4. CHanges all control channel functions to new names. Use pids instead of module names in /proc names.
* 2005-08-19 Martin Hunt <hunt@redhat.com>hunt2005-08-191-228/+0
| | | | | | | | | | | * transport.h: Remove netlink references. * transport.c: Remove netlink references. Ifdef relayfs code. * procfs.c: New file. * Makefile: Deleted. * control.c: Deleted. * control.h: Deleted. * netlink.c: Deleted. * netlink.h: Deleted.
* 2005-06-23 Martin Hunt <hunt@redhat.com>hunt2005-06-231-1/+1
| | | | | * control.c: Replace macro DEFINE_SPINLOCK because some kernels don't have it.
* initial revisiontrz2005-05-061-0/+228