summaryrefslogtreecommitdiffstats
path: root/runtime
Commit message (Collapse)AuthorAgeFilesLines
* PR11015 Support shared library reloading (in different processes)Mark Wielaard2009-12-225-77/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* brown paper bag typo fixyFrank Ch. Eigler2009-12-201-1/+1
|
* runtime: more build fix for non-utrace kernelsFrank Ch. Eigler2009-12-202-1/+3
| | | | | | * runtime/stack-i386.c (_stp_stack_print): Make call to uprobe_get_pc() conditional on CONFIG_UTRACE. * runtime/stack-x86_64.c: Ditto.
* PR10601: unfork deref()Frank Ch. Eigler2009-12-201-22/+16
| | | | | * runtime/loc2c-runtime.h: Remove k_ vs u_[store_]deref; share instead. * tapsets.cxx: Remove k_ vs u_ redirection for *deref().
* runtime: rhel4 build fix for uretprobe-wannabe stack tracebacksFrank Ch. Eigler2009-12-201-1/+3
| | | | * runtime/stack.c (_stp_stack_print): Comment out *retprobe logic if !CONFIG_UTRACE.
* runtime backtracing: port commit #2e7f8442 to uprobes1Frank Ch. Eigler2009-12-203-2/+46
| | | | * runtime/uprobes/uprobes.c (uprobe_get_pc): new function
* PR10601 cont'd, RHEL5 backward compatibility with more runtime/autoconf*Frank Ch. Eigler2009-12-203-5/+35
|
* PR10601 part 1: i386 and x86-64 regset for dwarf fetch/store_register()sFrank Ch. Eigler2009-12-201-85/+300
| | | | | | | | | | * runtime/loc2c-runtime.h (fetch_register, store_register): forked into k_ (kernel) and u_ (user) varieties. Implement i386 and x86_64 in terms of regset.h; fall back to k_* for other architectures. * tapsets.cxx: (*::visit_target_symbol): Emit macros to map loc2c's fetch/store_register to loc2c-runtime's k_ or u_ as appopriate.
* Remove uprobes.h declaration from runtime.hTim Moore2009-12-184-12/+16
| | | | | | | | | | | Turns out that it breaks on kernels that don't have utrace. * runtime/runtime.h : Don't include uprobes.h * runtime/stack.c: Include uprobes.h * runtime/stack-i386.c: Check if uprobes is included at all. * runtime/stack-x86_64.c: ditto * tapsets.cxx (uprobe_derived_probe_group::emit_module_decls): put uprobes.h include back in.
* support for a brief backtrace formatTim Moore2009-12-175-14/+46
| | | | | | | | | | | | | | This only prints symbol+offset, or an address if the symbol isn't known. * runtime/runtime.h (SYM_VERBOSE_NO, SYM_VERBOSE_FULL, SYM_VERBOSE_BRIEF): new constants * runtime/stack.c (_stp_stack_print): support brief format * runtime/sym.c (_stp_func_print): ditto * tapset/ucontext-unwind.stp (print_ubacktrace_brief): new function * testsuite/systemtap.context/fib.c: new test program * testsuite/systemtap.context/fib.stp: new test * testsuite/systemtap.context/fib.exp: new test
* backtrace through uprobes trampoline.Tim Moore2009-12-176-6/+26
| | | | | | | | | | | | | | Only works in uretprobes for the moment. * runtime/stack-x86_64.c (__stp_stack_print): Rewrite trampoline PC addresses if necessary. * runtime/stack-i386.c (__stp_stack_print): ditto * runtime/stack-arm.c (__stp_stack_print): Add extra argument * runtime/stack-ppc.c (__stp_stack_print): ditto * runtime/stack-s390.c (__stp_stack_print): ditto * runtime/stack.c (_stap_stack_print): call __stp_stack_print with uretprobe_instance. * testsuite/systemtap.context/uprobe_backtrace.stp: new test
* function to translate from the uretprobe trampoline back to the originalTim Moore2009-12-162-0/+46
| | | | | | return address * runtime/uprobes2/uprobes.c (uprobe_get_pc): new function
* set the IP in return probes to the returned-to instructionTim Moore2009-12-162-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | It's easily available in kretprobes and uretprobes and is consistent with the rest of the program state. * translate.cxx (emit_common_header) : add uretprobe_instance to context. * tapsets.cxx (common_probe_entryfn_prologue): Initialize ri in context to 0. (dwarf_derived_probe_group::emit_module_decls): Change IP to return address in kretprobes. (uprobe_derived_probe_group::emit_module_decls): enter_uretprobe_probe: set ri (uretprobe_instance) in context. Change IP to return address in uretprobes. Don't emit uprobe include and #define * runtime/runtime.h : Add includes and #define for uprobes. * runtime/stack.c (_stp_stack_print, _stp_stack_snprint): Add extra argument for uretprobe_instance. * tapset/context-unwind.stp (print_backtrace, backtrace): Pass NULL for uretprobe_instance to _stp_stack_print. * tapset/ucontext-unwind.stp (print_ubacktrace, ubacktrace): pass uretprobe_instance to _stp_stack_print * testsuite/systemtap.context/uprobe_uaddr.exp : new test for uaddr in function probes * testsuite/systemtap.context/uprobe_uaddr.stp : new file
* Merge branch 'master' of ssh://sources.redhat.com/git/systemtapDave Brolley2009-12-151-18/+35
|\
| * Fixed DEBUG_MEM debug memory tracking.David Smith2009-12-151-18/+35
| | | | | | | | | | | | | | | | | | * runtime/alloc.c (_stp_kmalloc): Fixed compilation when DEBUG_MEM is defined. Improved allocated memory tracking. (_stp_kzalloc): Ditto. (_stp_vmalloc): Ditto. (_stp_alloc_percpu): Ditto. (_stp_kmalloc_node): Ditto.
* | Merge branch 'master' of ssh://sources.redhat.com/git/systemtapDave Brolley2009-12-147-45/+51
|\|
| * Do not use condition_codes() on armEugeniy Meshcheryakov2009-12-131-1/+1
| | | | | | | | | | | | | | | | | | It does not exist in recent kernels. Use regs->ARM_cpsr instead, this should work with all versions of linux found in git repo (versions >=2.6.12-rc2). Difference between condition_codes() and regs->ARM_cpsr should not matter for systemtap.
| * runtime build: fix alloc.c buildability on old gcc 3.4Frank Ch. Eigler2009-12-111-2/+2
| | | | | | | | * runtime/alloc.c (_stp_kmalloc): Move var decl back to top.
| * runtime: undefine DEBUG_MEM, retain alloc countingFrank Ch. Eigler2009-12-101-9/+10
| | | | | | | | | | | | | | DEBUG_MEM can & does evoke locking timeouts. * runtime/alloc.c (*): Track __stp_allocated_memory regardless of DEBUG_MEM.
| * runtime: print stp_alloc statistics in startup printkFrank Ch. Eigler2009-12-102-20/+13
| | | | | | | | | | * runtime/alloc.c: Define DEBUG_MEM. * runtime/print.c (_stp_print_kernel_info): Reformat/rescale mem values.
| * Fix regression in statistic operationsAnton Vorontsov2009-12-091-6/+12
| | | | | | | | | | | | | | | | | | | | | | In commit 98c783852039061db8c1611742660aaded0eab77 ("Use proper types for do_div") I imprudently changed some variables to an unsigned type while in some places the code actually relies on a sign. So, let's be a bit smarter now and use temporary variables. Reported-by: Wenji Huang <wenji.huang@oracle.com> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
| * PR 10848 partial fix by using systemtap memory functions everywhere.David Smith2009-12-092-8/+12
| | | | | | | | | | | | | | * runtime/addr-map.c (add_bad_addr_entry): Uses systemtap memory allocation/deallocation wrappers. * runtime/itrace.c (create_itrace_info): Ditto. (remove_usr_itrace_info): Ditto.
| * PR11020: Check switch_file global flag inside inner loop for busy scriptsMasami Hiramatsu2009-12-031-2/+4
| | | | | | | | | | * runtime/staprun/relay.c (reader_thread): Check switch_file thread flags inside inner read-write loop. And clear the flags after switching file.
* | Clean up NSS after errors occur during verification.Dave Brolley2009-12-141-0/+3
|/
* Regenerate autotools files using autoreconf to pick up latest Makefile.am ↵Dave Brolley2009-12-012-2/+4
| | | | changes.
* Merge branch 'master' of ssh://sources.redhat.com/git/systemtapDave Brolley2009-12-0115-28/+65
|\
| * uprobes ppc64: UPROBES_DEBUG build fixFrank Ch. Eigler2009-12-011-2/+2
| | | | | | | | * runtime/uprobes/uprobes_ppc.c (calc_offset): Fix printk types.
| * Use proper types for do_divAnton Vorontsov2009-12-012-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | do_div accepts unsigned 64-bit integer type for dividend, signed types would cause do_div's typecheck fail: stat-common.c: In function 'needed_space': stat-common.c:50: error: comparison of distinct pointer types lacks a cast ...same errors in time.c and tapset-timers.cxx's generated code... A fix for time.c is special, on ppc32 cycles_t is 32-bit, so technically we don't need do_div, but since the whole _stp_gettimeofday_ns() operates on 64-bit types we'd better be safe and use uint64_t for the math. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
| * Change KERNEL_RELOC_SYMBOL to "_stext" on ppc32Anton Vorontsov2009-12-011-1/+1
| | | | | | | | | | | | | | | | Currently staprun fails at send_relocation_kernel(), this is because ppc32 doesn't have ".__start" symbol. I think we should use _stext, just as other arches. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
| * Implement _div64 and _mod64 for ppc32Anton Vorontsov2009-12-011-3/+39
| | | | | | | | | | | | | | _div64 and _mod64 arch-specific details were taken from gcc/longlong.h, just as it was done for i386. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
| * Share ppc64 and ppc32 code where possibleAnton Vorontsov2009-12-013-5/+5
| | | | | | | | | | | | | | | | | | | | * runtime/copy.c: Can use ppc64's code. * runtime/regs.h: Ditto. * runtime/string.h: Ditto. * tapset/context.stp: Ditto. * tapset/errno.stp: Ditto. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
| * stack-ppc: Adjust for ppc32Anton Vorontsov2009-12-012-3/+3
| | | | | | | | | | | | | | | | Get rid of magic numbers, use appropriate defines from ptrace.h. From now on stack-ppc.c should be suitable for ppc32. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
| * Rename stack-ppc64.c to stack-ppc.cAnton Vorontsov2009-12-012-1/+1
| | | | | | | | | | | | There should be no functional changes in this patch. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
| * Rename uprobes_ppc64.c to uprobes_ppc.c, use it for ppc32Anton Vorontsov2009-12-016-8/+8
| | | | | | | | | | | | | | The code *looks* generic enough, so I think it can be used for ppc32 without modifications. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
* | Make sure system types are defined.Dave Brolley2009-12-012-5/+7
|/
* PR10653: don't corrupt signal structs in itrace on rawhide utraceRoland McGrath2009-11-301-3/+10
| | | | | * runtime/itrace.c (usr_itrace_report_signal): On modern utrace, must check/propagate utrace_signal_action().
* Don't let _stp_alloc_percpu allocate too much memory.David Smith2009-11-301-2/+15
| | | | | * runtime/alloc.c (_stp_alloc_percpu): Refuses to allocate too much percpu memory.
* Fix build error when !HAVE_NSSWenji Huang2009-11-301-2/+2
| | | | | * runtime/staprun/staprun_funcs.c (assert_stap_module_permissions): Mark parameters unused.
* PR 10984 Additional Work. TOCTOU race checking access permissions before ↵Dave Brolley2009-11-272-51/+80
| | | | canonicalizing /lib/modules/KVER/systemtap.
* Merge branch 'master' of ssh://sources.redhat.com/git/systemtapDave Brolley2009-11-252-8/+15
|\
| * include modverify.h unconditionally.Dave Brolley2009-11-241-2/+0
| |
| * Add assert for detecting shared library reloading, PR11015.Mark Wielaard2009-11-241-6/+15
| | | | | | | | | | * runtime/sym.c (_stp_tf_mmap_cb): Only look for first load of whole module that is executable. Add check for detecting reloading of module.
* | Improve error messages related to module signing.Dave Brolley2009-11-251-15/+7
| |
* | - Allow root, the owner of the uprobes build directory and the members of theDave Brolley2009-11-251-24/+20
| | | | | | | | | | | | | | | | | | | | group owner of the uprobes buld directory to build uprobes.ko. - When building uprobes.ko, make all generated files writable by the group owner of the uprobes build directory. - Don't change the group owner of the uprobes build directory during 'make install'
* | Merge branch 'master' of ssh://sources.redhat.com/git/systemtapDave Brolley2009-11-241-61/+121
|\|
| * Merge branch 'master' of ssh://sources.redhat.com/git/systemtapDave Brolley2009-11-241-1/+1
| |\
| * | PR 10976, 10984. Loading of signed modules (script module and uprobes) ↵Dave Brolley2009-11-241-61/+121
| | | | | | | | | | | | limited to members of stapusr.
* | | Merge branch 'master' of ssh://sources.redhat.com/git/systemtapDave Brolley2009-11-233-3/+21
|\ \ \ | | |/ | |/| | | | | | | | | | Conflicts: configure
| * | cleanup: explain -5 magic value used in map-sorting codeFrank Ch. Eigler2009-11-201-1/+1
| |/
| * Explain "cheat" comment in sym.c (_stp_tf_mmap_cb).Mark Wielaard2009-11-171-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | We are abusing the "first" section address here to indicate where the module (actually first segment) is loaded (which is why we are ignoring the offset). It would be good to redesign the stp_module/stp_section data structures to better align with the actual memory mappings we are interested in (especially the "section" naming is slightly confusing since what we really seem to mean are elf segments (which can contain multiple elf sections). * runtime/sym.c (_stp_tf_mmap_cb): Add cheat comment.