From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26684 invoked by alias); 24 Oct 2014 07:33:16 -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 26674 invoked by uid 89); 24 Oct 2014 07:33:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 24 Oct 2014 07:33:15 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9O7XC9D009067 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 24 Oct 2014 03:33:12 -0400 Received: from host2.jankratochvil.net (ovpn-116-79.ams2.redhat.com [10.36.116.79]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9O7X9Ju019484 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Fri, 24 Oct 2014 03:33:11 -0400 Date: Fri, 24 Oct 2014 07:33:00 -0000 From: Jan Kratochvil To: Doug Evans Cc: "gdb-patches@sourceware.org" Subject: Re: [patchv2 2/2] Accelerate lookup_symbol_aux_objfile 14.5x [Re: [patch 0/2] Accelerate symbol lookups 15x] Message-ID: <20141024073308.GA20087@host2.jankratochvil.net> References: <20141020214410.GA22011@host2.jankratochvil.net> <20141023182434.GA31412@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00631.txt.bz2 On Fri, 24 Oct 2014 09:16:01 +0200, Doug Evans wrote: > One thought I have is that significant changes at a higher level will > minimize the impact of this patch. One change I'm thinking of making > is replacing iterating over every symbol table and then if that fails > going to the index with instead just going straight to the index: the > index knows where the symbols are (you mentioned this as well). Yes, I tried that first. For the performance testcase I provided the issue is in lookup_symbol_global_iterator_cb(): data->result = lookup_symbol_aux_objfile (objfile, GLOBAL_BLOCK, data->name, data->domain); if (data->result == NULL) data->result = lookup_symbol_aux_quick (objfile, GLOBAL_BLOCK, data->name, data->domain); Changing their order does not fix the performance as lookup_symbol_aux_quick() (that is quick_symbol_functions::lookup_symbol) can return NULL * either if the symbol is really not present in the index. * or if the symbol's symtab is already expanded. For the latter case (commonly happening) quick_symbol_functions::lookup_symbol finds the right symtab but then it drops that information. Changing the quick_symbol_functions::lookup_symbol semantics may fix it. But then it will get fixed only for .gdb_index files while my two patches also improve performance of non-.gdb_index files. For each objfile .gdb_index presence is orthogonal to DWZ application. Sure a question remains if we should care about performance of non-.gdb_index files at all. Even for continuous edit-build-debug cycles it is worth to run gdb-add-index during each build. > If we were to go this route (and apologies for the delay), can you > write a routine like lookup_block_symbol which does the above and call > that here instead? OK. Jan