summaryrefslogtreecommitdiffstats
path: root/runtime
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow process begin/end probes for unprivileged users.Dave Brolley2009-09-033-13/+24
| | | | | | | | | | | | | | | | | 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.
* PR10589: switch to kernel vscnprintf for _stp_{dbug,warn,error} calls in runtimeFrank Ch. Eigler2009-09-024-20/+23
| | | | | | | | | | | _stp_vscnprintf is only suitable for calls from the script, with slightly different conventions (64-bit ints/pointers, extra formatting directives). * runtime/runtime.h (_stp_{dbug,warn,error}): Add __attribute__ format(printf). * runtime/io.c (_stp_vlog): Ditto. Use vscnprintf(). * runtime/sym.c (_stp_module_check): Remove hexdumping (%.*M) of mismatching buildids. Switch to _stp_warn from printk (KERN_WARNING). * translate.cxx, runtime/unwind.c: Numerous print formatting tweaks.
* PR10551: cont'dFrank Ch. Eigler2009-08-231-1/+2
| | | | * runtime/print.c (_stp_print_kernel_info): Also switch module_core->module_core_rx.
* PR10551: build compatibility for pax/grsecurity include/linux/module.hFrank Ch. Eigler2009-08-232-13/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adapts to patches such as: diff -urNp linux-2.6.29.6/include/linux/module.h linux-2.6.29.6/include/linux/module.h --- linux-2.6.29.6/include/linux/module.h 2009-07-02 19:41:20.000000000 -0400 +++ linux-2.6.29.6/include/linux/module.h 2009-07-30 17:59:26.175602427 -0400 @@ -278,16 +278,16 @@ struct module int (*init)(void); /* If this is non-NULL, vfree after init() returns */ - void *module_init; + void *module_init_rx, *module_init_rw; /* Here is the actual code + data, vfree'd on unload. */ - void *module_core; + void *module_core_rx, *module_core_rw; /* Here are the sizes of the init and core sections */ - unsigned int init_size, core_size; + unsigned int init_size_rw, core_size_rw; /* The size of the executable code in each section. */ - unsigned int init_text_size, core_text_size; + unsigned int init_size_rx, core_size_rx; * runtime/autoconf-grsecurity.c: New test. * buildrun.cxx: Try it. * runtime/print.c: Use it.
* cleanup: rename task_finder_target->pathname -> procnameFrank Ch. Eigler2009-08-211-13/+13
| | | | | | | | | | The previous name made it easy to misread the purpose of this field. It is only for matching executable names, not for shared libraries. * runtime/task_finder.c (task_finder_target): Rename field. (*): Adjust. * tapset-itrace.cxx, tapset-utrace.cxx, tapsets.cxx, translate.cxx: Ditto.
* PR10228: fix non-utrace building regression - cont'dWenji Huang2009-08-201-1/+1
| | | | | | | * runtime/task_finder.c (non-UTRACE): Return 0 for stap_start_task_finder. * translate.cxx (emit_module_init): Let vma tracker specific to utrace.
* 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.
* PR10228: fix non-utrace building regressionFrank Ch. Eigler2009-08-191-0/+3
| | | | | | | * translate.cxx (dump_unwindsyms): Decide based on modname[] not mainfile[] to emit a vmcb. * runtime/task_finder.c (non-UTRACE): Include dummy stap_{start,stop}_* functions.
* PR10228: use task_finder_vma for -d /user/object files.Frank Ch. Eigler2009-08-142-2/+4
| | | | | | | | | | | | * main.cxx (main): For "-d /path" arguments, enable task finder. * runtime/sym.h (_stp_module): Add *vmcb member. * task_finder{.cxx,.h} (emit_vma_callback_probe_decl): Zap. * tapset-itrace.cxx, tapset-utrace.cxx: Use unwindsyms_modules instead. * tapsets.cxx (uprobe::emit_module_decls): Ditto. * translate.cxx (emit_module_init): Emit task finder registrations for vmcb's associated with _stp_modules. (dump_unwindsyms): Associate vmcbs with user-space unwindsyms entries.
* Add 'unused' attribute to module_data and module_size arguments of ↵Dave Brolley2009-08-111-2/+4
| | | | check_permissions.
* PR10506 experiment: use /sbin/insmod for uprobes.ko loadingFrank Ch. Eigler2009-08-101-2/+7
| | | | * runtime/staprun/staprun.c (enable_uprobes): insmod, not insert_module().
* It is not an error or warning if the local database of authorized signingDave Brolley2009-08-101-0/+5
| | | | certificates does not exist. It just means that the signed module is untrusted.
* Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-08-061-21/+34
|\
| * 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-061-0/+5
|\|
| * PR10491 Don't assign to REG_IP if it isn't an lvalue (s390 and ia64).Mark Wielaard2009-08-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To fixup REG_IP to show the correct value after a [ku]probe trap we assigned the address of the actual instruction pointer of the probed instruction. That doesn't work on architectures, s390 and ia64, where REG_IP is not a simple lvalue. Just don't try to fixup the address in those cases. If this isn't enough, the uprobe_stmt_num.exp testcase will point this out. * runtime/regs.h: Define REG_IP_LVALUE for x86_64, i386, powerpc64 and arm. * tapsets.cxx (dwarf_derived_probe_group::emit_module_decls): Only fixup REG_IP when REG_IP_LVALUE is defined. (uprobe_derived_probe_group::emit_module_decls): Likewise. (kprobe_derived_probe_group::emit_module_decls): Likewise.
* | 2009-08-06 Dave Brolley <brolley@redhat.com>Dave Brolley2009-08-065-143/+118
|/ | | | | | | | | | | | | | | | | | | * modverify.c (staprun.h): #include it. (verify_it): Now accepts module data and signature data as arguments. Don't open and read the signature here. Don't read the module here. (verify_module): Now accepts module data as argument. Read the signature once here. * modverify.h (verify_module): Now accepts module data as argument. * staprun.c (main): Don't call check_permissions here. * staprun.h (check_permissions): Prototype removed. * staprun_funcs.c (check_permissions): Now static. Accepts module data as argument. Pass module data to check_signature. (insert_module): Canonicalize the module path early here. Call check_permissions here, passing it the mapped module data. (check_signature): Now accepts module data as argument. Pass the module data to verify_module. (check_path): Use the already-canonicalized module path.
* Fix compile error when not HAVE_NSS with staprun.Maran2009-08-051-1/+1
| | | | | | | * runtime/staprun/staprun_funcs.c (check_permissions): Declare check_signature_rc outside HAVE_NSS block. Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-08-048-67/+122
|\ | | | | | | | | | | Conflicts: cache.cxx
| * Merge branch 'master' of git+ssh://sources.redhat.com/git/systemtapKent Sebastian2009-07-312-2/+2
| |\
| | * PR10458. User actual breakpoint address for [ku]probe[ret].Mark Wielaard2009-07-312-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setup the pt_regs REG_IP to the actual breakpoint address before entering a probe handler for [ku]probe[ret] (and restore it after returning). This helps getting symbol resolution and backtraces more correct and makes it more conform with other probe handlers like the iutrace and profile timers that also provide pt_regs (which untill now exhibited off-by-one errors while unwinding). * tapsets.cxx (dwarf_derived_probe_group::emit_module_decls): Setup REG_IP correctly before calling enter_kprobe_probe and enter_kretprobe_probe, and restore afterwards. (uprobe_derived_probe_group::emit_module_decls): Likewise for enter_uprobe_probe and enter_uretprobe_probe. (kprobe_derived_probe_group::emit_module_decls): Likewise for enter_kprobe2_probe and enter_kretprobe2_probe. * runtime/unwind/i386.h (arch_unw_init_frame_info): Initialize info->call_frame to zero. * runtime/unwind/x86_64.h (arch_unw_init_frame_info): Likewise.
| * | PR10204: Place userspace markers in systemtap itselfKent Sebastian2009-07-315-0/+7
| |/ | | | | | | | | | | | | | | | | | | | | | | * cache.cxx (add_to_cache,clean_cache): add static markers * main.cxx (main): likewise * runtime/staprun/common.c (send_request): likewise * runtime/staprun/mainloop.c (stp_main_loop): likewise * runtime/staprun/staprun.c (remove_module): likewise * runtime/staprun/staprun.h: include sdt.h * runtime/staprun/staprun_funcs.c (insert_module): likewise * util.cxx (stap_system): likewise * tapset/stap_staticmarkers.stp: new file
| * 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-235-36/+58
|\|
| * 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.
| * Fixed PR 10386 by removing the need to convert a pid to a task.David Smith2009-07-202-16/+5
| | | | | | | | | | | | | | | | | | * runtime/itrace.c (usr_itrace_init): Changed prototype to take a task_struct instead of a pid. * tapset-itrace.cxx (emit_module_decls): Updated usr_itrace_init() call. * runtime/autoconf-find-task-pid.c: Removed, since only user_itrace_init() was using it. * buildrun.cxx (compile_pass): Removed autoconf-find-task-pid.c test.
| * PR6961: gcc warning tweakFrank Ch. Eigler2009-07-171-3/+4
| | | | | | | | * sym.c (_stp_usymbol_print): Ditto.
| * PR6961: gcc warning tweakFrank Ch. Eigler2009-07-171-3/+4
| | | | | | | | * sym.c (_stp_symbol_print): (Redundantly) initialize locals.
| * save_stack_trace autoconf: fix typo to activate code in runtime/stack.cFrank Ch. Eigler2009-07-171-1/+1
| |
* | 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-102-40/+102
|\|
| * Added timer data flushing and overwrite handling to the ring_buffer transport.David Smith2009-07-092-40/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-07-071-8/+7
|\|
| * BZ 490234 fix.David Smith2009-07-061-8/+7
| | | | | | | | | | | | * runtime/procfs.c (_stp_rmdir_proc_module): Now before removing either '/proc/systemtap/${MODULE}' or '/proc/systemtap', lock the transport directory. Also make sure '/proc/systemtap' is empty before removal.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-06-2226-866/+1500
|\|
| * Fix on-file flight recorder mode bugs on old kernel.Masami Hiramatsu2009-06-194-35/+42
| | | | | | | | | | | | | | | | * 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].
| * Disabled transport version 3 (for now).David Smith2009-06-191-0/+6
| |
| * Cleanup.David Smith2009-06-183-56/+1
| | | | | | | | | | | | * runtime/print_old.c: Removed unneeded file. * runtime/print_flush.c: Renamed from print_new.c * runtime/print.c: Includes print_flush.c (instead of print_new.c).
| * Transports now export their state.David Smith2009-06-185-17/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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().
| * Merge commit 'origin/master' into pr7043David Smith2009-06-161-0/+1
| |\ | | | | | | | | | | | | Conflicts: runtime/transport/transport.c
| * | 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-118-104/+172
| |\ \
| * | | Fixed cut-and-paste error.David Smith2009-06-091-1/+1
| | | | | | | | | | | | | | | | | | | | * runtime/task_finder.c (__stp_call_mmap_callbacks_for_task): Fixed cut-and-paste error.
| * | | Avoid holding semaphore while making mmap callbacks.David Smith2009-06-091-52/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * runtime/task_finder.c (__stp_call_mmap_callbacks_for_task): Grabs the 'mmap_sem' sempaphore. Caches vma information, releases the semaphore, then makes mmap callbacks. (__stp_utrace_task_finder_target_quiesce): Calls __stp_call_mmap_callbacks_for_task() to make mmap callbacks on initial attach to a task.
| * | | Avoid 1 case of holding a semaphore while mmap callbacks are being made.David Smith2009-06-091-57/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * runtime/task_finder.c (__stp_call_mmap_callbacks_with_addr): Renamed from __stp_call_mmap_callbacks_with_vma(). Also added some code from __stp_utrace_task_finder_target_syscall_exit() that locks the 'mmap_sem' semaphore. This avoids holding the semaphore while the mmap callbacks are made. (__stp_utrace_task_finder_target_syscall_exit): Just calls __stp_call_mmap_callbacks_with_addr() in the mmap case.
| * | | Make sure all DEBUG_TRANS output uses printk.David Smith2009-06-032-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.