From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69667 invoked by alias); 21 Jul 2016 13:17:37 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 69578 invoked by uid 89); 21 Jul 2016 13:17:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=lep, ravi, Point, H*Ad:U*hemant X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 21 Jul 2016 13:17:35 +0000 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6LDE86v084498 for ; Thu, 21 Jul 2016 09:17:33 -0400 Received: from e23smtp07.au.ibm.com (e23smtp07.au.ibm.com [202.81.31.140]) by mx0b-001b2d01.pphosted.com with ESMTP id 2496h8x5nv-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 21 Jul 2016 09:17:33 -0400 Received: from localhost by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 21 Jul 2016 23:17:27 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp07.au.ibm.com (202.81.31.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 21 Jul 2016 23:17:24 +1000 X-IBM-Helo: d23dlp01.au.ibm.com X-IBM-MailFrom: ravi.bangoria@linux.vnet.ibm.com X-IBM-RcptTo: systemtap@sourceware.org Received: from d23relay08.au.ibm.com (d23relay08.au.ibm.com [9.185.71.33]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id E69BD2CE8054 for ; Thu, 21 Jul 2016 23:17:23 +1000 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u6LDHNPI16711868 for ; Thu, 21 Jul 2016 23:17:23 +1000 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u6LDHNa3026833 for ; Thu, 21 Jul 2016 23:17:23 +1000 Received: from bangoria.in.ibm.com ([9.124.221.227]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u6LDHHND026773; Thu, 21 Jul 2016 23:17:21 +1000 From: Ravi Bangoria To: systemtap@sourceware.org Cc: hemant@linux.vnet.ibm.com, mjw@redhat.com, atrajeev@linux.vnet.ibm.com, Ravi Bangoria Subject: [PATCH 1/3] ppc64le: Store correct function entry address in symbol_table Date: Thu, 21 Jul 2016 13:17:00 -0000 In-Reply-To: <1469107036-4239-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com> References: <1469107036-4239-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16072113-0044-0000-0000-000001C45275 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16072113-0045-0000-0000-000005297A57 Message-Id: <1469107036-4239-2-git-send-email-ravi.bangoria@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-07-21_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607210148 X-SW-Source: 2016-q3/txt/msg00077.txt.bz2 symbol_table::get_from_elf() calculates Local Entry Point and stores it in symbol_table for ppc64le. LEP is required only at a time of probing and not elsewhere. So no need to store it in symbol table. No need to prioritize symbol table as well because debuginfo and symbol table both will contain Global Entry Point. Signed-off-by: Ravi Bangoria --- tapsets.cxx | 62 +------------------------------------------------------------ 1 file changed, 1 insertion(+), 61 deletions(-) diff --git a/tapsets.cxx b/tapsets.cxx index 6d82069..e7be711 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -2142,18 +2142,6 @@ query_dwarf_inline_instance (Dwarf_Die * die, dwarf_query * q) } } -static bool -is_filtered_func_exists (func_info_map_t const& filtered, func_info *fi) -{ - for (unsigned i = 0; i < filtered.size(); i++) - { - if ((filtered[i].entrypc == fi->entrypc) && (filtered[i].name == fi->name)) - return true; - } - - return false; -} - static int query_dwarf_func (Dwarf_Die * func, dwarf_query * q) { @@ -2206,37 +2194,7 @@ query_dwarf_func (Dwarf_Die * func, dwarf_query * q) q->dw.function_line (&func.decl_line); Dwarf_Addr entrypc; - - func.entrypc = 0; - Dwarf_Addr bias; - Dwfl_Module *mod = q->dw.module; - Elf* elf = (dwarf_getelf (dwfl_module_getdwarf (mod, &bias)) - ?: dwfl_module_getelf (mod, &bias)); - - GElf_Ehdr ehdr_mem; - GElf_Ehdr* em = gelf_getehdr (elf, &ehdr_mem); - if (em == NULL) throw SEMANTIC_ERROR (_("Couldn't get elf header")); - - /* Giving priority to sym_table for ppc64*/ - if ((em->e_machine == EM_PPC64) && ((em->e_flags & EF_PPC64_ABI) == 2) - && (q->dw.mod_info->sym_table)) - { - /* The linkage name is the best match for the symbol table. */ - const string& linkage_name = dwarf_linkage_name(&func.die) - ?: dwarf_diename(&func.die) ?: (string)func.name; - - const auto& fis = q->dw.mod_info->sym_table->lookup_symbol(linkage_name); - for (auto it=fis.begin(); it!=fis.end() ; ++it) - { - func.entrypc = (*it)->entrypc; - if (is_filtered_func_exists(q->filtered_functions, &func)) - continue; - q->filtered_functions.push_back(func); - } - } - - /* If not ppc64 or not found in sym_table, try it directly. */ - if (!func.entrypc && q->dw.function_entrypc (&entrypc)) + if (q->dw.function_entrypc (&entrypc)) { func.entrypc = entrypc; q->filtered_functions.push_back (func); @@ -8462,13 +8420,6 @@ symbol_table::get_from_elf() int syments = dwfl_module_getsymtab(mod); assert(syments); prepare_section_rejection(mod); - Dwarf_Addr bias; - Elf* elf = (dwarf_getelf (dwfl_module_getdwarf (mod, &bias)) - ?: dwfl_module_getelf (mod, &bias)); - - GElf_Ehdr ehdr_mem; - GElf_Ehdr* em = gelf_getehdr (elf, &ehdr_mem); - if (em == NULL) throw SEMANTIC_ERROR (_("Couldn't get elf header")); for (int i = 1; i < syments; ++i) { @@ -8501,18 +8452,7 @@ symbol_table::get_from_elf() continue; interned_string name = n; - /* - * For ELF ABI v2 on PPC64 LE, we need to adjust sym.st_value corresponding - * to the bits of sym.st_other. These bits will tell us what's the offset - * of the local entry point from the global entry point. - * - * st_other field is currently only used with ABIv2 on ppc64 - */ Dwarf_Addr entrypc = addr; - if ((em->e_machine == EM_PPC64) && ((em->e_flags & EF_PPC64_ABI) == 2) - && (GELF_ST_TYPE(sym.st_info) == STT_FUNC) && sym.st_other) - entrypc += PPC64_LOCAL_ENTRY_OFFSET(sym.st_other); - if (GELF_ST_TYPE(sym.st_info) == STT_FUNC) add_symbol(name, (GELF_ST_BIND(sym.st_info) == STB_WEAK), reject, addr, entrypc); -- 2.1.4