| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
* tapsets.cxx (hwbkpt_derivedc_probe_group): Lose max_... field.
Rename hwbkpt_probes_vector -> hwbkpt_probes.
(enroll): Instead set it here, emit normal suppressible warning if
exceeded.
(emit_*): Use newline(NN) etc. for proper indentation of generated code.
(emit_module_init): Defer most potential problems to
register_wide_hw_breakpoint() instead of preemptive errors.
* translate.cxx (emit_module_init): Assert 0 indentation more frequently.
|
| |
|
|
|
|
|
|
| |
* tapsets.cxx (hwbkpt_builder::build): Assert needed
kernel_configs here, instead of..
(register_standard_tapsets): ... here.
|
|
|
|
|
|
|
| |
- Bind unprivileged permission at probe registration time.
- Remove check_unprivileged filter from derived_probe_builder
and its children.
- Add test suites for unprivilegedok and unprivilegedko.
|
|
|
|
|
|
|
|
| |
* tapsets-mark.cxx, tapsets.cxx: Don't even publish probe point families that are
inappropriate for use in --unprivileged mode.
(dwarf_derived_probe_*unprivileged*): Remove, to default to blanket no-permission
rather than emit_process_owner_permission mode.
* testsuite/semko/fortyeight.stp: New test.
|
|
|
|
|
|
| |
Switch to list<string> from set<string> for collecting
available $var lists. Use O(N**2) list-uniqueifier
that preserves initial ordering.
|
| |
|
|
|
|
| |
Part 2]
|
|
|
|
|
|
|
|
|
| |
Our hack for producing nicer listing modes was to write the mark name in
component index 1. That's fine for process.mark, but writes the wrong
position for process.library.mark. It now munges the last probe
component of any number of indexes.
(A better fix is due in PR10831, preserving the derivation chain.)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our literal_addr_to_sym_addr() function was just wrong. To compensate for
raw addresses read from elf (either given by the user or through a mark
transformation) we need to know what the elf_bias is (as returned by
dwfl_module_getelf) before feeding them to any libdwfl functions.
* tapsets.cxx (query_module_dwarf): Always add elf_bias to raw function or
statement addresses before calling query_addr().
(query_addr): Don't call literal_addr_to_sym_addr().
* dwflpp.h (literal_addr_to_sym_addr): Removed.
* dwflpp.cxx (literal_addr_to_sym_addr): Likewise.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tapsets.cxx (uprobe_derived_probe_group::emit_module_decls): Move
sdt_sem_address from standalone to stap_uprobes. Remove sdt_sem_tid.
In emitted function stap_uprobe_change_plus distinguish VM_EXEC/VM_WRITE
cases, use sdt_sem_address member, move setting of semaphores to new
emitted function stap_uprobe_change_semaphore_plus.
(stap_uprobe_process_found): Call stap_uprobe_change_semaphore_plus.
(stap_uprobe_mmap_found): Likewise.
* stap-postgres.stp (postgresrelease): New. Sync to current upstream version.
* stap-tcl.sh: Check if wget failed.
* stap-tcl.stp: Check for skipped probes.
* xulrunner.exp: Check if wget failed.
|
|
|
|
|
|
|
|
| |
* tapsets.cxx (emit_module_decls): #undef TRACE_INCLUDE_FILE
in front of each #include'd trace/event header, to prevent
macro redefinition.
(init_dw): Respect pending_interrupts in traceprobe module
compilation loop.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* sdt.h (UTRACE_SDT): Remove.
* tapset-utrace.cxx (utrace_derived_probe): Remove has_library and library.
(utrace_derived_probe_group::emit_probe_decl): Remove mmap_callback,
sdt_sem_offset, and sdt_sem_address.
(utrace_derived_probe_group::emit_module_decls): Remove sdt_sem_offset and
sdt_sem_address support.
* tapsets.cxx (sdt_var_expanding_visitor): Remove utrace_probe.
(sdt_query::handle_query_module) Remove utrace_type.
(sdt_query::convert_probe): Likewise.
* postgres.exp: Remove utrace testing.
* sdt.exp: Likewise.
* sdt_misc.exp: Likewise.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
* translate.cxx (translate_pass): Don't #include <access_blah.>
* tapsets.cxx, tapset-utrace.cxx: Replace __access_process_vm()
calls with get_user() / put_user() respectively.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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/loc2c-runtime.h: Remove k_ vs u_[store_]deref; share instead.
* tapsets.cxx: Remove k_ vs u_ redirection for *deref().
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* tapsets.cxx (uprobe_derived_probe_group::emit_module_decls): Emit
sdt_sem_tid. Use it to recalculate sem address when task changes.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
tapsets.cxx (sdt_query::handle_query_module): Improve trace handling.
(sdt_query::convert_location): Create new component instead of reusing old.
|
|
|
|
|
|
| |
sdt.h (STAP_PROBE_ADDR): Add 32 bit big endian case.
(STAP_PROBE_DATA_): Use .balign
tapsets.cxx (sdt_query::get_next_probe): Stop if there is no probe name.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
tapset-utrace.cxx (TOK_LIBRARY): New.
(utrace_derived_probe::utrace_derived_probe): Add library and has_library.
(utrace_builder::build): Handle library.
(utrace_derived_probe_group::emit_probe_decl): Add sdt_sem_offset to
emitted stap_utrace_probes. Add stap_task_finder_target
mmap_callback for handling shared library. Handle sdt_sem_offset in
emitted_stp_utrace_probe_cb. Add stap_utrace_mmap_found.
(register_tapset_utrace): Handle .library
tapset-utrace.cxx (TOK_LIBRARY): New.
(base_query::base_query): Add path and has_library.
(dwarf_derived_probe::dwarf_derived_probe) Likewise.
(dwarf_derived_probe::register_patterns): Handle .library
(sdt_query::convert_location): Likewise.
(dwarf_builder::build): Likewise.
(uprobe_derived_probe_group::emit_module_decls): Emit
sdt_sem_address. Add sdt_sem_offset to emitted stap_uprobe_spec.
Add offset and vm_flags to signature of stap_uprobe_change_plus, and
handle sdt_sem_offset. Allow writeable segments in emitted
stap_uprobe_mmap_found.
sdt_misc.exp: Test .library
util.cxx (find_executable): Add env_path to sig and use it in getenv.
util.h (find_executable): Likewise. Make "PATH" the default.
dtrace.in (provider): Turn on semaphores.
sdt.h: Likewise.
|
|
|
|
|
|
|
|
|
|
|
| |
* translate.cxx (emit_common_header): Change type of 'contexts' to an
array of struct context pointers.
(emit_module_init): Allocate a context structure for each possible cpu.
Free each if an error occurs.
(emit_module_exit): Update contexts reference. Free each possible cpu's
context structure.
* tapsets.cxx (common_probe_entryfn_prologue): Use array instead of percpu
data for context structure.
|
|
|
|
|
|
|
|
| |
In 2.6.32-rc7, there are two power.h tracepoints headers, and only the
one in trace/events/ is valid. In general, we can expect that
trace/events/ has newer headers, so we should search those first.
* tapsets.cxx (tracepoint_builder::init_dw): Search /events/ first.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since 2.6.25, kretprobes can carry a data packet to be filled in an
entry_handler. This patch lets us store our implicitly-saved $target
variables in .return probes in that data area.
* tapset/kretprobe.stp: New get/set functions for kretprobe data.
* translate.cxx (c_unparser::emit_common_header): Add context->pi_longs.
* tapsets.cxx
(dwarf_var_expanding_visitor::visit_target_symbol_saved_return): Switch
between the old and new methods of saving $vars in .return probes.
(dwarf_var_expanding_visitor::gen_mapped_saved_return): The old way.
(dwarf_var_expanding_visitor::gen_kretprobe_saved_return): The new way.
(dwarf_derived_probe::join_group): Don't register paired entry-handlers.
(dwarf_derived_probe::dwarf_derived_probe): Remember saved-var details.
(dwarf_derived_probe_group::emit_module_decls): Output saved-var details.
Also split the kretprobe handler whether we're on entry or return.
(dwarf_derived_probe_group::emit_module_init): Prepare the entry handler.
* testsuite/systemtap.base/kretprobe-vars.stp: Test implicit $var saving.
|
| |
|
|\ |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Normally, using a $var in a return probe create a matching entry probe
to save the value. We don't want all this machinery though when we're
just checking the accessibility of a $var for -L mode.
* tapsets.cxx (dwarf_derived_probe::saveargs): Save/restore has_return
while the $var accesses are attempted.
|
| |
| |
| |
| | |
atomic_cmpxchg
|
| |
| |
| |
| | |
* tapsets.cxx (dwarf_derived_probe::saveargs): fill fields.
|
|/
|
|
|
|
|
|
|
|
|
| |
This allows insert_module to to be used for loading the signed uprobes.ko
module.
Allow the use of $$parms and $$return in uprobes based probes for
unprivileged users.
Re-add management of module signatures in the cache. Don't know why
it was removed.
|
|
|
|
|
|
|
| |
* elaborate.h: Remove printargs and add getargs.
* tapset-mark.cxx (mark_derived_probe): Ditto.
* tapsets.cxx (dwarf_derived_probe,tracepoint_derived_probe): Ditto.
* main.cxx (printscript): Make intersection before printing.
|
| |
|
|
|
|
| |
* tapsets.cxx (dwarf_ and kprobe_derived_probe_group): Redefine KRETACTIVE.
|
|
|
|
| |
* tapsets.cxx (saveargs): check the accessibility.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Guided by pahole, I've shaved off a few padding bytes here and there.
New sizes on x86_64:
stap_task_finder_target 192 -> 184
stap_itrace_probe 216 -> 208
stap_utrace_probe 328 -> 312
stap_uprobe_tf 200 -> 192
stap_uprobe_spec 48 -> 40
I only changed field layouts, not types or names, so this should be
perfectly safe. (FLW)
|
|
|
|
|
| |
* tapsets.cxx (visit_target_symbol): When catching semantic_error,
fill in token value if unset. Can happen for loc2c DIE() msgs.
|
|
|
|
|
|
| |
My print_format refactoring in d5e178c1 missed an improperly-named
token, an sprint that should be sprintf. Since the token value is now
significant, that name needs to be correct.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We almost had a factory in print_format::parse_print, so let's take that
the rest of the way. This way we don't have so much duplication in
initializing the print flags.
* staptree.cxx (print_format::parse_print): Replaced with...
(print_format::create): New factory to parse and create print_formats.
* elaborate.cxx (add_global_var_display): Use this factory.
* parse.cxx (parser::parse_symbol): Ditto.
* tapset-mark.cxx
(mark_var_expanding_visitor::visit_target_symbol_context): Ditto.
* tapset-utrace.cxx
(utrace_var_expanding_visitor::visit_target_symbol_arg): Ditto.
* tapsets.cxx
(dwarf_var_expanding_visitor::visit_target_symbol_context): Ditto.
(tracepoint_var_expanding_visitor::visit_target_symbol_context) Ditto.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
* tapset-itrace.exp (itrace_derived_probe ctor): Fail if !CONFIG_UTRACE.
* tapset-utrace.exp (utrace_derived_probe ctor): Fail if !CONFIG_UTRACE.
* tapsets.cxx (dwarf_builder::build): Fail process.* if !CONFIG_UTRACE.
* testsuite/semko/utrace.stp: New test.
|