From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22469 invoked by alias); 25 Jan 2014 12:29:51 -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 22459 invoked by uid 89); 25 Jan 2014 12:29:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.6 required=5.0 tests=AWL,BAYES_00,GARBLED_BODY autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 25 Jan 2014 12:29:50 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1W72Ms-0004PD-Uk from Yao_Qi@mentor.com ; Sat, 25 Jan 2014 04:29:46 -0800 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sat, 25 Jan 2014 04:29:46 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.2.247.3; Sat, 25 Jan 2014 04:29:45 -0800 Message-ID: <52E3ADB8.60707@codesourcery.com> Date: Sat, 25 Jan 2014 12:29:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Doug Evans CC: Subject: Re: [PATCH 1/3] change gdbserver to use hashtab: list->table References: In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00961.txt.bz2 On 01/25/2014 09:12 AM, Doug Evans wrote: > [In one perf experiment of attach/detach repeated 20 times on a > program with 1000 threads, the time as measured by gprof went from > 45sec to 5sec.] > > I created a testcase for our perf testsuite but the results there > don't show the speed as impressively because it can only measure gdb > not gdbserver. I may submit it separately anyway. Hi, Doug, Please do that. If gdbserver becomes faster, the improvements should be shown in the perf test result. I'd like to help on this. > > The patch is in 3 parts: > > 1) rename "list" to "table" throughout, > rename member "entry" in some structs to "head" (for consistency) > > 2) misc. prepatory cleanup, in particular while there are routines > to traverse the lists, some code traverses the list itself. > These need to be rewritten to always use the provided traversal > routines. > > 3) Add hashtable support. Where is patch 3/3? I don't see it in archive either. > > 2014-01-24 Doug Evans > > * inferiors.h (struct inferior_table): Renamed from struct > inferior_list. All uses updated. > (struct inferior_table_entry): Renamed from struct > inferior_list_entry. All uses updated. > (add_inferior_to_table): Renamed from add_inferior_to_list. > * inferiors.c (*): Update. Do we need entries like this? Since "All uses updated" is written above, probably we don't need these entries. In gnu coding standards: "When you change the calling sequence of a function in a simple fashion, and you change all the callers of the function to use the new calling sequence, there is no need to make individual entries for all the callers that you changed. Just write in the entry for the function being called, “All callers changed”" Probably, we can apply this rule here too. > (add_inferior_to_table): Renamed from add_inferior_to_list. > All callers updated. > * dll.c (*): Update. > * dll.h (*): Update. > (struct dll_info): Member "entry" renamed to "head". > * gdbthread.h (*): Update. > (struct thread_info): Member "entry" renamed to "head". > * linux-aarch64-low.c (*): Update. > * linux-arm-low.c (*): Update. > * linux-low.c (*): Update. > * linux-low.h (*): Update. > * linux-mips-low.c (*): Update. > * linux-x86-low.c (*): Update. > * regcache.c (*): Update. > * regcache.h (*): Update. > * server.c (*): Update. > * thread-db.c (*): Update. > * tracepoint.c (*): Update. > * win32-low.c (*): Update. -- Yao (齐尧)