summaryrefslogtreecommitdiffstats
path: root/runtime/transport/relayfs.c
Commit message (Collapse)AuthorAgeFilesLines
* Forward-ported staplog.c crash support (PR 10644).David Smith2009-09-231-2/+4
| | | | | | | | | | | | | | * staplog.c (get_rchan): Separated original relayfs code and current relayfs code. (get_rchan_buf): Ditto. (output_cpu_logs): Ditto. (get_rchan_addr): Handles original relayfs code detection. (setup_global_data): Looks for '_stp_relay_data' structure instead of '_stp_utt' structure. (open_output_file): Improved error message. * runtime/transport/relay_v2.c: Rearranged struct _stp_relay_data_type to make things a bit easier for staplog.c. * runtime/transport/relayfs.c: Ditto
* Transports now export their state.David Smith2009-06-181-6/+5
| | | | | | | | | | | | | | * runtime/transport/transport.h: Added prototype for _stp_transport_get_state(). * runtime/transport/relay_v2.c (_stp_transport_get_state): New function. * runtime/transport/relayfs.c (_stp_transport_get_state): Ditto. * runtime/transport/ring_buffer.c (_stp_transport_data_fs_init): Sets state. (_stp_transport_data_fs_start): Ditto. (_stp_transport_data_fs_stop): Ditto. (_stp_transport_get_state): Returns state. * runtime/print_new.c (stp_print_flush): Checks transport state before trying to flush.
* Enabled overwrite processing on original transports.David Smith2009-06-181-1/+1
| | | | | | | | | | | | | * runtime/transport/relay_v2.c (_stp_transport_data_fs_overwrite): Renamed from stp_relay_set_overwrite(). * runtime/transport/relayfs.c (stp_relay_set_overwrite): Ditto. * runtime/transport/ring_buffer.c (_stp_transport_data_fs_overwrite): New place holder function. * runtime/transport/transport.c (_stp_detach): Calls _stp_transport_data_fs_overwrite(). (_stp_attach): Calls _stp_transport_data_fs_overwrite(). * runtime/transport/transport.h: Added prototype for _stp_transport_data_fs_overwrite().
* Fixed STP_TRANSPORT_VERSION 1 behavior.David Smith2009-06-031-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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().
* Start at supporting the original transport (STP_TRANSPORT_VERSION=1).David Smith2009-05-121-101/+86
| | | | | | | | | * runtime/print.c: Only use print_new.c. * runtime/print_new.c (stp_print_flush): Add STP_TRANSPORT_VERSION 1 support. * runtime/transport/transport.c: Removed inclusion of procfs.c. * runtime/transport/procfs.c (_stp_proc_read): Adapt to new interface. (_stp_proc_write): Ditto. * runtime/transport/relayfs.c: Ditto.
* Major hacking to minimal config.David Smith2009-02-241-1/+1
| | | | | | | | | | | | | | | | | | 2009-02-24 David Smith <dsmith@redhat.com> * print.h: New file. * print.c: Includes new print.h file. * print_new.c (stp_print_flush): Commented out some code that needs replacing. * sym.c: Includes sym.h. * transport/debugfs.c: Includes transport.h. * transport/relayfs.c: Updated _stp_get_root_dir() call. * transport/transport.c: Ifdef'ed out most setup. * transport/transport.h: Ifdef'ed out all but basics. * transport/utt.c (utt_create_tree): Updated _stp_get_root_dir() call. * transport/utt.h: Commented out 'rchan' in struct utt_trace. (utt_reserve): Ifdef'ed out guts.
* Cleanup. Renamed _stp_{un}lock_debugfs() to _stp_{un}lock_transport_dir().David Smith2009-02-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 2009-02-12 David Smith <dsmith@redhat.com> * transport.c (_stp_lock_transport_dir): Renamed from _stp_lock_debugfs(), since on older kernels this actually uses procfs. (_stp_unlock_transport_dir): Renamed from _stp_unlock_debugfs(), since on older kernels this actually uses procfs. (_stp_lock_transport_dir): Changed _stp_lock_debugfs()/_stp_unlock_debugfs() to _stp_lock_transport_dir()/_stp_unlock_transport_dir(). * transport.h: Ditto. Also added _stp_transport_init() prototype. * utt.c (utt_remove_root): Changed _stp_lock_debugfs()/_stp_unlock_debugfs() to _stp_lock_transport_dir()/_stp_unlock_transport_dir(). * relayfs.c (_stp_remove_relay_root): Ditto. 2009-02-12 David Smith <dsmith@redhat.com> * procfs.c (_stp_rmdir_proc_module): Changed _stp_lock_debugfs()/_stp_unlock_debugfs() to _stp_lock_transport_dir()/_stp_unlock_transport_dir(). (_stp_mkdir_proc_module): Ditto.
* Use 'static' as much as possibleJosh Stone2009-01-281-4/+4
| | | | | | | | | | 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.
* PR6738: restore support for rhel4-era (2.6.9) kernelsFrank Ch. Eigler2008-07-121-3/+3
|
* Add support for memory allocation tracking.hunt2008-01-151-2/+2
|
* 2007-11-09 Martin Hunt <hunt@redhat.com>hunt2007-11-091-1/+7
| | | | | | | | | PR 5281 * transport.c (_stp_detach, _stp_attach): Call utt_set_overwrite() instead of setting a flag directly. * utt.c (utt_set_overwrite): New. Set overwrite mode. * relayfs.c (utt_set_overwrite): New. Set overwrite mode. * utt.h: Remove global utt_overwrite_flag.
* 2007-08-14 David Smith <dsmith@redhat.com>dsmith2007-08-141-11/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-03-26 Martin Hunt <hunt@redhat.com>hunt2007-03-261-19/+31
| | | | | | | | * 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-200/+84
| | | | | | | | | | | | | | | | * 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.
* Use semaphore if mutex not availabletrz2006-09-211-2/+20
|
* Conversion from relay-on-procfs to relay-on-debugfstrz2006-09-191-76/+86
|
* change relayfs version checking ifdefstrz2006-03-161-6/+6
|
* Fix for bug #2406 (autodetect supported relayfs versions)trz2006-03-151-7/+97
|
* Added #ifdef'ed support for kernels containing the recent relayfs API changestrz2005-10-141-0/+33
|
* initial revisiontrz2005-05-061-0/+113