summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* | 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.