From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11276 invoked by alias); 14 Mar 2013 18:43:42 -0000 Received: (qmail 11268 invoked by uid 22791); 14 Mar 2013 18:43:41 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from gbenson.demon.co.uk (HELO blade.wire.rat) (80.177.220.214) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Mar 2013 18:43:10 +0000 Received: by blade.wire.rat (Postfix, from userid 500) id D11B9263C5D; Thu, 14 Mar 2013 18:43:08 +0000 (GMT) Date: Thu, 14 Mar 2013 18:43:00 -0000 From: Gary Benson To: Jan Kratochvil Cc: Aleksandar Ristovski , "gdb-patches@sourceware.org" Subject: Re: [draft patch 0/6] Split FYI and some review notes Message-ID: <20130314184308.GC7696@blade.wire.rat> Mail-Followup-To: Jan Kratochvil , Aleksandar Ristovski , "gdb-patches@sourceware.org" References: <51278984.3070208@qnx.com> <20130310210734.GA21130@host2.jankratochvil.net> <513DE949.6030508@qnx.com> <20130311150700.GA12857@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130311150700.GA12857@host2.jankratochvil.net> 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: 2013-03/txt/msg00647.txt.bz2 Jan Kratochvil wrote: > On Mon, 11 Mar 2013 15:25:13 +0100, Aleksandar Ristovski wrote: > > On 13-03-10 05:07 PM, Jan Kratochvil wrote: > > > Do not run get_hex_build_id quadratically - currently for each > > > library you open and scan maps/smaps again. Probably the best > > > approach is to scan all l_ld addresses from r_debug first, then > > > qsort them and then linearly match them to the maps/smaps > > > entries. I am not sure but I guess they still should be > > > returned to GDB in their original order from r_debug for some > > > backward and solib-svr4.c compatibility. Also Gary Benson is > > > working on incremental shlib transfers from gdbserver so that it > > > does not clash too much (it will anyway). While just quadratic > > > computation would be in real world acceptable all the > > > open/read/close syscalls I find really needlessly expensive. > > > > I thought it would be an overkill to make it any more > > optimal. Ideal situation would be to send "library loaded"/ > > "library unloaded" events instead of sending the whole list > > each time. > > > > But sure, I'll do the qsort. > > Particularly this shared library list handling has been proven to > be performance critical. All the performance improvements by Gary > Benson target this issue, including sending the '"library loaded"/ > "library unloaded" events' (being worked on). It's definitely performance critical on the GDB side. There are people out there debugging apps with 4000+ shared libraries, and that exposes all kinds of issues :) Per your suggestion of gdbserver sending events... I've spent some time thinking about this. I think the direction of the protocol is correct, in that GDB asks for the library list when it wants it. What exactly is transferred is open to change (whole list vs deltas) but I don't know whether anybody is actually having issues with performance stemming from the size of the transferred list. I can certainly imagine scenarios where it would be the bottleneck, but I don't know if these exist in the real world. Note that since Tom's ambiguous linespec work went in GDB needs to update its list at every change. You could seriously speed things up if you could eliminate this need--I considered making it asynchronous at one point, but couldn't get around it. > Ccing Gary as the qsort by l_ld in gdbserver apparently has to clash > with his patch being cooked. I think they do need to be transferred to GDB in the order they were read from r_debug. Thank you Jan for spotting this. Thanks, Gary -- http://gbenson.net/