diff options
author | Josh Stone <jistone@redhat.com> | 2009-08-11 17:01:35 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-08-11 17:13:49 -0700 |
commit | 857bdfd1bec07003d3d92aaacf6ba578057324ef (patch) | |
tree | 370fb15a1865f9cba0c8129141d543d9093d3ef7 /dwflpp.cxx | |
parent | 9922bd3d9ce58712cf570abefbafebaf3f407ffe (diff) | |
download | systemtap-steved-857bdfd1bec07003d3d92aaacf6ba578057324ef.tar.gz systemtap-steved-857bdfd1bec07003d3d92aaacf6ba578057324ef.tar.xz systemtap-steved-857bdfd1bec07003d3d92aaacf6ba578057324ef.zip |
PR10461: Probe identical functions only once
In C++ especially, a function definition in a header may be compiled
into multiple CUs, but the linker will merge those into a single output
function. We don't want to place multiple probes on the same function.
The dupe-detection from the alias code (commit 1c6b77e5) already tracks
identical functions within a CU, so I've just lifted this to instead
track function entrypcs at the module level.
* dwflpp.cxx (dwflpp::iterate_over_functions): Remove dupe checks.
* tapsets.cxx (dwarf_query): Add alias_dupes set to the query.
(dwarf_query::handle_query_module): Reset the dupes for each module.
(query_dwarf_func): Check that we only probe each entrypc once.
Diffstat (limited to 'dwflpp.cxx')
-rw-r--r-- | dwflpp.cxx | 10 |
1 files changed, 0 insertions, 10 deletions
@@ -629,9 +629,6 @@ dwflpp::iterate_over_functions (int (* callback)(Dwarf_Die * func, base_query * } else if (name_has_wildcard (function)) { - // track addresses we've already seen - set<Dwarf_Addr> alias_dupes; - for (it = v->begin(); it != v->end(); it++) { if (pending_interrupts) return DWARF_CB_ABORT; @@ -643,13 +640,6 @@ dwflpp::iterate_over_functions (int (* callback)(Dwarf_Die * func, base_query * clog << "function cache " << key << " match " << func_name << " vs " << function << endl; - // make sure that this function address hasn't - // already been matched under an aliased name - Dwarf_Addr addr; - if (dwarf_entrypc(&die, &addr) == 0 && - !alias_dupes.insert(addr).second) - continue; - rc = (*callback)(& die, q); if (rc != DWARF_CB_OK) break; } |