summaryrefslogtreecommitdiffstats
path: root/runtime
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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.
* PR10524: reduce massive-uprobe script modules' .data consumptionFrank Ch. Eigler2009-09-082-17/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | The general approach is to rip out task_finder_tgt's from all over the place (including the unwindsym vmcbs, and the stap_uprobe_specs), and instead have a small handful of them: one for all unwindsyms, and one per abstract probed process (PID or NAME). These are in turn shared by all new stap_unwind_specs by index. Before: probe process("./stap").function("*") -rw-r--r--. 1 fche users 11775283 2009-09-08 20:26 /var/tmp/fche/systemtap/cache/96/stap_96c0479d674db55ec98d8a8750a790e7_7989596.ko text data bss dec hex filename 445158 8351944 4306472 13103574 c7f1d6 /var/tmp/fche/systemtap/cache/96/stap_96c0479d674db55ec98d8a8750a790e7_7989596.ko After: (Note how data shrank, though text gained a bit in const-init-data.) -rw-r--r--. 1 fche users 4021569 2009-09-08 20:27 /var/tmp/fche/systemtap/cache/e4/stap_e46e88634efd850b1586e81c231c239a_8058419.ko text data bss dec hex filename 1896511 2192 4324808 6223511 5ef697 /var/tmp/fche/systemtap/cache/e4/stap_e46e88634efd850b1586e81c231c239a_8058419.ko * tapsets.cxx (uprobe_derived_probe_group): Rewrite emit_module_decls, and adjust emit_module_init. * runtime/sym.c (_stp_sym_init): Initialize unwindsyms-shared vmcb. * runtime/sym.h (_stp_module): Remove *vmcb field. * translate.cxx (emit_module_init, dump_unwindsyms): Adapt. * translate.h (assert_0_indent): Flush output before possibly assert-failing.
* 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.
* task_finder diagnostics: standardize on STP_DEBUG_PRINTKFrank Ch. Eigler2009-09-081-8/+0
| | | | * io.c (DEBUG_TASK_FINDER_PRINTK): Remove conditional.
* task_finder diagnostics: emit start_task_finder dbug message at end of fn.Frank Ch. Eigler2009-09-081-2/+1
| | | | | | * task_finder.c (stap_start_task_finder): Emit _stp_dbug message at end rather at beginning, so printed utrace-engine attach counts reflect status at end of initialization rather than at beginning.
* runtime diagnostics: remove ANSI goo, add -DSTAP_DEBUG_PRINTK option.Frank Ch. Eigler2009-09-081-1/+8
| | | | | | * runtime/io.c (_stp_vlog): Don't put ansi highlighting into debugging messages. #if STAP_DEBUG_PRINTK, direct all diagnostics to appropriate printk channel instead of runtime trace buffer.
* Warn if the pid specified by -x does not belong to an unprivileged user.Dave Brolley2009-09-081-1/+1
|
* Fix build-id check for relocatable kernelEugeniy Meshcheryakov2009-09-071-1/+2
| | | | | | Save offset of build id relative to _stext instead of absolute address for kernel and apply relocations at run-time. This fixes Debian bug #545277 (http://bugs.debian.org/545277).
* rc = 0 should be return 0 for database not ownder by root.Dave Brolley2009-09-041-1/+1
|
* Check for bad address range or size in lookup_bad_addr.Dave Brolley2009-09-041-0/+4
|
* Use task_euid when STAPCONF_TASK_UID is not defined.Dave Brolley2009-09-031-3/+17
|
* Disallow kernel space memory access when unprivileged.Dave Brolley2009-09-032-24/+49
| | | | | | | | | | | | | | | | | 2009-09-03 Dave Brolley <brolley@redhat.com> * runtime/addr-map.c (lookup_addr_aux): Now takes size argument. Consider the size when looking for overlapping range with the map entries. (lookup_bad_addr): Now takes size argument. Disallow kernel space access when STP_PRIVILEGED is not defined. Pass size to lookup_addr_aux. <asm/processor.h>: #include it when STP_PRIVILEGED is not defined. (add_bad_addr_entry): Supply a size of 1 to calls to lookup_addr_aux. * runtime/loc2c-runtime.h (kread): Pass sizeof (*(ptr)) to lookup_bad_addr. (kwrite): Likewise. (deref): Pass size to lookup_bad_addr. (store_deref): Likewise.
* 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].