From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2761 invoked by alias); 14 Jul 2012 00:07:11 -0000 Received: (qmail 2709 invoked by uid 22791); 14 Jul 2012 00:07:03 -0000 X-SWARE-Spam-Status: No, hits=-5.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vb0-f41.google.com (HELO mail-vb0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 14 Jul 2012 00:06:50 +0000 Received: by vbkv13 with SMTP id v13so3221723vbk.0 for ; Fri, 13 Jul 2012 17:06:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-system-of-record:x-gm-message-state; bh=NoByfq7aqoMGYyeJaZ4XsXYYgb0pjbZwpGq2z4m+H3Q=; b=CrtuI3N8tTYcXyRTnBBxUPsXaCQDQeTri2gEtwq5/u6EjqEoPGxMNfuGuYHDfyZIti dpGUnbVXLWqFDpxJ33Oawowz/5b0jBbqbulmc9AaVpim9hmkHwtMpPte8Z9g8XLDdKBO SV+GN1tyFmwkRM2I7aBNiI3gX7Ik6IoyFQuf3hgldI5+d4QpKrluIRmgemVtPOVpfhLo Tl1xqH64s2+HRwEAibJOadutQQhbvFm/gFecNYJ4aFHAkDnEdxLdeA0xf6nZGIN3gtDQ 9QIOLXdWAfmAyyQt5JGRmHHZRtF2JCkB1GNJsRnkk0qkOu3CciOCE+/ykpbUeHeWWZeI OVPw== Received: by 10.52.73.225 with SMTP id o1mr1327963vdv.77.1342224409931; Fri, 13 Jul 2012 17:06:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.73.225 with SMTP id o1mr1327960vdv.77.1342224409844; Fri, 13 Jul 2012 17:06:49 -0700 (PDT) Received: by 10.52.157.4 with HTTP; Fri, 13 Jul 2012 17:06:49 -0700 (PDT) In-Reply-To: References: <20120709181015.2FCA41E13A1@ruffy2.mtv.corp.google.com> Date: Sat, 14 Jul 2012 00:07:00 -0000 Message-ID: Subject: Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb. From: Doug Evans To: gdb-patches Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true X-Gm-Message-State: ALoCoQn5o8OGhvk6VPXFHqRDBopB+fYwneDBljr0mXWgBdm7m03brnj9h+u6fzV0ZgATjI380T7mAWHk6AqSpubYNahh0xvFPMuMwxZRd2WvbJA5XOgMBFMCNsXH/ZP0CxBwvfGzahvzJv3YvOn204F2Nu8KY2CGJK8XdCBXO3H75KTjHRcsGKeAbmhYyeEpBuMj2+90JUPL X-IsSubscribed: yes 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 X-SW-Source: 2012-07/txt/msg00193.txt.bz2 On Fri, Jul 13, 2012 at 11:52 AM, Doug Evans wrote: > Hi. "ping" [for the libiberty part] > > [The gdb part needs to be updated due to recent changes there, but I'm > going to wait until the libiberty part is approved.] > > On Mon, Jul 9, 2012 at 11:10 AM, Doug Evans wrote: >> Hi. >> >> filename_seen in gdb does a linear search, this patch changes it >> to use a hash table. >> >> Ok to check in? >> >> I couldn't think of a good reason to put filename_hash,filename_eq in gdb, >> and I like placing them close to where hashtab.c and filename_cmp are defined. >> I also couldn't think of a sufficient reason to put them in a file by >> themselves. Ergo adding them to filename_cmp.c, filenames.h. >> [It's possible there's a program that uses filename_cmp and already >> defines functions with the same names (thus this will introduce a build >> failure), but that's always a risk. I couldn't find any in gdb,binutils,gcc. >> Technically speaking, it's also possible that adding the #include "hashtab.h" >> to filenames.h could introduce a build failure (e.g., some file has a static >> symbol that collides with one used in hashtab.h). I'm hoping that's more of >> a theoretical concern.] >> >> 2012-07-09 Doug Evans >> >> include/ >> * filenames.h: #include "hashtab.h". >> (filename_hash, filename_eq): Declare. >> >> libiberty/ >> * filename_cmp.c (filename_hash, filename_eq): New functions. >> >> gdb/ >> * symtab.c (filename_seen): Rewrite to use a hash table. With the libiberty part done, here's the updated gdb side. As data, using my standard large app for exercising gdb issues, and after running it a few times to warm the disk cache (for the fullname conversion): gdb $program # uses .gdb_index v7 (gdb) mt time 1 (gdb) info sources #1 (gdb) info sources #2 Before (best of 3): #1: 18.100000 (cpu), 18.666510 (wall) #2: 7.580000 (cpu), 7.936617 (wall) After (best of 3): #1: 10.060000 (cpu), 10.912673 (wall) #2: 0.280000 (cpu), 2.746012 (wall) Ok to check in? 2012-07-13 Doug Evans * symtab.c (filename_seen_cache): Delete members "tab_alloc_size", "tab_cur_size". Change member "tab" to be a htab_t. (create_filename_seen_cache): Update. (clear_filename_seen_cache, delete_filename_seen_cache): Update. (filename_seen): Update.