summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
Commit message (Collapse)AuthorAgeFilesLines
...
| * Cache the tracepoint query resultsJosh Stone2009-03-201-1/+33
| | | | | | | | | | | | | | To use tracepoints, we build a "tracequery" module that compiles debuginfo for all available tracepoints in the user's kernel. That's a bit of a cumbersome step to do during pass-2 though. This change adds tracequery caching so we only need to compile it once.
| * PR9967: don't count -DINTERRUPTIBLE=1 reentrancy against MAXSKIPPEDFrank Ch. Eigler2009-03-201-1/+3
| | | | | | | | | | | | | | * tapsets.cxx (common_probe_entryfn_prologue): Become conditional on !INTERRUPTIBLE. * translate.cxx (emit_module_exit): Still print skipped_count_reentrant with -t, even if skipped_count was zero.
* | Emit vma callbacks for uprobes.Mark Wielaard2009-03-201-0/+20
| | | | | | | | | | | | | | | | * tapsets.cxx (uprobe_derived_probe_group::emit_module_decls): Emit vma callbacks. (uprobe_derived_probe_group::emit_module_init): Activate vma callbacks. * testsuite/systemtap.context/usymbols.exp: Track through uprobes, so as to make sure we have the symbols.
* | Emit vma callbacks for itrace.Mark Wielaard2009-03-201-0/+25
| | | | | | | | | | | | * tapsets.cxx (itrace_derived_probe_group::emit_module_decls): Emit vma callbacks. (itrace_derived_probe_group::emit_module_init): Activate vma callbacks.
* | Explicitly emit utrace vma callbacks.Mark Wielaard2009-03-201-48/+45
| | | | | | | | | | | | | | | | * tapsets.cxx (utrace_derived_probe_group::emit_vm_callback_probe_decl): Removed. (emit_vma_callback_probe_decl): New static helper function. (utrace_derived_probe_group::emit_module_decls): Emit vma callbacks. (utrace_derived_probe_group::emit_module_init): Activate vma callbacks.
* | Move _stp_tf_vm_cb to sym.c.Mark Wielaard2009-03-201-41/+0
| | | | | | | | | | | | * 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.
* | Don't double include task_finder.c.Mark Wielaard2009-03-201-1/+0
| | | | | | | | | | * tapsets.cxx (itrace_derived_probe_group::emit_module_decls): Don't emit another include task_finder.c. Already done through runtime.h.
* | Merge branch 'master' into pr6866Mark Wielaard2009-03-201-42/+86
|\|
| * PR9960: support tracepoint struct/union value argJosh Stone2009-03-191-3/+13
| | | | | | | | | | | | If a tracepoint arg is a structure or union that is passed by value, then this takes the address of the parameter so it can be used like a pointer in the rest of our code.
| * Throw type into semantic_error message of @cast when not found.Mark Wielaard2009-03-191-1/+2
| | | | | | | | | | * tapsets.cxx (dwarf_cast_expanding_visitor::visit_cast_op): Add type to msg added to semantic_error when thrown.
| * Disable kprobe blacklist in guru mode.Lubomir Rintel2009-03-191-3/+11
| |
| * rename process().itrace -> process().insn introduce process().insn.blockFrank Ch. Eigler2009-03-191-3/+10
| |
| * PR9959: hide tracepoint arguments of unknown typeJosh Stone2009-03-181-18/+22
| | | | | | | | | | | | We always have to know the type name of tracepoint arguments, so we can declare the right function callback, but we can suppress access to those types which we don't (yet) know how to read.
| * PR9959: improve tracepoint arg type-namingJosh Stone2009-03-181-14/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dwarf_type_name now works with more argument types. There were three cases that I needed to improve: - For "const struct foo*", the debuginfo has a const-DIE named "foo" chained to a struct-DIE named "foo", so we can't assume that seeing a name means we're down to the base type. The recursion now decends until it explicitly sees a base_type, typedef, struct, or union. - For "void*", the debuginfo has a pointer-DIE without any DW_AT_type after. Now I'm just catching that failed lookup and writing in "void". - For "va_list", the debuginfo actually resolves to an internal type "struct __va_list_tag*", but that struct has no declaration at the source level. I'm just hacking that exact case to say "va_list" instead, but it would be nice to find something cleaner... We'll probably still have problems if any tracepoint uses a function- pointer argument, but so far I've only seen that as a "void*", which we now handle ok.
| * Support tracepoints with no argumentsJosh Stone2009-03-181-0/+2
| | | | | | | | | | | | LTTng has a few tracepoints without any arguments, which caused our compile to fail, claiming that our entry function was not a declaration. This just adds an explicit (void) argument list for that case.
* | Remove __stp_tf_vm_cb from task_finder interface.Mark Wielaard2009-03-191-2/+43
| | | | | | | | | | | | * runtime/task_finder.c (__stp_tf_vm_cb): Removed. * tapsets.cxx (utrace_derived_probe_group::emit_module_decls): Output task finder vma callback and hook it.
* | Merge branch 'master' into pr6866Mark Wielaard2009-03-171-146/+945
|\| | | | | | | | | Resolved conflicts: runtime/task_finder.c: name vs path.
| * Fix regression in tracepoint unregistrationJosh Stone2009-03-161-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | Commit 96b030fe reorganized the tracepoint registration calls by creating generic wrappers that return int. However, the older tracepoint implementation (as found in RHEL5.3) returned void for unreg, so this was failing pass-4. Since we can't handle unregistration failures anyway, this change just makes the generic unregister function return void instead. As noted in the newly-added comment, it should be safe for us to ignore unreg failures.
| * Move vma module tracking from pr6866 branch to master.Mark Wielaard2009-03-151-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | * tapsets.cxx (utrace_derived_probe_group::emit_module_decls): Always emit vm callback probe for __stp_tf_vm_cb. * runtime/task_finder.c (__stp_tf_vm_cb): Always expose, move _stp_dbug statements under ifdef DEBUG_TASK_FINDER_VMA. Find and record corresponding module when vm_path not NULL. * runtime/task_finder_vma.c (struct __stp_tf_vma_entry): Add _stp_module. (stap_add_vma_map_info): Add _stp_module argument and assign. (__stp_tf_get_vma_entry_addr): New static function to get the __stp_tf_vma_entry given an address.
| * Simplify tracepoint registrationsJosh Stone2009-03-121-28/+43
| | | | | | | | | | | | | | Instead of registering tracepoints with the deeply-nested if-tree, which was cluttering the module_init/exit, this now emits normalized reg/unreg functions for each tracepoint probes. Now the module_init/exit can be a simple loop like all of the other probe types.
| * Fix @cast module splittingJosh Stone2009-03-111-1/+1
| | | | | | | | | | | | The new semok testcase exposed that the module splitting wasn't properly setting substr boundaries. Instead of passing the end position, it's supposed to pass the number of characters (end - begin). Oops.
| * PR 7071: Optional $context variables fixRajan Arora2009-03-111-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tapsets.cxx (dwarf_var_expanding_visitor::visit_target_symbol): Substitute erroneous target symbol with literal 0 if session level flag, skip_badvars is set. * session.h (struct systemtap_session): New flag: skip_badvars. * main.cxx: Command line argument --skip-badvars added. * stap.1.in: Entry for new option --skip-badvars. * NEWS: Added blurb for new option now available. * testsuite/semok/badvar.stp: Test case to check added functionality.
| * Make marker probe support listing mode -LWenji Huang2009-03-101-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is to enable displaying the arguments of marker probe for listing mode -L. The output is like, $stap -L 'kernel.mark("*")' kernel.mark("core_marker_format").format("name %s format %s") $arg1:string $arg2:string kernel.mark("jbd2_checkpoint").format("dev %s need_checkpoint %d") $arg1:string $arg2:long kernel.mark("jbd2_end_commit").format("dev %s transaction %d head %d") $arg1:string $arg2:long $arg3:long kernel.mark("jbd2_start_commit").format("dev %s transaction %d") $arg1:string $arg2:long Note: It's also possible to figure out the arguments according to the format. Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
| * Make tracepoint probe support listing mode -LWenji Huang2009-03-101-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is to enable displaying arguments of tracepoint probe in listing mode -L. The example output is like $stap -L 'kernel.trace("block_bio*")' kernel.trace("block_bio_bounce") $q:struct request_queue* $bio:struct bio* kernel.trace("block_bio_backmerge") $q:struct request_queue* $bio:struct bio* kernel.trace("block_bio_complete") $q:struct request_queue* $bio:struct bio* kernel.trace("block_bio_queue") $q:struct request_queue* $bio:struct bio* kernel.trace("block_bio_frontmerge") $q:struct request_queue* $bio:struct bio* Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
| * PR9932: add @cast module search pathJosh Stone2009-03-101-39/+30
| | | | | | | | | | | | | | | | | | | | | | | | Sometimes @cast()ing can fail if the type needed may or may not be defined in a kernel module. This patch lets @cast take a colon- separated list of modules to search for the type definition. * tapsets.cxx (dwarf_cast_query): Simplify. Take the module and the code result as reference parameters, and use code.empty() as the sign that the type isn't resolved yet. (dwarf_cast_expanding_visitor::visit_cast_op): Split e->module by colon into substrings, and loop until the type is resolved.
| * Let -DINTERRUPTIBLE=0 mask interrupts in probesJosh Stone2009-03-091-24/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some time ago we loosened up the code for all probe types to allow interrupts during the handler. However, when probing something like kernel.trace("*"), you get a mix of probes in and out of the interrupt path, and it becomes much more common to have probes skipped due to interrupt reentrancy. The common_probe_entryfn_prologue and common_probe_entryfn_epilogue functions had an interruptible flag, but this was no longer used anywhere. I removed this flag, but then reused the logic to check an INTERRUPTIBLE macro instead. Now users can use -DINTERRUPTIBLE=0 to prevent interrupt reentrancy in their script, at the cost of a bit more overhead to toggle the interrupt mask.
| * Add tracepoint $$parms alias for $$varsJosh Stone2009-03-091-3/+5
| | | | | | | | | | | | For parity with the DWARF probes, this makes tracepoints also define $$parms, which has the same value as $$vars (since tracepoints are missing the concept of $$locals).
| * Update location of c->probe_point resetJosh Stone2009-03-091-1/+1
| | | | | | | | | | The probe_point clear was nested in the overload processing code, I believe accidentally. This just makes it always cleared on probe exit.
| * Fix and add tests for function(".so").statement(N)Stan Cox2009-03-081-3/+3
| | | | | | | | | | | | | | | | * tapsets.cxx (query_dwarf_func): die_has_pc (dwarf_haspc) does not expect a module_start for shared objects so don't call module_address_to_global for the statement address. * testsuite/systemtap.base/labels.exp: Add tests for executable .statement(N), shared object .label("L") and so .statement(N).
| * PR9930: reentrancy debuggingFrank Ch. Eigler2009-03-071-38/+35
| | | | | | | | | | | | | | | | | | If stap is run with "-t -DDEBUG_REENTRANCY", additional warnings will be printed for every reentrancy event, including the probe points of the resident and interloper probes. * tapsets.cxx (common_probe_entryfn_prologue): Add "new_pp" argument, update all callers. Print reentrancy details if needed.
| * Tweak tracepoint logic to run on tracepoint_synchronize_unregister()-less RHEL5Frank Ch. Eigler2009-03-071-4/+13
| |
| * Ensure tracepoints are synchronized after unregJosh Stone2009-03-061-0/+4
| | | | | | | | | | | | | | | | | | | | The tracepoint API provides tracepoint_synchronize_unregister() as a way to guarantee that all tracepoint handlers are inactive. This is necessary after unregistering to allow the module to safely unload. * tapsets.cxx (tracepoint_derived_probe_group::emit_module_init): Call synchronize after unregistering tracepoints. (tracepoint_derived_probe_group::emit_module_exit): Ditto.
| * Enable tracepoint target variablesJosh Stone2009-03-061-3/+338
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses a similar mechanism as marker probes for storing target variables in locals of the probe body. * tapsets.cxx (tracepoint_arg): Add fields to help $target access. (tracepoint_var_expanding_visitor): Expand code to access target variables - a $target for each tracepoint parameter, as well as the special $$name and $$vars. (tracepoint_derived_probe::tracepoint_derived_probe): Expand targets (resolve_tracepoint_arg_type): Determine if a parameter is a type that we can dereference, and store the underlying type. (tracepoint_derived_probe::build_args): Resolve the types. (tracepoint_derived_probe::emit_probe_context_vars): Emit $target placeholders into the locals of the probe body. (tracepoint_derived_probe_group::emit_module_decls): Initialize $targets from the entry point parameters.
| * Emit code to hook up tracepoint probesJosh Stone2009-03-061-4/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tapsets.cxx (tracepoint_arg): New (tracepoint_derived_probe): Add declaring header name and arg vector (dwarf_type_name): Build a type string for a given type DIE (tracepoint_derived_probe::build_args): Scan the function DIE for the name and type of formal parameters required by the tracepoint. (tracepoint_derived_probe::tracepoint_derived_probe): Call build_args and determine the relevant header to include. (tracepoint_derived_probe_group::emit_module_decls): For each tracepoint, include its header and declare a probe entry point with the right function signature. (tracepoint_derived_probe_group::emit_module_init): Call the registration for each tracepoint, and handle error unwinding. (tracepoint_derived_probe_group::emit_module_exit): Unregister each.
| * Build skeleton tracepoint probesJosh Stone2009-03-061-4/+79
| | | | | | | | | | | | * tapsets.cxx (tracepoint_derived_probe): Create a skeleton probe (tracepoint_derived_probe_group): Create a skeleton group (tracepoint_query::handle_query_func): build a probe
| * Scan tracequery.ko for tracepointsJosh Stone2009-03-061-1/+79
| | | | | | | | | | | | | | * tapsets.cxx (tracepoint_query): Iterate over the modules, CUs, and functions in tracequery.ko looking for our hijacked tracepoint declarations. (tracepoint_builder::build): Run a tracepoint_query
| * Build tracequery to scan for tracepointsJosh Stone2009-03-061-0/+82
| | | | | | | | | | | | | | | | | | | | * session.h (systemtap_session): add tracepoint_derived_probes * buildrun.cxx (make_tracequery): New - builds a kernel module that hijacks the tracepoint declarations, so we can query debuginfo. * buildrun.h: declare above * tapsets.cxx (tracepoint_builder): New builder for tracepoint probes. For now it just handles the initialization to build the tracequery kernel module.
| * Make iterate_over_functions work with base_querysJosh Stone2009-03-061-14/+17
| | | | | | | | | | | | | | | | | | | | * tapsets.cxx (dwflpp::iterate_over_functions): Change arg from void* to base_query*, and add explicit function-search parameters. (query_cu): update caller (query_dwarf_func): update callback signature (Note: instead of passing around callback functions, it might be nicer to use a virtual method in base_query...)
| * Make session.module_cache init more consistentlyJosh Stone2009-03-041-7/+3
| | | | | | | | | | | | | | | | | | We used to check & init module_cache in a few inconsistent places. Now it is always handled in dwflpp::setup_user/setup_kernel. * tapsets.cxx (dwflpp::setup_user): add module_cache check (dwarf_builder::build): remove module_cache check (dwarf_cast_expanding_visitor::visit_cast_op): ditto
| * Search for a label instead of an address for .so static probes.Stan Cox2009-03-031-1/+4
| | | | | | | | * tapsets.cxx (dwflpp::build): Use .label for .so instead of .statement(N)
| * This patch updates the itrace code to support the new utrace interface.Maynard Johnson2009-03-031-0/+1
| | | | | | | | | | It also adds a private copy of access_process_vm to runtime/itrace.c since that function is not consistently exported by all distros.
| * Merge branch 'master' of git+ssh://sources.redhat.com/git/systemtapEugeniy Meshcheryakov2009-02-281-2/+2
| |\
| | * PR9896: Fix SystemTap build on Ubuntu Intrepid.Ananth N Mavinakayanahalli2009-02-251-2/+2
| | | | | | | | | | | | The gcc on Ubuntu doesn't like fprintf() without format arguments
| * | Merge branch 'master' of git+ssh://sources.redhat.com/git/systemtapEugeniy Meshcheryakov2009-02-241-14/+20
| |\|
| | * Improve static probe: c++ navigation, -l output.Stan Cox2009-02-231-13/+16
| | | | | | | | | | | | | | | | | | | | | * tapsets.cxx (dwflpp::build): Improve c+ method navigation. Use .label for listing mode. * systemtap.base/static_uprobes.exp: Test multiple invocations of the same probe per block. (SW9770)
| | * Check whether a die has any children before iterating over it.Mark Wielaard2009-02-231-1/+4
| | | | | | | | | | | | * tapsets.cxx (iterate_over_cu_labels): Check dwarf_child result.
| * | Don't include unused libebl.hEugeniy Meshcheryakov2009-02-231-1/+0
| |/
* | Merge branch 'master' into pr6866Mark Wielaard2009-02-201-252/+595
|\| | | | | | | | | | | | | | | | | | | Conflicts: ChangeLog: Removed runtime/ChangeLog: Removed runtime/sym.c: Merged runtime/task_finder.c: Merged tapset/ChangeLog: Removed testsuite/ChangeLog: Removed
| * Always emit .probes section; use .label method as a backup strategyStan Cox2009-02-181-2/+7
| |
| * Enable typecasting with @castJosh Stone2009-02-181-35/+341
| |\ | | | | | | | | | | | | | | | | | | println(@cast(myptr, "task_struct")->pid) println(@cast(myptr, "task_struct", "kernel")->pid) Merge branch 'typecast', bump ChangeLog entries to push date