| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
* dwflpp.cxx (name_has_wildcard): Make static.
(dwfl_report_offline_predicate): Check & adjust behavior.
* dwflpp.h: Corresponding changes.
* tapsets.cxx: Note that kern_dw[] keys may be wildcard strings.
* testsuite/buildok/fortysix.stp: New test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* dwflpp.cxx (dwflpp ctor): Parametrize for user/kernel modes.
Update callers.
(dwfl_report_offline_predicate): New function. Filter and
abort searches early if possible.
(setup_kernel): Use new predicate.
* dwflpp.h: Corresponding changes.
* tapsets.cxx (dwfl_report_offline_predicate): Remove this shared
implementation.
(dwarf_builder): Turn kern_dw into module_name->dwflpp* map, just
like user_dw.
(get_kern_dw): Adapt.
(dwarf_build_no_more): Adapt.
* tapsets.h: Remove old shared predicate.
* translate.cxx (dwfl_report_offline_predicate2): New function.
Filter and abort searches early if possible.
(emit_symbol_data): Use it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will first read in the symbol table for modules, and update the
dwarf cu_function_cache with aliased names too. Then when iterating
in dwarf, all of the possible names are matched, instead of only the
canonical dwarf name.
* dwflpp.cxx (dwflpp::iterate_over_functions): call update_symtab,
and track wildcard addresses in a set to avoid alias dupes
* dwflpp.h (symbol_table::Compare): removed
* tapsets.cxx (symbol_table::map_by_addr): replaces list_by_addr
(symbol_table::sort): removed -- multimap doesn't need sorting
(symbol_table::mark_dwarf_redundancies): removed, see update_symtab
(symbol_table::purge_syscall_stubs): remove map elements inline
(dwarf_query::handle_query_module): preload the symtable.
(query_dwarf_func): don't compare the function a second time,
especially since it may have been an alias that matched at first.
(module_info::get_symtab): allow being called multiple times
(module_info::update_symtab): copy dies from the cache to the symtab,
and also add aliased names to the cache
|
|
|
|
| |
* tapsets.cxx (probe_table::convert_probe): Add regparm for kprobe.
|
|
|
|
|
|
|
|
|
| |
problems.
* tapsets.cxx (probe_table): Add is_uprobe and is_utrace.
(probe_table::convert_probe): Use _utrace_syscall_arg.
(sdt_var_expanding_visitor): Add utrace_probe.
(sdt_var_expanding_visitor::visit_target_symbol): Use _utrace_syscall_arg.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mark probes rely on literal statement addresses, these are based on the
on-disk module address space. Introduce helper function to turn such
addresses into symbol addresses as expected by libdwfl. Also properly
adjust for dw bias when such addresses are used in dw queries.
* dwflpp.h (dwflpp::literal_addr_to_sym_addr): New method.
* dwflpp.cxx (query_cu_containing_address): Don't "globalize" address.
(literal_addr_to_sym_addr): New method.
* tapsets.cxx (query_module_dwarf): Turn literal addresses into symbol
addresses.
(query_dwarf_func): Likewise and adjust for dw module bias.
|
|
|
|
|
|
|
|
| |
* dwflpp.h: Check elfutils version, define elf_getshdrstrndx as
elf_getshstrndx if elfutils 0.142 detected.
* dwflpp.cxx (get_blacklist_section): Use elf_getshdrstrndx.
* tapsets.cxx (probe_table): Likewise.
(prepare_section_rejection): Likewise.
|
|
|
|
| |
tapsets.cxx (query_cu): Add suggested address if found to error message.
|
|
|
|
|
|
| |
* tapsets.cxx (query_cu): When in guru mode just issue an warning (if not
suppressed) instead of an error when address isn't at the beginning of
a statement.
|
|
|
|
|
| |
* tapsets.cxx (dwarf_builder::build): pass probe_table.probe_name into
the sdt_var_expander instead of .mark_name, so wildcards are resolved.
|
|
|
|
| |
tapsets.cxx (dwarf_builder::build): Special case listing mode for kprobe and utrace.
|
|
|
|
|
| |
* tapsets.cxx (dwarf_builder) Add probes_handled.
(dwarf_builder::build): Use probes_handled to not emit duplicates.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sdt.h (EXPERIMENTAL_UTRACE_SDT, EXPERIMENTAL_KPROBE_SDT): New probe
point macros.
* dtrace: Add support for creating type debug info, currently invoked
with --types.
* tapsets.cxx (probe_table::convert_probe): New.
(probe_table::convert_location): New.
(dwarf_builder::build): Use it to simplify probe point handling.
* sdt.exp (pbtype_flags, pbtype_mssgs): New to also test kprobe and utrace.
* static_uprobes.exp (pbtype_flags, pbtype_mssgs): New to also test kprobe and utrace.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original logic was a little confused. It could end up searching the
separate debuginfo twice instead of falling back to the main elf file.
Now we explicitly search the main elf file first (where the .probes
section really should be) and only then fall back to the separate
debuginfo file.
* tapsets.cxx (dwarf_builder::probe_table::probe_table): Search main
elf file first, then fall back on separate debuginfo file if necessary.
* testsuite/systemtap.exelib/exelib.exp: Enable mark.tcl testcase.
main elf file or the debuginfo file, but would interpret
|
|
|
|
|
|
|
| |
* tapsets.cxx (dwarf/kprobe_derived_...::emit_decl/init): Define
and use KRETPROBE instead of hard-coded max(...) values. Raise
the default 50%.
* testsuite/buildok/thirtytwo.stp: New test.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
The result of sdt's private @cast expansion was not being used, and it's
not really needed anyway. The global cast visitor is registered to run
as a post-processing step on ALL functions and probes, and so it will
pick up and expand sdt's casts too.
|
|
|
|
|
| |
This just makes it so the parameters only need to be checked and pulled
out once.
|
|
|
|
|
|
| |
(sdt_var_expanding_visitor::visit_target_symbol): Have @cast use
types from a dtrace built object instead of a dtrace supplied header.
(dwarf_builder::build): Use it.
|
|
|
|
|
|
|
|
|
| |
(redo commit 3d022fa9c6bdbca383dfc639d08d65287c708f56)
* tapsets.cxx (dwarf_builder::probe_table::probe_table): gcc 4.4
complains that shdr may be used uninitialized. I added returns to
ensure that it's ok, but gcc still complains. Set the thing to NULL
as well to silence the beast.
|
|
|
|
|
|
|
| |
(probe_table::get_next_probe): Dissect using struct probe_table.
(sdt_var_expanding_visitor): Use lex_cast.
(dwarf_builder::build): Copy probe and location for TOK_MARK cases.
Call derive_probes for kprobe and utrace cases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
query_module was already returning DW_CB_ABORT when a simple match was
found, but dwflpp::iterate_over_modules was ignoring that and instead
forcing the module loop to restart. The only way out of the loop was
with the pending_interrupts flag, which is only for signalled
interrupts.
Now iterate_over_modules will only attempt the dwfl_getmodules loop
once, since that loop will only abort if the CB returns DW_CB_ABORT.
Then query_module is also modified to return ABORT if pending_interrupts
is flagged.
My trusty test, stap -l syscall.*, is nearly 2x faster with this change.
Empirically, I found that the kernel object is always the first "module"
returned, so the syscall probepoints always gets to short-circuit the
loop right away.
|
|
|
|
|
|
|
| |
* tapsets.cxx (dwarf_builder::probe_table::probe_table): gcc 4.4
complains that shdr may be used uninitialized. I added returns to
ensure that it's ok, but gcc still complains. Set the thing to NULL
as well to silence the beast.
|
|
|
|
|
|
| |
dwarf_builder::build to handle the .probes section
(sdt_var_expanding_visitor): New. Expand static probe $argN.
(dwarf_builder::build): Use probe_table. Add kprobe and utrace probe types.
|
|
|
|
|
|
|
| |
For a call like "stap -l 'syscall.*'", I found that ~10% of the time was
spent compiling the blacklist regexps over again for each probe point.
By moving this functionality into the kernel dwflpp instance, we can
reuse the regexps and get an easy speed boost.
|
|
|
|
|
|
|
|
|
|
| |
Both kernel.function and kprobe.function were defining a global array
stap_unreg_kprobes to use in bulk kprobes unregistration. The compiler
allowed the duplicate definition as long as they were the same size, as
it was when exercised in buildok/thirtyone.
kprobe.function now uses a separate stap_unreg_kprobes2, and the
testcase is modified to produce an imbalanced number of probes.
|
|
|
|
|
|
| |
When a kernel.function or kprobe.function fails in registration, we
usually print a WARNING and move on. With this patch, kprobes that have
the optional '?' flag will not print any WARNING.
|
| |
|
|\ |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
The method query_cu_containing_global_address was only called by
query_cu_containing_module_address, and the latter was just doing a
simple argument transform. They are now merged into a single method,
query_cu_containing_address. The function module_address_to_global is
also merged here at its only call site.
|
| |
| |
| |
| |
| | |
It's not a terribly clean split, but moving it helps reveals some of the
knots that need to be untangled.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
We know the full type of every tracepoint argument, so for those that
are pointers, print $$vars/$$parms using "%p". The integer-type
arguments continue to use the generic "%#x".
|
|/
|
|
|
|
| |
* includes/sys/sdt.h (STAP_PROBE_DATA_): Mark .probes section SHF_ALLOC.
* tapsets.cxx (dwarf_builder::build): Search in either dwarf or main elf
file for .probes section.
|
|
|
|
|
|
| |
* tapsets.cxx (dwarf_builder::build): Add some comments, verbose log
messages and get Elf through dwarf_getelf if it exists before searching
for .probes section.
|
|
|
|
|
|
| |
We have the saved_conversion_error field, but I wasn't using it. Now
@cast errors are saved in that field, so they're only seen if the
optimizer doesn't remove the @cast.
|
|
|
|
|
|
|
| |
Since translate_components is the one that knows the details of its
failures, it makes more sense to let it throw its own errors, instead of
relying on each caller to do it. The function now always either returns
successfully or throws an error.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous code recursed the entirety of translate_components, and
it seemed to be restarting the components list every time, so it would
only work if the anonymous portion was the first component. Even then,
examining the code output by semok/thirtythree revealed that it wasn't
fully translating the locations when multiple anonymous pieces were
involved.
Instead, it now recurses in a separate function, find_struct_member,
which does just enough to find the member die and return. It also
builds a vector of the locations passed through, so translate_components
can output code for the full chain of anonymity.
The generated code for semok/thirtythree's $page->mapping now appears to
match the offsets from my manual inspection of struct page. I also
added a test for $page->first_page->mapping, which works now but would
segfault the old code.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|