summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
Commit message (Collapse)AuthorAgeFilesLines
* hwbkpt: simplify diagnostics and codeFrank Ch. Eigler2010-02-211-103/+80
| | | | | | | | | | | * 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.
* Translator enablement of Hardware breakpoints for s390Prerna Saxena2010-02-211-2/+16
|
* hardware breakpoints: improve error messages for unsupported configurationsFrank Ch. Eigler2010-02-191-17/+22
| | | | | | * tapsets.cxx (hwbkpt_builder::build): Assert needed kernel_configs here, instead of.. (register_standard_tapsets): ... here.
* Rework identification of probes allowed for unprivileged users.Dave Brolley2010-02-151-38/+89
| | | | | | | - 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.
* PR11256: harden --unprivileged modeFrank Ch. Eigler2010-02-051-26/+11
| | | | | | | | * 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.
* rhbz 560890: preserve -L/-l variable orderingNobuhiro Tachino2010-02-021-9/+9
| | | | | | Switch to list<string> from set<string> for collecting available $var lists. Use O(N**2) list-uniqueifier that preserves initial ordering.
* Remove unused variable argstreamWenji Huang2010-02-021-1/+0
|
* Hardware Breakpoints for x86 / x86_64, based on mainline kernel. [Changes : ↵Prerna Saxena2010-01-291-3/+355
| | | | Part 2]
* Fix the listing mode of process.library.markJosh Stone2010-01-181-1/+1
| | | | | | | | | 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.)
* PR11173 Markers get a bad address in prelinked libraries.Mark Wielaard2010-01-181-2/+9
| | | | | | | | | | | | | 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.
* PR11151: Recover stap_uprobes slots on process exitJosh Stone2010-01-141-0/+1
| | | | | | | | | | 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.
* Merge branch 'master' of ssh://sources.redhat.com/git/systemtapWilliam Cohen2010-01-131-2/+2
|\
| * Use __access_process_vm_noflush for static user semaphore decrement.Stan Cox2010-01-131-2/+2
| | | | | | | | | | | | * 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.
* | Move userspace probing boiler plate code in translator to runtime library.William Cohen2010-01-131-357/+10
|/
* Pull set of semaphore into its own function.Stan Cox2010-01-101-53/+85
| | | | | | | | | | | | | | * 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.
* tracepoints build fixFrank Ch. Eigler2010-01-091-0/+3
| | | | | | | | * 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.
* Merge remote branch 'origin/master'Tim Moore2010-01-051-52/+25
|\
| * Purge sdt utrace support.Stan Cox2010-01-041-52/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | bz6436 backtraces from uprobesTim Moore2010-01-051-0/+1
|/ | | | | | | | | | | | | | | | | | | | | 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.
* sdt.h semaphore: use get_user / put_user instead of __access_process_vm.Frank Ch. Eigler2009-12-221-5/+5
| | | | | | * 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.
* PR11015 Support shared library reloading (in different processes)Mark Wielaard2009-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* PR10601: unfork deref()Frank Ch. Eigler2009-12-201-6/+0
| | | | | * runtime/loc2c-runtime.h: Remove k_ vs u_[store_]deref; share instead. * tapsets.cxx: Remove k_ vs u_ redirection for *deref().
* PR10601 part 1: i386 and x86-64 regset for dwarf fetch/store_register()sFrank Ch. Eigler2009-12-201-5/+38
| | | | | | | | | | * 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.
* Recalculate sem address when tid changes.Stan Cox2009-12-191-1/+7
| | | | | * tapsets.cxx (uprobe_derived_probe_group::emit_module_decls): Emit sdt_sem_tid. Use it to recalculate sem address when task changes.
* Remove uprobes.h declaration from runtime.hTim Moore2009-12-181-0/+10
| | | | | | | | | | | 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.
* set the IP in return probes to the returned-to instructionTim Moore2009-12-161-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix handling of multiple sdt uprobes with the same name.Stan Cox2009-12-151-8/+18
| | | | | tapsets.cxx (sdt_query::handle_query_module): Improve trace handling. (sdt_query::convert_location): Create new component instead of reusing old.
* Handle .probes section big endian 32 bit case.Stan Cox2009-12-091-1/+9
| | | | | | 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.
* Add .library("lib").mark("mark") and use it for .mark semaphores.Stan Cox2009-12-081-66/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix PR 11034 by directly allocating per-cpu context data.David Smith2009-12-021-1/+1
| | | | | | | | | | | * 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.
* PR10983: Give preference to tracepoints in trace/events/Josh Stone2009-11-181-2/+2
| | | | | | | | 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.
* PR5916: Exploit kretprobe data storage areaJosh Stone2009-11-101-27/+160
| | | | | | | | | | | | | | | | | | | | 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.
* PR10877: Give token* to each component instead of each probe_pointCharley Wang2009-11-101-2/+2
|
* Merge branch 'master' of ssh://sources.redhat.com/git/systemtapDave Brolley2009-11-091-4/+16
|\
| * Fix a comment typoJosh Stone2009-11-061-1/+1
| |
| * expand comment on has_return=0 treatment of -L foo.return probesFrank Ch. Eigler2009-11-061-3/+7
| |
| * Constrain $var-checking for -L of .return probesJosh Stone2009-11-061-10/+10
| | | | | | | | | | | | | | | | | | 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.
| * PR10849: Support MAXSKIPPED handling on RHEL4 through implementation of ↵Roland Grunberg2009-11-061-2/+2
| | | | | | | | atomic_cmpxchg
| * PR10820-cont': initialize the fields of empty tokenWenji Huang2009-11-061-0/+8
| | | | | | | | * tapsets.cxx (dwarf_derived_probe::saveargs): fill fields.
* | Don't reference global variable modpath in insert_module and its helpers.Dave Brolley2009-11-091-0/+30
|/ | | | | | | | | | | 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.
* PR10466: print the set-intersection of variables retrieved from each branchWenji Huang2009-11-041-11/+9
| | | | | | | * 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.
* PR10849: make MAXSKIPPED overflow trigger an error messageCharley Wang2009-11-021-4/+4
|
* PR10839: compute default KRETACTIVE from num_possible_cpus() instead of NR_CPUSFrank Ch. Eigler2009-10-301-2/+2
| | | | * tapsets.cxx (dwarf_ and kprobe_derived_probe_group): Redefine KRETACTIVE.
* PR10820: stap -L ignores any variable that isn't accessibleWenji Huang2009-10-291-6/+19
| | | | * tapsets.cxx (saveargs): check the accessibility.
* Improve some runtime struct layoutsJosh Stone2009-10-191-1/+1
| | | | | | | | | | | | | | 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)
* provide error message token/context if loc2c doesn'tFrank Ch. Eigler2009-10-191-0/+1
| | | | | * tapsets.cxx (visit_target_symbol): When catching semantic_error, fill in token value if unset. Can happen for loc2c DIE() msgs.
* Fix $$targets in dwarf probesJosh Stone2009-10-141-1/+1
| | | | | | 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.
* Consolidate print_format creationJosh Stone2009-10-131-15/+2
| | | | | | | | | | | | | | | | | | 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.
* Merge branch 'master' of ssh://sources.redhat.com/git/systemtapDave Brolley2009-10-131-4/+6
|\
| * PR10746: improve error message on utrace-less kernelsFrank Ch. Eigler2009-10-081-0/+3
| | | | | | | | | | | | | | * 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.