From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21151 invoked by alias); 20 Jul 2011 16:05:26 -0000 Received: (qmail 21140 invoked by uid 22791); 20 Jul 2011 16:05:24 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Jul 2011 16:04:44 +0000 Received: from hpaq1.eem.corp.google.com (hpaq1.eem.corp.google.com [172.25.149.1]) by smtp-out.google.com with ESMTP id p6KG4gEL012546 for ; Wed, 20 Jul 2011 09:04:43 -0700 Received: from gya1 (gya1.prod.google.com [10.243.49.1]) by hpaq1.eem.corp.google.com with ESMTP id p6KG2bYs000832 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 20 Jul 2011 09:04:41 -0700 Received: by gya1 with SMTP id 1so237825gya.22 for ; Wed, 20 Jul 2011 09:04:41 -0700 (PDT) Received: by 10.91.96.18 with SMTP id y18mr7967598agl.0.1311177881117; Wed, 20 Jul 2011 09:04:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.25.19 with HTTP; Wed, 20 Jul 2011 09:04:11 -0700 (PDT) In-Reply-To: <201107201537.18159.pedro@codesourcery.com> References: <20110715205209.8B3B3190BC2@elbrus2.mtv.corp.google.com> <201107201537.18159.pedro@codesourcery.com> From: Paul Pluzhnikov Date: Wed, 20 Jul 2011 16:15:00 -0000 Message-ID: Subject: Re: [RFC][patch] Avoid repeated calls to solib_add on initial attach. To: Pedro Alves Cc: gdb-patches@sourceware.org, Luis Machado Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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: 2011-07/txt/msg00544.txt.bz2 On Wed, Jul 20, 2011 at 7:37 AM, Pedro Alves wrote: > On Friday 15 July 2011 21:52:09, Paul Pluzhnikov wrote: >> Greetings, >> >> Following up on my earlier "slow on high-latency links" message: >> http://sourceware.org/ml/gdb-patches/2011-07/msg00391.html ... >> >> Attached patch avoids calling solib_add twice when initially attaching >> inferior. >> >> I am not entirely happy about this patch, but don't have a better idea >> for a fix, and do want to avoid repeated rescans of the shared library l= ist. > > Me neigher, apart from doing as the comment says: > >> =A0 /* Sometimes the platform-specific hook loads initial shared >> =A0 =A0 =A0 =A0libraries, and sometimes it doesn't. =A0If it doesn't FRO= M_TTY will be >> =A0 =A0 =A0 =A0incorrectly 0 but such solib targets should be fixed anyw= ay. =A0If we >> =A0 =A0 =A0 =A0made all the inferior hook methods consistent, this call = could be >> =A0 =A0 =A0 =A0removed. =A0Call it only after the solib target has been = initialized by >> =A0 =A0 =A0 =A0solib_create_inferior_hook. =A0*/ > > Or, making retrieving the dso list cheap enough to not care about the > multiple calls. =A0By e.g., caching more things, and making > target_read_string not super dumb (as you've yourself proposed). I think DSO list with 4K entries and 200ms packet response time is not going to ever become cheap enough. Fixing all inferior hook methods to be consistent and always load initial DSO list sounds promising, but has the practical problem: I don't have access to many systems. I'll check what I can do there ... > Can you give a try on the attached patches and see how much > a difference they make for you? Thanks, I'll try them. > Patch 2 has the most dramatic affect; Yes, I've already tried equivalent patch (except I set the default size to 128), and (as expected) it did make a big difference. Going back to the new packet proposal to speed up target_read_string; do you have any additional comments on qStr {addr},{maxlen},{terminator} format? Should {terminator} be optional? Should I avoid it altogether (it doesn't solve any current problem, so perhaps it's over-design) ? Thanks, --=20 Paul Pluzhnikov