summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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
|/
* 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
| * Enable dwarf expansion of @castsJosh Stone2009-02-181-35/+329
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will iterate over the module and its CUs looking for the type definition, and then work with loc2c to dereference the pointer. * loc2c.c (c_translate_argument): Create a dummy location to start the address computation from a function parameter. * translate.cxx (base_query, dwarf_query): Move some members from base_query to dwarf_query, so the former can be more generic. Also add a constructor using a module string instead of probe parameters. (dwflpp::query_modules, dwflpp::iterate_over_modules): Use a generic base_query instead of a dwarf_query. (dwarf_cast_query): New query to scan the modules and CUs for a matching type definition, and then produce a code fragment to deref each component. (dwarf_cast_expanding_visitor): Tries to replace @casts with a function call to the result of a dwarf_cast_query. (dwflpp::declaration_resolve): Search by name instead of by die. (dwflpp::translate_components): Use the incoming vardie as the first type die, so we don't assume that attr_mem has a DW_AT_type already. (dwflpp::literal_stmt_for_pointer): Construct a C fragment that starts with a pointer argument (THIS->pointer) and dereferences each member component from there. (*_derived_probe::register_patterns): Take a session parameter instead of a match_node, so we can manipulate session-wide data. (dwarf_derived_probe::register_patterns): Add a session code filter to expand @casts with a dwarf_cast_expanding_visitor.
| * Provide dwarf module names as defaults in @cast()sJosh Stone2009-02-181-0/+12
| | | | | | | | | | | | * tapsets.cxx (dwarf_var_expanding_visitor::visit_cast_op): While expanding dwarf probes, provide the current module as a default to @casts without a module name.
* | Handle c++ static user probes via .probe, c via .label.Stan Cox2009-02-151-92/+57
| |
* | Moved inclusion of runtime/procfs.c to a better place.David Smith2009-02-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 2009-02-12 David Smith <dsmith@redhat.com> * tapsets.cxx (procfs_derived_probe_group::emit_module_decls): Moved inclusion of procfs.c here from runtime/transport.c 2009-02-12 David Smith <dsmith@redhat.com> * transport.c: Moved inclusion of procfs.c to procfs_derived_probe_group::emit_module_decls() in tapsets.cxx.
* | Extend blacklist to cover bitops.h. While there, fixup paths for existing ↵Ananth N Mavinakayanahalli2009-02-121-0/+5
|/ | | | blacklisted files
* Merge branch 'update_visitor'Josh Stone2009-02-101-70/+68
|\ | | | | | | | | | | | | | | | | | | | | | | This brings a new update_visitor that makes it easier to traverse the parse tree and modify parts of it as necessary. I wrote this as part of my in-progress work to allow @cast() expansion, but I was able to apply it to the dwarf/etc. target variable expanders and to the optimization stages. I think the resulting code is more predictable and easier to follow... Conflicts: ChangeLog (bumped my commit dates to push dates...)
| * Expand probe variables without a deep copyJosh Stone2009-02-101-50/+46
| | | | | | | | | | | | | | * tapsets.cxx (var_expanding_copy_visitor): This struct becomes var_expanding_visitor and inherits from update_visitor instead of deep_copy_visitor. Each of the probe-type variants of this are also no longer copiers.
| * Simplify require() and provide()Josh Stone2009-02-101-25/+27
| | | | | | | | | | | | | | * staptree.h (require, provide): Simplify stack operations with less pointer magic, and move to be deep_copy_visitor members. * staptree.h (deep_copy_visitor::deep_copy): Templatize * staptree.cxx, tapsets.cxx: Refactor require/provide callers
* | fix segv that sometimes occurs on buildok/nfs-all-probes.stp on 2.6.29ish ↵Frank Ch. Eigler2009-02-101-1/+1
|/ | | | kernels
* PR9810: Mostly revert "PR6961: initial sketch: set up dummy pt_regs for ↵Frank Ch. Eigler2009-02-031-26/+11
| | | | non-trap based probes"
* Add .label("label")Stan Cox2009-02-011-0/+67
|
* Add Vim modelines for GNU style in stapJosh Stone2009-01-281-0/+2
|
* Use 'static' as much as possibleJosh Stone2009-01-281-17/+17
| | | | | | | | | | 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.
* Fix syscall.exp.Stan Cox2009-01-261-5/+8
|
* PR9768 fixFrank Ch. Eigler2009-01-231-11/+17
|
* Add dtrace -h supportStan Cox2009-01-221-6/+17
|
* improve var=? explanation debugging via -vvvFrank Ch. Eigler2009-01-201-3/+12
|
* Fix compilation warning of too large number on 32-bits machines.Wenji Huang2009-01-111-2/+2
|
* Put a block around the probe point.Stan Cox2008-12-211-5/+4
|
* Convert .mark to .statement(0x) instead of .statement(foo.c:N)Stan Cox2008-12-161-27/+19
|