Message ID | yjt2a93u61j8.fsf@ruffy.mtv.corp.google.com |
---|---|
State | Committed |
Headers |
Received: (qmail 6926 invoked by alias); 14 Nov 2014 00:58:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 6917 invoked by uid 89); 14 Nov 2014 00:58:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f74.google.com Received: from mail-oi0-f74.google.com (HELO mail-oi0-f74.google.com) (209.85.218.74) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 14 Nov 2014 00:58:38 +0000 Received: by mail-oi0-f74.google.com with SMTP id u20so2201260oif.3 for <gdb-patches@sourceware.org>; Thu, 13 Nov 2014 16:58:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:cc:date:message-id:mime-version :content-type; bh=JI7bi0P7aKn3iZbij1+5xVsM4nMi1u8WszA/atfyS4U=; b=EMqIF9h332hF2KwybXThk/k7m0SjDRuVv+5W3dknXBwVUYGP9g0lfEZKCUNsoLCm3y QaDUJ3aSozwmEXwQW7nEz5DhCJHqdn1plu8wAh20dbeDQKsPLJhvQPVEwwaGe+oSi8ZJ 5cbd0y2VVfTsWMWgRYDjrXcZsd3hxjj/o2tPQmtPsjaeJ04NWrCJ4ueHTTxQgNhog7oQ +KlFwyy0zP25XC+2KtSoDJRx9CLM/im2RH3dUF3p+C2W5JhbjoPgNSbrkP6lIGG8v7/T vjbqw22vP3Cw5ipKK+coyiKqW9QnJN+NGQZlFhxg+nx1yResiCQNK0p5Z6nF/0ptpzCF 8ROA== X-Gm-Message-State: ALoCoQkb7LupWxmcS3AKDR6pqIiRig80+zMoV3aHoqVcPLC/sWiO4YrSapHKYz3JRZwBijTsHScZ X-Received: by 10.50.73.201 with SMTP id n9mr2532240igv.8.1415926716776; Thu, 13 Nov 2014 16:58:36 -0800 (PST) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id n63si1133926yho.5.2014.11.13.16.58.36 for <multiple recipients> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Nov 2014 16:58:36 -0800 (PST) Received: from ruffy.mtv.corp.google.com ([172.17.128.44]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTPS id NKvjL0WT.1; Thu, 13 Nov 2014 16:58:36 -0800 From: Doug Evans <dje@google.com> To: gdb-patches@sourceware.org Subject: [COMMITTED PATCH] Fix PR symtab/17591 cc: saugustine@google.com Date: Thu, 13 Nov 2014 16:58:35 -0800 Message-ID: <yjt2a93u61j8.fsf@ruffy.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes |
Commit Message
Doug Evans
Nov. 14, 2014, 12:58 a.m. UTC
Hi. This patch fixes pr 17591. Regression tested on amd64-linux. The removing of the parens wasn't taking into account looking up "(anonymous namespace)". It turns out there can be a significant performance cost. The lookup would use "" which in the program where this was found had an entry in .gdb_index with ~1000 CUs, none of which had (anonymous namespace), so we were needlessly reading in a *lot* of debug info. Before: (gdb) pt obj type = ... Command execution time: 50.712058 (cpu), 52.275078 (wall) Space used: 2379862016 (+2180878336 for this command) #symtabs: 150433 (+150064), #primary symtabs: 2090 (+2081), #blocks: 774710 (+773450) After: (gdb) pt obj type = ... Command execution time: 0.850209 (cpu), 0.864219 (wall) Space used: 232112128 (+33136640 for this command) #symtabs: 3040 (+2671), #primary symtabs: 107 (+98), #blocks: 22595 (+21335) 2014-11-13 Doug Evans <dje@google.com> PR symtab/17591 * dwarf2read.c (find_slot_in_mapped_hash): Handle "(anonymous namespace)".
Comments
On Thu, Nov 13, 2014 at 4:58 PM, Doug Evans <dje@google.com> wrote: > Hi. > > This patch fixes pr 17591. > Regression tested on amd64-linux. > > The removing of the parens wasn't taking into account > looking up "(anonymous namespace)". > > It turns out there can be a significant performance cost. > The lookup would use "" which in the program where this > was found had an entry in .gdb_index with ~1000 CUs, > none of which had (anonymous namespace), > so we were needlessly reading in a *lot* of debug info. > > Before: > > (gdb) pt obj > type = ... > Command execution time: 50.712058 (cpu), 52.275078 (wall) > Space used: 2379862016 (+2180878336 for this command) > #symtabs: 150433 (+150064), #primary symtabs: 2090 (+2081), #blocks: 774710 (+773450) > > After: > > (gdb) pt obj > type = ... > Command execution time: 0.850209 (cpu), 0.864219 (wall) > Space used: 232112128 (+33136640 for this command) > #symtabs: 3040 (+2671), #primary symtabs: 107 (+98), #blocks: 22595 (+21335) > > 2014-11-13 Doug Evans <dje@google.com> > > PR symtab/17591 > * dwarf2read.c (find_slot_in_mapped_hash): Handle > "(anonymous namespace)". > > diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c > index ce37adf..0c97447 100644 > --- a/gdb/dwarf2read.c > +++ b/gdb/dwarf2read.c > @@ -2917,7 +2917,11 @@ find_slot_in_mapped_hash (struct mapped_index *index, const char *name, > { > /* NAME is already canonical. Drop any qualifiers as .gdb_index does > not contain any. */ > - const char *paren = strchr (name, '('); > + const char *paren = NULL; > + > + /* Need to handle "(anonymous namespace)". */ > + if (*name != '(') > + paren = strchr (name, '('); > > if (paren) > { Bleah. I was focused on the case at hand and wasn't thinking more generally. I'll submit a better patch tomorrow.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index ce37adf..0c97447 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2917,7 +2917,11 @@ find_slot_in_mapped_hash (struct mapped_index *index, const char *name, { /* NAME is already canonical. Drop any qualifiers as .gdb_index does not contain any. */ - const char *paren = strchr (name, '('); + const char *paren = NULL; + + /* Need to handle "(anonymous namespace)". */ + if (*name != '(') + paren = strchr (name, '('); if (paren) {