summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Handle kprobe struct field symbol_name as either char * or const char *.Mark Wielaard2009-04-261-2/+2
| | | | | | | | Older (2.6.18) based kernels defined struct kprobes symbol_name as char *, but newer (2.6.27) based kernels defined the same field as const char *. * tapsets.cxx (kprobe_derived_probe_group::emit_module_init): Always cast to char * when assigning to kprobes.symbol_name field.
* fix kprobe.* probes so they don't break -p4 if script also has kernel.* probesFrank Ch. Eigler2009-04-261-6/+6
| | | | | * tapsets.cxx (kprobe_derived_probe): Use enter_k[ret]probe>>2<<_probe. * testsuite/buildok/thirtyone.stp: Test this.
* Enable kprobe.function.return.maxactiveJosh Stone2009-04-241-35/+57
| | | | | The code to emit maxactive was almost there; it just needed to enable the maxactive probe component and pass the value down.
* Simplify dwarfless kprobe stmt vs. name logicJosh Stone2009-04-241-29/+15
|
* Fill out the pp() for dwarfless kprobesJosh Stone2009-04-241-3/+25
|
* Don't terminate when a dwarfless kprobe failsJosh Stone2009-04-241-8/+1
| | | | | | | | | | All of our other kprobe types will let the script continue after a registration failure, as per PR6749. The dwarfless kprobes should be no exception. Also, the way they were exiting was causing an unclean shutdown, so I added tests to badkprobe.exp to make sure that cleanup is always allowed to run.
* Tweak error message in kprobe.function registrationJosh Stone2009-04-241-1/+1
|
* PR 9941: Add predicate function callback to check for an early abortRajan Arora2009-04-221-1/+10
| | | | | | | * tapsets.cxx: Add dwfl_report_offline_predicate to check pending interrupts for an early abort. * tapsets.h: Declare it. * translate.cxx: Add callback to function call.
* Make sdt.h big endian aware.Stan Cox2009-04-221-2/+2
| | | | | | * sdt.h: Use .quad instead of .long for .probe section addresses. ia64 and s390 require 'nop 0' and x86 tolerates it. * tapsets.cxx (build): Fetch probe_name in a big endian friendly fashion.
* Use tokenize() for splitting @cast's module listJosh Stone2009-04-211-7/+6
|
* Refine the @cast-with-header syntaxJosh Stone2009-04-211-16/+7
| | | | | | | The special syntax to generate a module for type information is now: - "kernel<path/to/header.h>" to use the kernel's build environment - "<path/to/header.h>" to use no special build environment, and so use gcc's default parameters only (for user mode).
* Correctly handle $syscall in process(PID_OR_PATH).syscall.return probes.David Smith2009-04-211-5/+257
| | | | | | | | | | | | | | | | 2009-04-21 David Smith <dsmith@redhat.com> * tapsets.cxx (utrace_derived_probe::utrace_derived_probe): If during target-variable-expanding the probe, we added a new block or probe, add them. (utrace_var_expanding_visitor::visit_target_symbol_cached): New function to cache target variables in a generated syscall probe to use in syscall.return probes. (utrace_var_expanding_visitor::visit_target_symbol_context): In a syscall.return probe, you can't access $syscall. So use visit_target_symbol_cached() to cache the value for use here. * testsuite/systemtap.base/utrace_syscall_args.stp: Test use of $syscall in syscall.return probes.
* From Prerna Saxena: Add the kprobe.function probe familyAnanth N Mavinakayanahalli2009-04-211-2/+460
|
* Suppress more module-loading errors in @castsJosh Stone2009-04-201-3/+14
| | | | | Commit 462c90c3 did this for user modules, but it's needed for kernel modules too.
* PR10055: generate dummy modules w/ types for @castJosh Stone2009-04-201-0/+56
| | | | | | | The module field in @cast can now also be "kmod<path/to/header.h>" or "umod<path/to/header.h>" to generate a kernel or user module which includes the specified header. The appropriate compiler flags are used to save all possible type debuginfo from the header.
* Suppress module-loading errors in @castsJosh Stone2009-04-201-1/+10
| | | | | | If a @cast encounters a module that it can't load, it should just go on to the next module instead of throwing an exception. If there is no next module, we'll get a better "type not found" exception anyway.
* Indentation repair.Stan Cox2009-04-161-89/+88
| | | | * tapsets.cxx (dwflpp::iterate_over_labels): Fix indentation.
* Use iterate_over_srcfile_lines for function("func@file:N").labelStan Cox2009-04-161-103/+127
| | | | | | | | * tapsets.cxx (dwflpp::iterate_over_labels): Renamed from iterate_over_cu_labels, method signature simplified. (query_srcfile_label): New. (query_cu): Use above. * labels.exp: New tests for above.
* PR9940: add/use unmap_u[ret]probeJim Keniston2009-04-151-9/+32
| | | | | For uprobes 1 and 2, add unmap_u[ret]probe() and define UPROBES_API_VERSION=2. Adapt tapsets.cxx accordingly.
* PR10067: fix bitfield accessJosh Stone2009-04-131-2/+5
| | | | | | | | | * tapsets.cxx (dwflpp::translate_components): Eliminate the extra die-dereference at the end of the loop (a regression from @casts). * runtime/loc2c-runtime.h (store_bitfield): Use the target as the representative type, since the base is always int64_t. Also be a bit more aggressive with masking and parentheses. * testsuite/systemtap.base/bitfield.*: New test for R/W bitfields.
* PR10049: Restore better errors for $returnJosh Stone2009-04-131-10/+11
| | | | | | | | | | | | | In commit c4ce66a1 I shifted some of the variable accesses around, and that caused the error messages for $return variables to lose context. The root problem in this case was that dwarf_attr didn't find the type attribute, and that failure wasn't immediately caught. Now that result is checked so we can provide a proper error message. While I'm at it, changing that lookup to dwarf_attr_integrate is enough to make the $return value usable again, at least for the reported test case.
* Improve -l output for .labelStan Cox2009-04-131-6/+15
| | | | | | * tapsets.cxx (iterate_over_cu_labels): Treat -l specially so the output of a .label can be improved. * labels.stp: Test -l
* Make sure code using the vma tracker compiles again.Mark Wielaard2009-04-081-21/+0
| | | | | | | | * runtime/runtime.h: Include task_finder.c. * runtime/sym.c: Always define task_finder callbacks for usage in tapsets. * runtime/task_finder.c: Define dummy stap_task_finder_target when ! defined(CONFIG_UTRACE). * tapsets.cxx: Never include task_finder.c directly.
* Consider function when handling .labelStan Cox2009-04-081-13/+24
| | | | | | * tapsets.cxx(dwflpp::iterate_over_cu_labels): New parameter function. Do wildcard match for function. * testsuite/systemtap.base/labels.exp: Test .label function handling.
* Merge branch 'master' of ssh://sources.redhat.com/git/systemtapDavid Smith2009-04-081-1/+1
|\
| * Do not do a partial name comparison for .label.Stan Cox2009-04-081-1/+1
| | | | | | | | * tapsets.cxx (dwflpp::iterate_over_cu_labels): Compare with strcmp not strncmp.
* | Only includes task_finder.c when needed.David Smith2009-04-081-0/+22
|/ | | | | | | | | | | | | 2009-04-08 David Smith <dsmith@redhat.com> * tapsets.cxx (itrace_derived_probe_group::emit_module_decls): Added inclusion of task_finder.c back. Unconditionally including it when not needed causes all systemtap scripts to fail on kernels with no utrace support. (utrace_derived_probe_group::emit_module_decls): Ditto. (uprobe_derived_probe_group::emit_module_decls): Ditto. * runtime/runtime.h: Removed unconditional inclusion of task_finder.c.
* Add valid interval in error message when timer probe out of range.Mark Wielaard2009-04-071-10/+18
| | | | | | * tapsets.cxx (hrtimer_derived_probe): Take scale argument, add interval/scale to semantic_error message. (timer_builder): Set and pass scale.
* PR 9940. Rearchitected task_finder.c a bit.David Smith2009-04-071-11/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-04-07 David Smith <dsmith@redhat.com> PR 9940. * tapsets.cxx (emit_vma_callback_probe_decl): Initialized new callbacks. (utrace_derived_probe_group::emit_probe_decl): Ditto. (uprobe_derived_probe_group::emit_module_decls): Uses new callback. Makes sure mapping is executable before trying to set a probe in it. (itrace_derived_probe_group::emit_module_init): Calls _stp_sym_init(). (utrace_derived_probe_group::emit_module_init): Ditto. (uprobe_derived_probe_group::emit_module_init): Ditto. * runtime/sym.c: Moved task_finder_vma.c inclusion here from task_finder.c. (_stp_sym_init): New function. (_stp_tf_mmap_cb): New function that replaces _stp_tf_vm_cb. (_stp_tf_munmap_cb): Ditto. * runtime/task_finder.c: Removed task_finder_vma.c inclusion. Split vm_callback into 3 callbacks: mmap_callback, munmap_callback, and mprotect_callback. (stap_register_task_finder_target): Initializes new events variables for the new callbacks. (__STP_TASK_VM_BASE_EVENTS): No longer specifies syscall entry events. (__stp_call_mmap_callbacks): New function. (__stp_call_mmap_callbacks_with_vma): Ditto. (__stp_call_munmap_callbacks): Ditto. (__stp_call_mprotect_callbacks): Ditto. (__stp_call_vm_callbacks): Removed. (__stp_utrace_task_finder_target_quiesce): Calls __stp_call_mmap_callbacks() instead of __stp_call_vm_callbacks(). (__stp_utrace_task_finder_target_syscall_entry): Removed function. (__stp_utrace_task_finder_target_syscall_exit): Reports raw mmap()/mprotect()/munmap() events.
* PR10026: Read marker/tracepoint args directlyJosh Stone2009-04-061-58/+28
| | | | | | | | | | We already stash the context variables for markers and tracepoints into the locals for the probe body, but then we were using separate functions to read those locals for each particular probe body. This patch instead teaches the unparser how to emit the local name directly for those context variables. The resulting code from the translator is much simpler now.
* PR10037: add target_symbol token to $context error messagesFrank Ch. Eigler2009-04-061-64/+81
| | | | | * tapsets.cxx (many foo-translate-bar): Add const target_symbol* parameter, for ->tok use when constructing semantic_errors.
* PR5163: Assign need_uprobes during pass-2Josh Stone2009-04-031-2/+4
| | | | | | We were doing this in pass-3, which means it was never set for cached runs, and so staprun didn't get the -u flag. Now need_probes is set as soon as a uprobe_derived_probe is saved into the session in pass-2.
* make skip-badvars warning message sensitive to -w suppressionFrank Ch. Eigler2009-04-031-2/+3
|
* Fix for insn probe: Call arch_has_*_step() prior to calling utrace_controlMaynard Johnson2009-04-011-0/+16
| | | | | | | | | | | | | | The attached patch is version 2 for the problem I reported earlier today. Frank, is this more what you had in mind? With this patch, there's no need for the user to look at the system log. Error messages are sent to stderr: ERROR: insn probe init: arch does not support block step mode ERROR: probe process("/test").function("doit1@/test.c:22").return registration error (rc -1) -Maynard
* Move #endif for STP_NEED_VMA_TRACKER up to not cover other utrace callbacks.Mark Wielaard2009-04-011-1/+1
| | | | * tapsets.cxx (utrace_derived_probe_group::emit_module_init): Correct #endif.
* Merge branch 'master' into pr6866Mark Wielaard2009-04-011-31/+88
|\
| * Use alloca trick to keep argN active on GCC 4.1.Stan Cox2009-04-011-2/+3
| | | | | | | | | | | | * includes/sys/sdt.h (STAP_UNINLINE): New. (STAP_UNINLINE_LABEL): New. static_uprobes.exp: Match using charset instead of .*
| * Customize .mark -l output.Stan Cox2009-03-311-1/+14
| | | | | | | | | | | | * tapsets.cxx (dwarf_builder::build): Add .mark name wildcard check. Customize -l handling. * testsuite/systemtap.base/static_uprobes.exp: Test .mark name wildcard.
| * PR7045: on 64-bit kernels, allow 32-bit userspace to be pass elf validationFrank Ch. Eigler2009-03-271-10/+24
| | | | | | | | * tapsets.cxx (validate_elf): Reorganize glob matching for x86 and ppc.
| * Don't do beginning of statement check for .mark probesStan Cox2009-03-271-3/+7
| | | | | | | | | | | | * tapsets.cxx (dwarf_query): Add has_mark. (query_cu): Use for beginning of statement check. (dwarf_builder::build): Set has_mark.
| * PR10000: emit _stp_relocate* calculations correctly for kernel/module global ↵Frank Ch. Eigler2009-03-271-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $data * translate.cxx (dump_unwindsyms): Also emit STT_OBJECT symbols, therefore .data etc. sections into stap-symbols.h. * tapsets.cxx (iterate_over_modules): Omit a dwfl_getmodules() RC-checking assertion that blocked meaningful $context var error messages. (dwflpp::emit_address): Bypass dwfl_module_relocate_address() for kernel symbols as it has been unreliable; subtract sess.sym_stext manually. * testsuite/buildok/seventeen.stp: Extend test with module $global.
| * build fix for RHEL4-era gcc 3.4.6Frank Ch. Eigler2009-03-241-2/+3
| | | | | | | | | | * tapsets.cxx (stringhash): Go to __gnu_cxx. (dwarf_cast_expanding_visitor::visit_cast_op): Use ~0 for all-ones.
| * PR9993: tracepoint toleration for undeclared types in trace/*.h headersFrank Ch. Eigler2009-03-241-1/+19
| | | | | | | | | | | | | | | | | | * tapsets.cxx (tracepoint_extra_headers): New function to return needed header file names. (emit_module_decls): Emit them. * buildrun.cxx (make_tracequery): Emit them. * testsuite/systemtap.base/tracepoints.exp: Rewrite to exercise building each tracepoint.
| * Keep static probe parameters visible while inlining.Stan Cox2009-03-241-10/+3
| | | | | | | | | | | | | | | | * includes/sys/sdt.h (STAP_PROBEN): Revive the STAP_LABEL macro to prevent inlining to keep probe parameters visible. Use +rm constraints. * tapsets.cxx (build): Use .probes section for all uses of static probes.
* | Wrap vma callbacks in STP_NEED_VMA_TRACKER.Mark Wielaard2009-04-011-0/+12
| | | | | | | | | | | | | | | | Will be defined by new ucontext symbol stapset. * tapset.cxx: Wrap all vma callbacks in STP_NEED_VMA_TRACKER. * testsuite/systemtap.context/usymbols.exp: Define STP_NEED_VMA_TRACKER explicitly for now.
* | Merge branch 'master' into pr6866Mark Wielaard2009-03-221-2/+36
|\|
| * 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.