From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70248 invoked by alias); 29 May 2018 17:04:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 70231 invoked by uid 89); 29 May 2018 17:04:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1325, H*Ad:D*oracle.com, H*r:Gateway, HContent-Transfer-Encoding:8bit X-HELO: aserp2130.oracle.com Received: from aserp2130.oracle.com (HELO aserp2130.oracle.com) (141.146.126.79) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 29 May 2018 17:04:12 +0000 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4TGugth041639; Tue, 29 May 2018 17:04:04 GMT Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2j6w42jf3g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 May 2018 17:04:04 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w4TH43Mi014138 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 May 2018 17:04:03 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w4TH43vo014169; Tue, 29 May 2018 17:04:03 GMT Received: from [10.159.148.13] (/10.159.148.13) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 29 May 2018 10:04:02 -0700 Subject: Re: [PATCH] Removing lookup_minimal_symbol_and_objfile To: Simon Marchi Cc: gdb-patches@sourceware.org References: <1526343059-25143-1-git-send-email-weimin.pan@oracle.com> From: Wei-min Pan Message-ID: <637ac9ab-6089-b89f-ede2-6aa8d2b6ba6b@oracle.com> Date: Tue, 29 May 2018 17:25:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8908 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=905 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805290185 X-SW-Source: 2018-05/txt/msg00771.txt.bz2 On 5/25/2018 6:24 PM, Simon Marchi wrote: > On 2018-05-14 20:10, Weimin Pan wrote: >> Removing lookup_minimal_symbol_and_objfile and replacing it with >> lookup_bound_minimal_symbol. lookup_minimal_symbol_and_objfile >> only searches ordinary hash table for the minimal symbol entry >> while lookup_bound_minimal_symbol does both ordinary hash table >> and demangled hash table for the entry. >> >> Tested in both aarch64-linux-gnu and amd64-linux-gnu. No regressions. > > Hi Weimin, > > Thanks for the patch, the code looks good.  But I think the commit log > is misleading.  The point is that lookup_minimal_symbol_and_objfile > iterates on all objfiles and calls lookup_minimal_symbol for each of > them, effectively searching in all objfiles.  > lookup_bound_minimal_symbol calls lookup_minimal_symbol with NULL, > which also effectively searches all objfiles.  AFAIK, they do exactly > the same thing, so we can get rid of one (and > lookup_minimal_symbol_and_objfile happens to be the most inefficient > because it ends up n^2 on the number of objfiles). > > If you are fine with this correction, please push with the commit log > adjusted. > > Simon Hi Simon, I agree with your description which looks better and will use it. Thanks for your comment. Weimin