summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-07-231-401/+460
|\|
| * Use the query paradigm for resolving sdt probesJosh Stone2009-07-211-375/+384
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Remove unused 'sess' from dwarf_query ctorJosh Stone2009-07-211-6/+4
| |
| * PR10424: Consider each tracepoint header separatelyJosh Stone2009-07-201-12/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the current monolithic tracepoint query module, a failure in any of the discovered tracepoint headers means that you can't use any of the others either. This patch creates a separate query module for each header so they can pass or fail independently. * buildrun.cxx (make_tracequery): take a single header name instead of globbing for everything we can find. * hash.cxx (find_tracequery_hash): name the header file we're hashing. * tapsets.cxx (tracepoint_query::handle_query_func): make sure we don't duplicate tracepoints found through different headers. (tracepoint_builder::get_tracequery_module): get a header's module (tracepoint_builder::init_dw): glob for all tracepoint headers, and feed all their modules into dwflpp.
| * Return hash module values directly as stringsJosh Stone2009-07-201-9/+10
| | | | | | | | | | | | | | | | * session.h (systemtap_session): remove tracequery_path * hash.cxx (find_tracequery_hash, find_typequery_hash): return strings * tapsets.cxx (dwarf_cast_expanding_visitor::filter_special_modules): get the hashed path from the return value instead of a parameter (tracepoint_builder::init_dw): ditto, and don't stuff it in session
| * * tapsets.cxx (dwarf_builder::probe_table::convert_probe):Stan Cox2009-07-201-46/+43
| | | | | | | | | | | | First check kprobe and utrace (did we arrive via stap?) then check if probe arg matches mark("NAME") * sdt.h (STAP_PROBE?_): Use STAP_GUARD for stap check, not gettid.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-07-171-4/+4
|\|
| * PR3498 cont'd: better tolerate missing modulesFrank Ch. Eigler2009-07-171-4/+4
| | | | | | | | | | * tapsets.cxx (get_{user,kern}_dw): Skip partially allocated (0-initialized) FOO_dw[] slots that may result from dwflpp::ctor exceptions.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-07-161-1/+15
|\|
| * 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
| * tapsets.cxx doesn't need loc2c.h. All done through dwflpp.cxx now.Mark Wielaard2009-07-141-1/+0
| | | | | | | | * tapsets.cxx: Remove loc2c.h include.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-07-131-2/+2
|\| | | | | | | | | | | Conflicts: main.cxx
| * PR10075: emit address in probe registration logicwenji2009-07-121-2/+2
| | | | | | | | | | * tapsets.cxx(dwarf_derived_probe_group::emit_module_init, kprobe_derived_probe_group::emit_module_init): print address.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-07-101-1/+1
|\|
| * PR3498 cont'd, fix wildcard module("*") probesFrank Ch. Eigler2009-07-081-1/+1
| | | | | | | | | | | | | | | | * 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.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-07-081-27/+22
|\|
| * PR3498: speed up pass-2 and pass-3 for kernel offline dwfl module searchingFrank Ch. Eigler2009-07-071-27/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-07-021-82/+73
|\|
| * PR10327: resolve symbol aliases to dwarf functionsJosh Stone2009-07-011-82/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-06-291-13/+35
|\|
| * An i386 kprobe needs regparm(0) to access args.Stan Cox2009-06-261-0/+17
| | | | | | | | * tapsets.cxx (probe_table::convert_probe): Add regparm for kprobe.
| * Use_utrace_syscall_arg with sdt utrace probes to avoid i386 arg fetching ↵Stan Cox2009-06-261-13/+18
| | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-06-251-2/+14
|\|
| * PR10305 Mark probes fail on prelinked shared library.Mark Wielaard2009-06-241-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Disallow embedded C in tapset functions ifor unprivileged users unless ↵Dave Brolley2009-06-251-0/+3
| | | | | | | | tagged by /* unprivileged */.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-06-231-3/+3
|\|
| * PR 10313 Build error due to deprecation of elf_getshstrndx in elfutils.Mark Wielaard2009-06-231-3/+3
| | | | | | | | | | | | | | | | * 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.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-06-221-1/+7
|\|
| * PR10308 Beginning of statement check should provide alternatives.Mark Wielaard2009-06-221-0/+2
| | | | | | | | tapsets.cxx (query_cu): Add suggested address if found to error message.
| * PR10307 beginning of statement check should be overridden in guru mode.Mark Wielaard2009-06-221-1/+5
| | | | | | | | | | | | * 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.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-06-171-4/+11
|\|
| * Use the expanded value for sdt $$nameJosh Stone2009-06-161-2/+2
| | | | | | | | | | * tapsets.cxx (dwarf_builder::build): pass probe_table.probe_name into the sdt_var_expander instead of .mark_name, so wildcards are resolved.
| * Support -L for kprobe and utrace static user markers.Stan Cox2009-06-161-2/+9
| | | | | | | | tapsets.cxx (dwarf_builder::build): Special case listing mode for kprobe and utrace.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-06-161-111/+125
|\|
| * Do not emit duplicate probes for kprobe/utrace cases.Stan Cox2009-06-161-0/+8
| | | | | | | | | | * tapsets.cxx (dwarf_builder) Add probes_handled. (dwarf_builder::build): Use probes_handled to not emit duplicates.
| * Add experimental utrace/kprobe sdt supportStan Cox2009-06-151-112/+118
| | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-06-151-11/+17
|\|
| * PR10285. User space PROBE marks aren't found with separate debuginfo.Mark Wielaard2009-06-151-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * PR10279: add -DKRETACTIVE=nnnn parameterFrank Ch. Eigler2009-06-131-2/+10
| | | | | | | | | | | | | | * 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.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-06-111-29/+31
|\|
| * Add bounds-checking to sdt $argNJosh Stone2009-06-091-5/+9
| |
| * Remove probe_table's unused location memberJosh Stone2009-06-091-5/+4
| |
| * Remove sdt_var_expanding_visitor's now-unused dwJosh Stone2009-06-091-6/+5
| |
| * Remove the spurious sdt @cast expansionJosh Stone2009-06-091-3/+0
| | | | | | | | | | | | | | 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.
| * Simplify process.mark parameter parsingJosh Stone2009-06-091-8/+5
| | | | | | | | | | This just makes it so the parameters only need to be checked and pulled out once.
| * * tapsets.cxx (sdt_var_expanding_visitor::process_name): New.Stan Cox2009-06-091-13/+12
| | | | | | | | | | | | (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.
| * Fix uninitialized shdr in probe_tableJosh Stone2009-06-091-1/+8
| | | | | | | | | | | | | | | | | | (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.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-06-091-118/+118
|\|
| * * tapsets.cxx (probe_table): Make mark_name and sess refs.Stan Cox2009-06-081-115/+115
| | | | | | | | | | | | | | (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.
| * Let query_module abort early for simple matchesJosh Stone2009-06-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.