| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
* runtime/sym.c: Store individual rc's for build-id comparisons.
|
|
|
|
|
| |
* runtime/sym.c: Removed <asm/segment.h> include. That file doesn't exist
on ppc, and it appears to be empty everywhere else.
|
|
|
|
|
| |
* runtime/sym.c (_stp_module_check): Use a failure-tolerant
get_user() loop instead of memcmp() for buildid binary strings.
|
|
|
|
|
|
|
|
|
|
|
| |
This function now also does user space address relocation. The connection
with module loading/unloading was removed in commit 1b94bf which made all
symbol tables emitted at compile time. _stp_module_relocate is called from
the dwarf unwinder, and when doing some of the symbol lookup through
dwflpp::emit_adress now.
* runtime/sym.c (_stp_module_relocate): Remove last, last_sec and last_tsk
caching and invalidation code.
|
|
|
|
| |
last_tsk was checked but never set. Noticed by Wenji Huang.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
* dwflpp.cxx (dwflpp::emit_address): Enable task finder and emit a
_stp_module_relocate for the ".dynamic" section when seeing a
user-space dso address.
* runtime/sym.c (_stp_mod_sec_lookup): Remove .dynamic section addr cheat.
(_stp_tf_mmap_cb): Add cheat here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
|
|
| |
_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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* sym.c (_stp_usymbol_print): Ditto.
|
|
|
|
| |
* sym.c (_stp_symbol_print): (Redundantly) initialize locals.
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
runtime/print.c
runtime/transport/transport.c
runtime/transport/transport_msgs.h
|
| |
| |
| |
| |
| |
| |
| | |
Output debuginfo file name and build-id if verification
failed.
* runtime/sym.c: Print more info if not matched.
|
| |
| |
| |
| |
| |
| |
| |
| | |
* runtime/sym.c (_stp_usymbol_print): New function.
* tapset/ucontext-unwind.stp (print_ubacktrace): New tapset function.
(ubacktrace): Likewise.
* tapset/ucontext-symbols.stp (print_ustack): Likewise.
* testsuite/buildok/ustack.stp: New test for above three functions.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* runtime/sym.c (_stp_func_print): Take task, pass to _stp_kallsyms_lookup.
* runtime/stack.c (print_stack_address): Pass NULL.
* runtime/stack-i386.c (_stp_stack_print_fallback): Pass NULL.
(__stp_stack_print): Pass NULL or current.
* runtime/stack-x86_64.c (_stp_stack_print_fallback): Pass NULL.
(__stp_stack_print): Pass current.
|
| |
| |
| |
| |
| | |
* runtime/sym.c (_stp_mod_sec_lookup): Use section size to match addr.
Only return exact matches, not just closes offset.
|
| |
| |
| |
| | |
* runtime/sym.c (_stp_mod_sec_lookup): Only set sec when not NULL.
|
| |
| |
| |
| |
| |
| |
| |
| | |
* runtime/runtime.h: Include task_finder.c.
* runtime/sym.c: Always define task_finder callbacks for usage in tapsets.
* runtime/task_finder.c: Define dummy stap_task_finder_target when
! defined(CONFIG_UTRACE).
* tapsets.cxx: Never include task_finder.c directly.
|
| |
| |
| |
| | |
* runtime/sym.c (_stp_tf_mmap_cb): We get passed vm_flags, not flags.
|
| |
| |
| |
| |
| |
| |
| | |
2009-04-08 David Smith <dsmith@redhat.com>
* runtime/sym.c: Added '#ifdef STP_NEED_VMA_TRACKER' around code
that needs it.
|
| |
| |
| |
| | |
* runtime/sym.c (_stp_symbol_snprint): Use _stp_snprintf, no _stp_printf.
|
| |
| |
| |
| |
| | |
* runtime/sym.c (_stp_tf_vm_cb): Add and remove tsk->group_leader.
(_stp_mod_sec_lookup): find vma for task->group_leader.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
2009-04-07 David Smith <dsmith@redhat.com>
PR 9940.
* tapsets.cxx (emit_vma_callback_probe_decl): Initialized new
callbacks.
(utrace_derived_probe_group::emit_probe_decl): Ditto.
(uprobe_derived_probe_group::emit_module_decls): Uses new
callback. Makes sure mapping is executable before trying to set a
probe in it.
(itrace_derived_probe_group::emit_module_init): Calls
_stp_sym_init().
(utrace_derived_probe_group::emit_module_init): Ditto.
(uprobe_derived_probe_group::emit_module_init): Ditto.
* runtime/sym.c: Moved task_finder_vma.c inclusion here from
task_finder.c.
(_stp_sym_init): New function.
(_stp_tf_mmap_cb): New function that replaces _stp_tf_vm_cb.
(_stp_tf_munmap_cb): Ditto.
* runtime/task_finder.c: Removed task_finder_vma.c inclusion.
Split vm_callback into 3 callbacks: mmap_callback,
munmap_callback, and mprotect_callback.
(stap_register_task_finder_target): Initializes new events
variables for the new callbacks.
(__STP_TASK_VM_BASE_EVENTS): No longer specifies syscall entry
events.
(__stp_call_mmap_callbacks): New function.
(__stp_call_mmap_callbacks_with_vma): Ditto.
(__stp_call_munmap_callbacks): Ditto.
(__stp_call_mprotect_callbacks): Ditto.
(__stp_call_vm_callbacks): Removed.
(__stp_utrace_task_finder_target_quiesce): Calls
__stp_call_mmap_callbacks() instead of __stp_call_vm_callbacks().
(__stp_utrace_task_finder_target_syscall_entry): Removed
function.
(__stp_utrace_task_finder_target_syscall_exit): Reports raw
mmap()/mprotect()/munmap() events.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds a couple of the suggested context/stack revamp functions
from PR6580. In particular it replaces the symbolname() function that
sneaked in with the pr6866 branch merge with the suggested symname().
* runtime/sym.c (_stp_mod_sec_lookup): Make section optional.
(_stp_symbol_snprint): Provide a way to get optional module info.
* tapset/context-symbols.stp: Replace symbolname() with symname(),
add modname() and symdata().
(probemod): Implement pc based fallback.
* tapset/context-unwind.stp (caller): Adjust for _stp_symbol_snprint
change.
* testsuite/systemtap.context/usymbols.exp: Use new symname.
* testsuite/buildok/modname.stp: New test.
* testsuite/buildok/symdata.stp: Likewise.
* testsuite/buildok/symname.stp: Likewise.
|
| |
| |
| |
| |
| |
| | |
* tapsets.cxx (utrace_derived_probe_group::emit_module_decls):
Remove output task finder vma callback _stp_tf_vm_cb.
* runtime/sym.c (_stp_tf_vm_cb): And add it here.
|
| |
| |
| |
| | |
* runtime/sym.c (_stp_mod_sec_lookup): Initialize user and vm_start.
|
| |
| |
| |
| |
| |
| |
| |
| | |
* runtime/task_finder_vma.c (__stp_tf_get_vma_entry_addr): Deleted.
(struct __stp_tf_vma_entry): Replace module by user void* field.
(stap_add_vma_map_info): Take a void *user arg.
(stap_find_vma_map_info): Take a void **user arg.
* runtime/sym.c (_stp_mod_sec_lookup): Use stap_find_vma_map_info.
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
ChangeLog: Removed
runtime/ChangeLog: Removed
runtime/sym.c: Merged
runtime/task_finder.c: Merged
tapset/ChangeLog: Removed
testsuite/ChangeLog: Removed
|
| | | |
|
| | | |
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
2009-02-18 David Smith <dsmith@redhat.com>
* io.c (_stp_log): Removed unused function.
* map.c (_stp_cmp): Replace _stp_log() with dbug().
* mempool.c (_stp_mempool_resize): Removed unused function.
* print.c (next_fmt): Removed unused function.
* procfs.c: Removed unused variable '_stp_num_procfs_files'.
* regs.c (_stp_ret_addr): Removed unused function.
* string.c (_stp_text_str): Removed unused variable 'len'.
* string.h: Removed unused variable '_stdout_' and function
declaration for deleted function '_stp_vsprintf'.
* sym.c: Removed unused variables.
* unwind.c (_stp_create_unwind_hdr): Removed unused function.
2009-02-18 David Smith <dsmith@redhat.com>
* control.c: Removed unused variable '_stp_current_buffers'.
* procfs.c (_stp_set_buffers): Removed unused function.
(_stp_register_ctl_channel_fs): Removed unused variables and
label.
* symbols.c (u32_swap): Removed unused function.
(generic_swap): Ditto.
(_stp_sort): Ditto.
(_stp_section_is_interesting): Ditto.
* transport.c (_stp_transport_init): Removed unused variable
'ret'.
|
|/
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
This provides sanity check of debuginfo file based on build-id. Many cases are considered, whether build-id exists in debuginfo file or not, whether module is loaded or not, whether build-id exists in runtime kernel/module. It will do work when LD >= 2.18 and kernel >=2.6.23, otherwise no check.
|
| |
|
| |
|
|
|
|
| |
-ffunction-sections .ko's
|
|
|
|
| |
is not known to be loaded
|
|
|
|
| |
unwinder still disabled
|
|
|
|
| |
implementation
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sym.h (_stp_module): Add text_size, lock, and unwind data
pointer.
* sym.c (_stp_find_module_by_addr): New function.
(_stp_kallsyms_lookup): Call _stp_find_module_by_addr().
(_stp_get_unwind_info): New.
* runtime.h: Move debug macros to debug.h. Include it.
* debug.h: New file.
* map.c: Update debug calls.
* map-gen.c: Update debug calls.
* pmap-gen.c: Update debug calls.
* mempool.c: New file.
* symbols.c: Use rwlocks. Use new dbug macros. Handle
unwind info if present.
* transport.c: Include mempool.c. Update dbug and kbug calls
to new macros.
* transport_msgs.h (_stp_command_name): Add
struct containing message names for debugging.
* control.c, procfs.c: Use new dbug macros. Use
new mempool functions.
|