From 5f4c8c6ef761b6150d2d7d38fd601bec633f80f4 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 23 Jun 2009 18:31:38 -0700 Subject: Remove needless string copying 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. --- dwflpp.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'dwflpp.h') diff --git a/dwflpp.h b/dwflpp.h index ec2fc2b9..b31efdf8 100644 --- a/dwflpp.h +++ b/dwflpp.h @@ -198,13 +198,13 @@ struct dwflpp Dwarf_Die *query_cu_containing_address(Dwarf_Addr a); - bool module_name_matches(std::string pattern); - bool name_has_wildcard(std::string pattern); - bool module_name_final_match(std::string pattern); + bool module_name_matches(const std::string& pattern); + bool name_has_wildcard(const std::string& pattern); + bool module_name_final_match(const std::string& pattern); - bool function_name_matches_pattern(std::string name, std::string pattern); - bool function_name_matches(std::string pattern); - bool function_name_final_match(std::string pattern); + bool function_name_matches_pattern(const std::string& name, const std::string& pattern); + bool function_name_matches(const std::string& pattern); + bool function_name_final_match(const std::string& pattern); void iterate_over_modules(int (* callback)(Dwfl_Module *, void **, const char *, Dwarf_Addr, -- cgit From 1f8592d1a615bef5bad1f255e761664e85d9e4f0 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 24 Jun 2009 14:20:08 +0200 Subject: PR10305 Mark probes fail on prelinked shared library. 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 | 2 ++ 1 file changed, 2 insertions(+) (limited to 'dwflpp.h') diff --git a/dwflpp.h b/dwflpp.h index b31efdf8..8b503b33 100644 --- a/dwflpp.h +++ b/dwflpp.h @@ -291,6 +291,8 @@ struct dwflpp std::string& reloc_section, std::string& blacklist_section); + Dwarf_Addr literal_addr_to_sym_addr(Dwarf_Addr lit_addr); + private: Dwfl * dwfl; -- cgit