From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15428 invoked by alias); 19 Apr 2006 12:40:41 -0000 Received: (qmail 15389 invoked by uid 22791); 19 Apr 2006 12:40:38 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 19 Apr 2006 12:40:35 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FWByy-0002UU-Tc; Wed, 19 Apr 2006 08:40:32 -0400 Date: Thu, 20 Apr 2006 08:50:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: gdb@sources.redhat.com Subject: Re: MI: performance of getting stack arguments Message-ID: <20060419124032.GA9524@nevyn.them.org> Mail-Followup-To: Vladimir Prus , gdb@sources.redhat.com References: <20060418161654.GA15524@nevyn.them.org> <200604191020.08044.ghost@cs.msu.su> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200604191020.08044.ghost@cs.msu.su> User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00264.txt.bz2 On Wed, Apr 19, 2006 at 10:20:07AM +0400, Vladimir Prus wrote: > It's specifically the -stack-list-arguments command that takes 600ms. The > separately issued -stack-list-frames takes 150ms which is not fast either, > but not as bad as -stack-list-arguments. OK, there is probably something absurdly stupid going on then. > > If it's the arguments, > > we may be able to improve it. Maybe build a debuggable GDB and "maint > > set profile"? > > Sure. What's the right way to build debuggable GDB, setting CFLAGS=-g during > configure or something else? Two ways. You can use --enable-profiling as Eli suggested, which will let you get callgraphs, or you can just use a binary built with the default CFLAGS (-O2 -g), and "maint set profile". You have to use gprof --no-graph on the output file to get output if you do that. I still find it useful - e.g. the numbers I posted to dmi-discuss yesterday came from that. Its advantage is that it doesn't inflate small functions as badly. > I though about it and it might work, assuming that "-stack-list-arguments 1 > 100 110" won't take too much time to get to frame 100. I think getting to > frame 100 should be fast, since nothing should be printed, but will need to > check. It should be instant. That'll just walk the cached list of frames - as long as nothing is invalidating the frame cache! (One of the more likely stupid things to be happening). -- Daniel Jacobowitz CodeSourcery