summaryrefslogtreecommitdiffstats
path: root/dwflpp.cxx
Commit message (Collapse)AuthorAgeFilesLines
...
* PR6905: tweak WILDCARD and RANGE line type for process.statementWenji Huang2009-07-271-4/+28
| | | | | | | | * dwflpp.cxx (iterate_over_srcfile_lines): Check the line range and tolerate invalid line number for WILDCARD line type. * testsuite/systemtap.base/bz6905.c: Test case. * testsuite/systemtap.base/bz6905.exp: Ditto. * testsuite/systemtap.base/bz6905.stp: Ditto.
* Workaround cfa_nops not being needed on earlier elfutils.Mark Wielaard2009-07-231-1/+1
| | | | | * dwflpp.cxx (get_cfa_ops): Only define cfa_nops if _ELFUTILS_PREREQ(0,142). * loc2c-test.c (main): Likewise.
* Adjust to new elfutils dwarf_frame_cfa interface.Mark Wielaard2009-07-231-2/+3
| | | | | * dwflpp.cxx (get_cfa_ops): Call dwarf_frame_cfa with cfa_nops size_t. * loc2c-test.c (main): Likewise.
* Use the query paradigm for resolving sdt probesJosh Stone2009-07-211-2/+0
| | | | | | | | | | | | | | | | There was a bad assumption in the probe_table initialization that the dwflpp->module would be immediately valid. We should not assume that dwflpp only has one module, or that any module is necessarily in focus. Instead, I've created an sdt_query class which will call an iterate_over_modules like the other dwarf probe types. For now this means just a single module, but it will also open the door to iterating over all linked libraries too, for example. * dwflpp.cxx (dwflpp::setup_user): don't "save mod!" anymore * tapsets.cxx (probe_table -> sdt_query): convert to a query-style class, and also take over the task of iterating over the probes. (dwarf_builder::build): leave the iteration to sdt_query
* Save module when dwflpp setup_user.Mark Wielaard2009-07-211-0/+1
| | | | * dwflpp.cxx (setup_user): Set module to mod.
* Allow dwflpp to take a vector of module namesJosh Stone2009-07-201-20/+36
| | | | | | | | | This will be used to load tracepoint modules as a bunch of little query modules into a single dwflpp. * dwflpp.cxx (setup_user): take a vector instead of a single module (dwflpp::dwflpp): form a vector in the singular case, and add a variant that takes and passes through a vector of modules.
* PR10398 DW_OP_call_frame CFA support doesn't work for prelink shared libs.Mark Wielaard2009-07-161-3/+40
| | | | | | | * dwflpp.cxx (translate_location): Call get_cfa_ops with relative pc plus module bias. (literal_addr_to_sym_addr): Add verbose logging. (get_cfa_ops): Adjust pc for returned bias. Add verbose logging.
* PR5930: Address-op for $target and @cast membersJosh Stone2009-07-151-0/+15
| | | | | | | | | | | | | | | | This allows the '&' operator to get the address of @cast and $target variable expressions. * staptree.h (target_symbol): add addressof field * staptree.cxx (target_symbol::print): print '&' for addressof (cast_op::print): ditto * parse.cxx (parser::parse_value): allow '&' prefix on $target/@cast * dwflpp.cxx (dwflpp::translate_final_fetch_or_store): allow taking the computed address without actually doing a final fetch. * tapset* (*::visit_target_symbol): throw errors for $vars w/o addresses * testsuite/systemtap.base/cast.stp: add &@cast test * testsuite/semok/target_addr.stp: test '&' on different member types * testsuite/semko/target_addr?.stp: test failure on bitfields/registers
* PR10388 Support DW_OP_call_frame_cfa.Mark Wielaard2009-07-151-2/+37
| | | | | | | | | | | | | | | | | | Depends on elfutils 0.142 cfi support. * loc2c.h (c_translate_location): Take (optional) Dwarf_Op *cfa_ops. * loc2c.c (translate): Recognize DW_OP_call_frame_cfa. (location_from_address): Take cfa_ops, examine fb_ops, if it is DW_OP_call_frame_cfa, pass cfa_ops to translate instead. (location_relative): Take cfa_ops, pass to location_from_address. (c_translate_location): Take cfa_ops, pass to location_from_address. * loc2c-test.c (handle_variable): Take cfa_ops, pass to c_translate_location when needed. (main): Fetch cfa_ops, pass to handle_variable. * dwflpp.h (struct dwflpp): Add new method get_cfa_ops. * dwflpp.cxx: Include elfutils/version.h. (translate_location): Fetch cfa_ops when necessary. (get_cfa_ops): New method.
* PR4166: Allow array-like indexing on pointersJosh Stone2009-07-141-6/+8
| | | | | | | * dwflpp.cxx (dwflpp::translate_components): let pointers get treated the same as arrays, and add a final DIE dereference for array access. * loc2c.c (c_translate_array): tolerate pointer types * testsuite/systemtap.base/pointer_array.*: new test
* PR3498, cont'dFrank Ch. Eigler2009-07-091-0/+4
| | | | * dwflpp.cxx (dwfl_report_offline_predicate): Reject NULL filenames.
* PR3498 cont'd, fix wildcard module("*") probesFrank Ch. Eigler2009-07-081-22/+22
| | | | | | | | * 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.
* Add support for constant struct member field offsets.Mark Wielaard2009-07-081-1/+19
| | | | | | | * loc2c.h (c_translate_add_offset): New function prototype. * loc2c.c (c_translate_add_offset): New function implementation. * loc2c-test.c (handle_variable): Use c_translate_add_offset if appropriate. * dwflpp.cxx (translate_location): Likewise.
* PR3498: speed up pass-2 and pass-3 for kernel offline dwfl module searchingFrank Ch. Eigler2009-07-071-15/+49
| | | | | | | | | | | | | | | | | | | * 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.
* PR10327: resolve symbol aliases to dwarf functionsJosh Stone2009-07-011-4/+15
| | | | | | | | | | | | | | | | | | | | | 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
* PR10305 Mark probes fail on prelinked shared library.Mark Wielaard2009-06-241-4/+31
| | | | | | | | | | | | | | 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.
* Remove needless string copyingJosh Stone2009-06-231-14/+14
| | | | | | | | | | | | More fat-trimming optimization for ~7% off listing syscall.*. * dwflpp.cxx (dwflpp::iterate_over_functions): remove a parameter copy (dwflpp::module_name_matches): Use const string& parameters (dwflpp::name_has_wildcard): Ditto. (dwflpp::module_name_final_match): Ditto. (dwflpp::function_name_matches_pattern): Ditto. (dwflpp::function_name_matches): Ditto. (dwflpp::function_name_final_match): Ditto.
* PR 10313 Build error due to deprecation of elf_getshstrndx in elfutils.Mark Wielaard2009-06-231-1/+1
| | | | | | | | * 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.
* PR10273 Correctly adjust libdw address for dwfl dwarf bias.Mark Wielaard2009-06-181-5/+6
| | | | * dwflpp.cxx (relocate_address): Adjust reloc_addr at start, not afterwards.
* PR10273. uprobes fail to insert on prelinked library.Mark Wielaard2009-06-171-1/+1
| | | | | * dwflpp.cxx (relocate_address): For .dynamic section addresses adjust for module bias.
* Remove dwflpp::default_nameJosh Stone2009-06-081-15/+4
| | | | | | It was just a basic NULL check, but creating its string temporaries was causing a fair slowdown. Removing this function and adjusting the callers shaves ~5% off the syscall.* elaboration time.
* Let query_module abort early for simple matchesJosh Stone2009-06-081-7/+2
| | | | | | | | | | | | | | | | | | 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.
* Merge branch 'master' of ssh://sourceware.org/git/systemtapJosh Stone2009-06-021-1/+7
|\
| * Add debuginfo-install suggestion for kernel probing.William Cohen2009-06-011-1/+7
| |
* | Cache the last result of dwarf_getscopesJosh Stone2009-06-021-2/+22
| | | | | | | | | | | | | | | | | | | | | | This one function accounted for ~30% of my callgrind profile of "stap -l 'syscall.*'", even though it was only called ~1200 times. We call dwarf_getscopes for each $target variable, with the same parameters within a given probe. Since they're no nicely grouped, it's easy to just cache the most recent call, and the next few calls will be a hit. Overall this cuts the number of calls down to about 300, for an easy speed gain.
* | Move the blacklist functions into dwflppJosh Stone2009-06-011-1/+290
|/ | | | | | | 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.
* Suggest rpms to install using debuginfo-install.William Cohen2009-05-271-0/+4
| | | | | | | | | The patch makes use of the RPM libraries to determine which rpm supplied the executable and from that information suggest a command to install the appropriate debuginfo rpm. This is enabled using the "--with-rpm" option for configure. Can be explicitly disabled with "--without-rpm".
* Privatize many dwflpp membersJosh Stone2009-05-151-3/+3
| | | | | This helps make it more obvious which methods are accessed by external classes, which should help in refactoring.
* Simplify our unordered_map typedefsJosh Stone2009-05-151-5/+0
|
* Break the dwflpp dependence on query_cuJosh Stone2009-05-151-4/+3
|
* Break the dwflpp dependence on query_moduleJosh Stone2009-05-151-7/+0
|
* Merge the dwflpp::query_cu_..._address methodsJosh Stone2009-05-151-20/+7
| | | | | | | | 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.
* Don't shadow dwlfpp::dwfl in loc2c_emit_addressJosh Stone2009-05-151-2/+1
|
* Remove unused dwflpp methodsJosh Stone2009-05-151-39/+0
| | | | | | | | These three methods had no callers, and are thus obsolete: dwflpp::focus_on_module_containing_global_address(Dwarf_Addr a) dwflpp::global_address_to_module(Dwarf_Addr a) dwflpp::cu_name_matches(string pattern)
* Move dfwlpp into its own fileJosh Stone2009-05-121-0/+2159
It's not a terribly clean split, but moving it helps reveals some of the knots that need to be untangled.