summaryrefslogtreecommitdiffstats
path: root/runtime/transport
Commit message (Collapse)AuthorAgeFilesLines
* Fixed PR 11148 by reworking transport directory locks.David Smith2010-01-081-14/+30
| | | | | | | | | | * runtime/transport/transport.c (_stp_get_root_dir): No longer locks/unlocks the transport directory. (_stp_remove_root_dir): Ditto. (_stp_transport_fs_init): Locks and unlocks the transport directory. Ensures that the root directory can't be deleted between calling _stp_get_root_dir() and creating the module dir. (_stp_transport_fs_close): Locks and unlocks the transport directory.
* PR11015 Support shared library reloading (in different processes)Mark Wielaard2009-12-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * runtime/task_finder_vma.c (stap_remove_vma_map_info): Return negative status on failure. (stap_find_vma_map_info): Likewise. (stap_find_vma_map_info_user): New function. (stap_drop_vma_maps): New function. * runtime/sym.h (addr): Renamed to static_addr, to store addresses for sections which are always mapped at the same address. (_stp_module_relocate): Add extra struct task_struct *tsk argument. * runtime/sym.c (_stp_tf_exec_cb): New callback, calls stap_drop_vma_maps. (_stp_tf_mmap_cb): Don't store address in module.section, but call stap_add_vma_map_info() per tsk->group_leader for matched module. Don't register empty/null modules. (_stp_module_relocate): Take extra struct task_struct *tsk argument, cache last tsk used. Only use section->static_addr for none dynamic modules. Use stap_find_vma_map_info_user() to locate dynamic modules. (_stp_mod_sec_lookup): Add extra argument unsigned long *rel_addr to optionally store relative address when module/section found. (_stp_kallsyms_lookup): Use _stp_mod_sec_lookup to find relative address. (_stp_sym_init): Register _stp_tf_exec_cb in stap_task_finder_target. Add error check to see if task finder could be initialized. * dwflpp.cxx (emit_address): Pass NULL for kernel/modules and current for user tasks to _stp_module_relocate. * runtime/transport/symbols.c (_stp_do_relocation): Set new static_addr _stp_section field. * runtime/unwind.c (adjustStartLoc): Take new struct task_struct *tsk argument and pass to stap_find_vma_map_info_user and _stp_module_relocate to find adjusted addr. (_stp_search_unwind_hdr): Pass through struct task_struct *tsk. (unwind_frame): Likewise. * tapset/context-symbols.stp (probemod): Add NULL to _stp_mod_sec_lookup call to indicate we aren't interested in relative address. * tapsets.cxx (dwarf_derived_probe_group::emit_module_init): Pass NULL to _stp_module_relocate to indicate kernel/module address.
* Removed extra declarations.David Smith2009-10-291-3/+0
| | | | | * runtime/transport/transport.h: Removed extra declarations of _stp_transport_init() and _stp_transport_close().
* PR10854: Use a mutex around transport startup/shutdownJosh Stone2009-10-271-15/+23
| | | | | | | | | | | | | | | We had a race where the probe setup could be called during/after the probe shutdown in abnormal circumstances, which leads to kernel callbacks still registered after module unload. (BOOM) Now the setup/shutdown activities and related flags are guarded by a mutex, so we should have strict ordering. * runtime/transport/transport.c (_stp_transport_mutex): New. (_stp_handle_start): Grab the mutex, and make sure we're not exiting. (_stp_cleanup_and_exit): Grab the mutex. (_stp_lock_inode, _stp_unlock_inode): Use kernel version for checking inode locking type.
* 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.
* No longer need buffer iterators.David Smith2009-09-251-2/+0
| | | | * runtime/tranport/ring_buffer.c: Removed 'USE_ITERS' definition.
* Forward-ported staplog.c crash support (PR 10644).David Smith2009-09-232-3/+7
| | | | | | | | | | | | | | * 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
* Allow ring_buffer to be used if STP_USE_RING_BUFFER is defined.David Smith2009-09-101-2/+3
|
* PR10602 prime: runtime: shrink stack frame of _stp_do_relocation().Frank Ch. Eigler2009-09-091-1/+1
| | | | * transport/symbols.c (_stp_do_relocation): Make msg static.
* Removed unneeded casts.David Smith2009-09-091-5/+5
| | | | | | | * runtime/transport/ring_buffer.c (_stp_event_to_user): Removed unneeded cast. (_stp_data_write_reserve): Ditto. (_stp_data_write_commit): Ditto.
* 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.
* Allow process begin/end probes for unprivileged users.Dave Brolley2009-09-031-4/+0
| | | | | | | | | | | | | | | | | 2009-09-03 Dave Brolley <brolley@redhat.com> * tapsets.cxx (visit_cast_op): Don't disallow unprivileged users. Annotate synthesized function with /* unprivileged */. * tapset-utrace.cxx (register_tapset_utrace): Call allow_unprivileged for process begin and end probes. * translate.cxx (translate_pass): Generate '#define STP_PRIVILEGED 1' unless --unprivileged was specified. * runtime/transport/transport.c: Don't define _stp_unprivileged_user. * runtime/task_finder.c (__stp_utrace_attach_match_filename): Check that _stp_uid equals the task euid when STP_PRIVILEGED is not defined. (stap_start_task_finder): Likewise. * runtime/staprun/staprun.c (insert_stap_module): Don't generate module option _stp_unprivileged_user.
* Updated with latest code.David Smith2009-08-191-70/+145
| | | | | | | | | | | | | | | | | | | | | | | * runtime/transport/ring_buffer.c (_stp_ring_buffer_disable_cpu): New function. (_stp_ring_buffer_enable_cpu): Ditto. (_stp_ring_buffer_cpu_disabled): Ditto. (_stp_ring_buffer_empty_cpu): Only checks online cpus (instead of all possible cpus). (_stp_find_next_event): Ditto. (_stp_ring_buffer_iterator_increment): Calls _stp_ring_buffer_disable_cpu()/_stp_ring_buffer_enable_cpu() around ring_buffer_* calls. (_stp_ring_buffer_consume): Ditto. (_stp_peek_next_event): Ditto. (_stp_buffer_iter_finish): New function. (_stp_buffer_iter_start): Ditto. (_stp_data_read_trace): Uses _stp_buffer_iter_start()/_stp_buffer_iter_finish(). (_stp_data_write_reserve): Checks to see if the cpu is disabled (with _stp_ring_buffer_cpu_disabled() before reserving memory. Uses _stp_buffer_iter_start()/_stp_buffer_iter_finish(). (_stp_transport_data_fs_init): Initializes buffer iterators.
* Works with or without a ring_buffer_iter.David Smith2009-08-061-21/+34
| | | | | | | | | * runtime/transport/ring_buffer.c (_stp_find_next_event): Works with or without a ring_buffer iterator. (_stp_find_next_event): Ditto. (_stp_data_read_trace): Ifdef'ed out using ring_buffer iterators. (_stp_get_iterator): New function. (_stp_data_write_reserve): Calls _stp_get_iterator().
* Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-08-041-65/+113
|\ | | | | | | | | | | Conflicts: cache.cxx
| * Improves functionality on rawhide (2.6.31-rcX) kernels.David Smith2009-07-281-65/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * runtime/transport/ring_buffer.c (struct _stp_iterator): Renamed from _stp_ring_buffer_data. (_stp_data_open_trace): Uses _stp_iterator. (_stp_data_release_trace): Ditto. (_stp_ring_buffer_empty_cpu): Ditto. (_stp_ring_buffer_empty): Ditto. (_stp_ring_buffer_consume): Ditto. (_stp_tracing_wait_pipe): Ditto. (_stp_peek_next_event): Ditto. (_stp_find_next_event): Ditto. (_stp_data_read_trace): Ditto. (_stp_data_write_reserve): Ditto.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-07-231-13/+44
|\|
| * Make ring_buffer transport work on new kernels.David Smith2009-07-221-13/+44
| | | | | | | | | | | | | | * runtime/transport/ring_buffer.c (_stp_event_to_user): Added debug prints. (_stp_ring_buffer_consume): New function. (_stp_find_next_event): Avoid incrementing the buffer iterator here. (_stp_data_write_commit): Added debug prints.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-07-162-21/+110
|\|
| * Implemented ring_buffer iterators.David Smith2009-07-152-21/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-07-101-40/+96
|\|
| * Added timer data flushing and overwrite handling to the ring_buffer transport.David Smith2009-07-091-40/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * buildrun.cxx (compile_pass): Checks for ring_buffer api change. * runtime/autoconf-ring_buffer-flags.c: New file. * runtime/transport/ring_buffer.c (tracing_wait_pipe): No longer schedules, just returns. The timer function will handle it later. (_stp_data_write_reserve): Handles ring_buffer api change. Added overwrite processing. If we're full, delete an event to make room. (_stp_data_write_commit): Handles ring_buffer api change. (__stp_relay_wakeup_timer): New function. (__stp_relay_timer_start): Ditto. (__stp_relay_timer_stop): Ditto. (_stp_transport_data_fs_start): Calls __stp_relay_timer_start(). (_stp_transport_data_fs_stop): Calls __stp_relay_timer_stop(). (_stp_transport_data_fs_overwrite): Sets overwrite flag.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-06-2212-695/+1287
|\|
| * Disabled transport version 3 (for now).David Smith2009-06-191-0/+6
| |
| * Transports now export their state.David Smith2009-06-184-14/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
| * Moved global data into a single structure.David Smith2009-06-181-39/+45
| |
| * Removed unused code (and all references to 'utt').David Smith2009-06-181-52/+0
| |
| * Enabled overwrite processing on original transports.David Smith2009-06-185-23/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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 non-bulkmode output on smp systems using transport version 2.David Smith2009-06-121-0/+15
| | | | | | | | | | * runtime/transport/relay_v2.c (__stp_relay_create_buf_file_callback): Set the 'is_global' return parameter so that smp systems work correctly.
| * Merge commit 'origin/master' into pr7043David Smith2009-06-111-0/+8
| |\
| * | 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-036-23/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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().
| * | Cleanup and better original transport support.David Smith2009-05-261-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * runtime/print.h: Moved _stp_reserve_bytes() prototype here. * runtime/vsprintf.c (_stp_vsnprintf): Includes print.h to get _stp_reserve_bytes() prototype. * runtime/transport/transport.c (_stp_remove_root_dir): Better cleanup for STP_TRANSPORT_VERSION == 1. (_stp_transport_fs_close): Ditto.
| * | Added error checking and other updates.David Smith2009-05-226-488/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * runtime/vsprintf.c: Added transport.h inclusion for STP_BUFFER_SIZE definition. * runtime/transport/debugfs.c (_stp_register_ctl_channel_fs): Added error checking. * runtime/transport/transport.c (_stp_get_root_dir): Ditto. (_stp_transport_fs_init): Added original transport support and error checking. * runtime/transport/relay_v2.c (__stp_relay_create_buf_file_callback): Added error checking. (_stp_transport_data_fs_init): Ditto. * runtime/transport/ring_buffer.c (_stp_transport_data_fs_init): Ditto. * runtime/transport/utt.c: Removed unused file. * runtime/transport/utt.h: Ditto.
| * | Merge commit 'origin/master' into pr7043David Smith2009-05-213-4/+23
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: runtime/print.c runtime/transport/transport.c runtime/transport/transport_msgs.h
| * | | Start at supporting the original transport (STP_TRANSPORT_VERSION=1).David Smith2009-05-123-108/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
| * | | Sets uid/gid on "dropped" file.David Smith2009-05-081-0/+2
| | | | | | | | | | | | | | | | | | | | * runtime/transport/relay_v2.c (_stp_transport_data_fs_init): Sets uid/gid on "dropped" file.
| * | | Cleaned up runtime/transport/relay_v2.c.David Smith2009-05-081-181/+15
| | | | | | | | | | | | | | | | * runtime/transport/relay_v2.c: Cleanup.
| * | | Working transport version 2 (RHEL5 and recent fedora kernels).David Smith2009-05-081-414/+376
| | | | | | | | | | | | | | | | | | | | * runtime/transport/relay_v2.c: Morphed utt.c into relay_v2.c. Actually works.
| * | | Hid details of internal ring_buffer.c structure.David Smith2009-05-072-47/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * runtime/print_new.c (stp_print_flush): Calls _stp_data_entry_data() to get data pointer. * runtime/transport/transport.h: Removed _stp_entry definition. Added _stp_data_entry_data() declaration. * runtime/transport/ring_buffer.c: Uses new _stp_data_entry structure. (_stp_data_entry_data): Added.
| * | | Added comments.David Smith2009-05-061-0/+37
| | | | | | | | | | | | | | | | * runtime/transport/transport.h: Added comments.
| * | | Start of support for older transport and cleanup.David Smith2009-05-064-51/+573
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
| * | | Renamed STP_OLD_TRANSPORT to STP_TRANSPORT_VERSION.David Smith2009-04-024-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-04-02 David Smith <dsmith@redhat.com> * runtime.h: Defines STP_TRANSPORT_VERSION instead of STP_OLD_TRANSPORT. * staprun/staprun.h (STP_OLD_TRANSPORT): Ditto. * print.c: Changed STP_OLD_TRANSPORT to STP_TRANSPORT_VERSION. * staprun/mainloop.c (stp_main_loop): Ditto. * transport/transport.c: Ditto. * transport/transport.h: Ditto. * transport/transport_msgs.h: Ditto. * transport/utt.h: Ditto.
| * | | 2009-03-31 David Smith <dsmith@redhat.com>David Smith2009-03-312-10/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * print_new.c (stp_print_flush): Pushed MAX_RESERVE logic down to _stp_data_write_reserve(). Now just keeps calling _stp_data_write_reserve() until it has written the entire print buffer. * transport/ring_buffer.c (_stp_data_write_reserve): Breaks large reserve requests down into smaller ones for better buffer use. Returns the number of bytes reserved. * transport/transport.h: Updated _stp_data_write_reserve() prototype.
| * | | Working bulkmode support.David Smith2009-03-131-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-03-13 David Smith <dsmith@redhat.com> * print_new.c (stp_print_flush): Added bulkmode support for new transport. * transport/ring_buffer.c (__stp_find_next_entry): Fixed syntax error in bulkmode code. (_stp_transport_data_fs_init): Changed 'for_each_possible_cpu()' to 'for_each_online_cpu()' so that non-online cpu's won't have a trace file created.
| * | | More bulkmode support.David Smith2009-03-131-44/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-03-13 David Smith <dsmith@redhat.com> * transport/ring_buffer.c (_stp_data_open_trace): Passes the inode's private data into the file's private data. (_stp_trace_seq_to_user): Deleted unused function. (trace_seq_reset): Ditto. (__stp_find_next_entry): Renamed and added bulkmode support. (_stp_find_next_entry): Updated call. (_stp_data_read_trace): Updated call.
| * | | More bulkmode support. Only allows for one reader of all trace files.David Smith2009-03-131-7/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-03-13 David Smith <dsmith@redhat.com> * transport/ring_buffer.c (__stp_free_ring_buffer): Frees _stp_trace_reader_cpumask. (__stp_alloc_ring_buffer): Allocates and clears _stp_trace_reader_cpumask. (_stp_data_open_trace): Instead of using an atomic variable, uses a cpumask variable to allow for only one reader of trace files. (_stp_data_release_trace): Clears cpumask when trace files are closed.
| * | | Start of STP_BULKMODE support.David Smith2009-03-121-12/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-03-12 David Smith <dsmith@redhat.com> * transport/ring_buffer.c (_stp_transport_data_fs_init): Start of STP_BULKMODE support - creates one trace file per cpu. (_stp_transport_data_fs_close): Cleans up one trace file per cpu.
| * | | Updated buffer size.David Smith2009-03-121-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-03-12 David Smith <dsmith@redhat.com> * transport/ring_buffer.c (__stp_alloc_ring_buffer): Updated buffer size.