| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
* runtime/loc2c-runtime.h (store_deref_string): New.
* tapset/conversions-guru.stp (set_kernel_*): New guru functions.
|
|
|
|
|
|
| |
* runtime/stack.c (_stp_stack_print_tsk): Static.
(_stp_stack_snprint_tsk): Static.
* runtime/task_finder.c (__stp_utrace_task_finder_ops): Static.
|
|
|
|
|
|
|
|
|
|
| |
* perf.h (stap_perf_probe): Define one structure for all our needs.
* perf.c (_stp_perf_init): Use the new struct, return errors directly.
(_stp_perf_exit): Use the new struct.
* tapset-perfmon.cxx (perf_derived_probe_group::emit_module_decls): Use
the stap_perf_probe definition from perf.h now.
(perf_derived_probe_group::emit_module_init): Adapt.
(perf_derived_probe_group::emit_module_exit): Adapt.
|
|
|
|
|
| |
* runtime/sym.c: Removed <asm/segment.h> include. That file doesn't exist
on ppc, and it appears to be empty everywhere else.
|
|
|
|
| |
* runtime/perf.c (_stp_perf_init): If cpu_is_offline(), don't.
|
|
|
|
|
|
|
| |
* runtime/perf.c (_stp_perf_init): Pass through ERR_PTRs, and create our
own -ENOMEM for allocation failures.
* tapset-perfmon.cxx (perf_derived_probe_group::emit_module_init): Check
IS_ERR for registration status.
|
|
|
|
|
|
| |
The only information available in the overflow interrupt is the event.
Need to group other pieces of information needed by systemtap, so they
can be found based on the the location of the event information.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implements a very simple sampling runtime to using the performance
events kernel API. An perf event attribute describing the setup and a
function to handle the counter overflows are passed into
_stp_perf_init(). This function sets up the event on each processor.
If successfully initialized, a pointer data structure is
returned. When the sampling is no longer needed _stp_perf_del() is
called to shutdown the sampling.
* runtime/perf.h: Add declarations for data structures and functions
* runtime/perf.c: Remove old perfmon runtime runtime.
Add _stp_perf_init() and _stp_perf_del() functions.
|
|
|
|
|
| |
* runtime/sym.c (_stp_module_check): Use a failure-tolerant
get_user() loop instead of memcmp() for buildid binary strings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We didn't really have good semantics for what is meant by MAXTRYLOCK=0,
so when skipped.exp tried it, we ended up locking the variable and then
reporting a skip without ever unlocking it.
This is now cleaning up the semantics such that MAXTRYLOCK defines how
many times we should loop if the lock is busy. Thus MAXTRYLOCK=0 means
we try only once and fail immediately.
The testcase was accidentally creating contention due to the broken
unlock behavior. We now have to try a bit harder to create real
contention, so some lengthy delays are inserted to hoard the lock.
* runtime/probe_lock.h (stp_probe_lock): Fix the skip behavior.
* testsuite/systemtap.base/skipped.exp: Add a big udelay.
|
|
|
|
|
| |
* runtime/stack.c(print_stack_ops): Use print_context_stack and
adjust version code.
|
|
|
|
|
|
|
|
|
|
|
| |
* runtime/procfs-probes.c: Removed old kernel 2.6.16 code. Simplified
_spp_lock macros.
(_stp_proc_open_file): If file is busy, use a wait queue to wait on it
being available.
(_stp_proc_release_file): Decrease open count.
* tapset-procfs.cxx (emit_module_init): Updated procfs probe
initialization/shutdown routine names.
(emit_module_exit): Ditto.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tapset-procfs.cxx (procfs_derived_probe::procfs_derived_probe): Added
'maxsize_val' initialization.
(procfs_derived_probe::join_group): Updated '_stp_procfs_data'
definition and added STP_PROCFS_BUFSIZE.
(procfs_derived_probe_group::emit_module_decls): Emits structure to
contain procfs file buffers. Initializes '.bufsize' structure member.
(procfs_var_expanding_visitor::visit_target_symbol): Uses 'bufsize' for
maximum buffer size instead of using MAXSTRINGLEN.
(procfs_builder::build): Looks for '.maxsize(NNN)' parameter.
(register_tapset_procfs): Added '.maxsize(NNN)' parameter binding.
* runtime/procfs-probes.c (stap_procfs_probe): Converted 'buffer' to a
pointer and added 'bufsize' member.
* testsuite/semko/procfs13.stp: New testcase.
* testsuite/semko/procfs14.stp: Ditto.
* testsuite/semko/procfs15.stp: Ditto.
* testsuite/systemtap.base/procfs_maxsize.exp: Ditto.
* testsuite/systemtap.base/procfs.exp: Minor fix.
* stapprobes.3stap.in: Added '.maxsize(NNN)' documentation.
* stap.1.in: Added STP_PROCFS_BUFSIZE documentation.
|
|
|
|
|
|
| |
The kernel has min/max/clamp macros to make range comparisons easier.
Clamp is a newer invention, but we can define it for older kernels in
terms of min and max.
|
|
|
|
|
|
|
|
|
|
| |
Previously, our octal escapes used variable lengths, which can lead to
ambiguities. Also, 8-bit characters would only output the least digit.
* runtime/string.c (_stp_text_str): Always output 3-digit octal escapes,
and handle 8-bit chars more gracefully.
* testsuite/systemtap.string/text_str.stp: Include an 8-bit character.
* testsuite/systemtap.string/text_str.exp: Above + expect 3-digit octal.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* runtime/procfs.c: Allow STP_MAX_PROCFS_FILES define to be overridden.
(_stp_create_procfs): Calls proc_create() instead of create_proc_entry()
to avoid a race condition.
* runtime/procfs-probes.c: New file containing procfs probe support
routines.
* tapset-procfs.cxx (procfs_derived_probe::join_group): Update struct
_stp_procfs_data definition.
(procfs_derived_probe::emit_module_decls): Include procfs-probes.c,
which is where the definition of struct stap_procfs_probe exists.
Update generated routines to read/write procfs data.
(procfs_derived_probe_group::emit_module_init): Pass file_operations
argument to _stp_create_procfs(). Initialize mutex.
(procfs_var_expanding_visitor::visit_target_symbol): Update generated
code.
|
|
|
|
|
|
| |
* runtime/map.h: Set MAP_STRING_LENGTH to MAXSTRINGLEN so that large
strings can be stored in arrays.
* testsuite/systemtap.base/array_string.exp: New testcase.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* runtime/sym.h (_stp_module): add unwind_hdr_addr member.
* runtime/unwind.c (read_ptr_sect): Modification of read_pointer that
also handles offsets from text or "data" sections.
(read_pointer): Use it.
(_stp_search_unwind_hdr): Use read_ptr_sect to calculate values that
are relative to the .eh_frame_hdr section.
(unwind_frame): Search the frame header if this is an eh frame.
* translate.cxx (get_unwind_data): Get the eh_frame_hdr too.
(dump_unwindsyms): Write out eh_frame_hdr stuff.
|
|
|
|
| |
* uprobes-common.c (stap_uprobe_change_plus): Relax VM_EXEC check.
|
|
|
|
| |
* modverify.c (verify_module): Print some messages for verbose > 1.
|
|
|
|
| |
* runtime/stack.c (_stp_stack_print_tsk): Use _stp_symbol_print.
|
|
|
|
|
|
|
|
|
|
| |
When a process exits, it won't necessarily bother to munmap all of its
shared libraries. This patch makes sure that with uprobes in libraries,
we still grab an exit notification and clear everything out.
* runtime/uprobes-common.c (stap_uprobe_process_munmap): New.
* tapsets.cxx (uprobe_derived_probe_group::emit_module_decls): Use above
callback so that we can recover our resources on process exit.
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| | |
* access_process_vm (__access_process_vm_noflush): New
* tapsets.cxx (uprobe_derived_probe_group::emit_module_exit): Use it.
* translate.cxx (translate_pass): Declare it.
|
|/ |
|
|
|
|
|
|
|
|
|
| |
* runtime/uprobes2/uprobes.c (uprobe_get_pc_task): new function
(lookup_uretprobe): new helper function
(uprobe_get_pc): use it
* runtime/uprobes2/uprobes.h (uprobe_get_pc_task): declare
* runtime/uprobes/uprobes.c : ditto
* runtime/uprobes/uprobes.h : ditto
|
|
|
|
|
| |
* runtime/task_finder.c (__stp_utrace_attach): No longer prints bogus
error message when utrace_barrier succeeds.
|
|
|
|
|
|
| |
* buildrun.cxx (output_cpu_khz): New function to check cpu_khz.
(compile_pass): Invoke function output_cpu_khz.
* runtime/time.c : Use STAPCONF_CPU_KHZ.
|
|
|
|
|
| |
* runtime/stack.c (walk_context_stack): New function.
(print_stack_ops): Add function pointer.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
* runtime/alloc.c (_stp_kmalloc): Renamed 'MAXMEMORY' to 'STP_MAXMEMORY'.
(_stp_kzalloc): Ditto.
(_stp_vmalloc): Ditto.
(_stp_alloc_percpu): Ditto.
(_stp_kmalloc_node): Ditto.
* testsuite/systemtap.base/maxmemory.exp: New test for STP_MAXMEMORY.
|
|
|
|
|
|
|
|
|
|
| |
* runtime/alloc.c (_stp_mem_debug_validate): New debug function.
(_stp_kmalloc): Added MAXMEMORY code to check size of memory used by
module.
(_stp_kzalloc): Ditto.
(_stp_vmalloc): Ditto.
(_stp_alloc_percpu): Ditto.
(_stp_kmalloc_node): Ditto.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements proper unwinding from uprobes in the presence of
uretprobe trampolines.
* runtime/stack.c (_stp_stack_print): Rework for uprobe context case
and refactor a bit.
* runtime/uprobes2/uprobes.h (GET_PC_URETPROBE_NONE): new constant
* runtime/uprobes2/uprobes.c (uprobe_get_pc): Support translating the
trampoline function from uprobe context in addition to uretprobe
context.
* runtime/uprobes/uprobes.h (GET_PC_URETPROBE_NONE): ditto
* runtime/uprobes/uprobes.c (uprobe_get_pc): ditto
* tapsets.cxx (uprobe_derived_probe_group::emit_module_decls):
Initialize ri in context to GET_PC_URETPROBE_NONE in generated
enter_uprobe_probe.
* testsuite/systemtap.context/fib.stp: Add an option to do a backtrace
on function entry.
* testsuite/systemtap.context/fib.exp: Test backtrace in function
entry (uprobe) probes.
|
|
|
|
|
|
|
|
|
|
|
| |
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/stack-ppc.c (__stp_stack_print): Define STACK_FRAME_LR_SAVE,
STACK_FRAME_REGS_MARKER,STACK_FRAME_MARKER, etc.
|
|
|
|
| |
* runtime/stack-ia64.c (__stp_stack_print): Added new 'ri' parameter.
|
|
|
|
| |
* runtime/task_finder.c: Fixed last checkin.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tapset-utrace.cxx (utrace_derived_probe_group::emit_module_decls):
Handles new utrace api.
* runtime/itrace.c (usr_itrace_report_signal): Ditto.
(usr_itrace_report_clone): Ditto.
(usr_itrace_report_death): Ditto.
* runtime/task_finder.c (__stp_utrace_task_finder_report_clone): Ditto.
(__stp_utrace_task_finder_report_exec): Ditto.
(__stap_utrace_task_finder_report_death): Ditto.
(__stp_utrace_task_finder_target_death): Ditto.
(__stp_utrace_task_finder_target_quiesce): Ditto.
(__stp_utrace_task_finder_target_syscall_entry): Ditto.
(__stp_utrace_task_finder_target_syscall_exit): Ditto.
* runtime/uprobes2/uprobes.c (uprobe_report_signal): Ditto.
(uprobe_report_quiesce): Ditto.
(uprobe_report_exit): Ditto.
(uprobe_report_clone): Ditto.
(uprobe_report_exec): Ditto.
|
|
|
|
|
|
| |
* runtime/loc2c-runtime.h (usr_i386): Fix si/di ordering. Add ip.
(usr_x86_64): Add rip.
(u_*_register): Use kernel standard ARRAY_SIZE() instead of S().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
|
| |
* runtime/stack-i386.c (_stp_stack_print): Make call to uprobe_get_pc()
conditional on CONFIG_UTRACE.
* runtime/stack-x86_64.c: Ditto.
|
|
|
|
|
| |
* runtime/loc2c-runtime.h: Remove k_ vs u_[store_]deref; share instead.
* tapsets.cxx: Remove k_ vs u_ redirection for *deref().
|
|
|
|
| |
* runtime/stack.c (_stp_stack_print): Comment out *retprobe logic if !CONFIG_UTRACE.
|
|
|
|
| |
* runtime/uprobes/uprobes.c (uprobe_get_pc): new function
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|