From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13518 invoked by alias); 24 Nov 2008 19:25:07 -0000 Received: (qmail 13427 invoked by uid 22791); 24 Nov 2008 19:25:06 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Nov 2008 19:24:25 +0000 Received: (qmail 2180 invoked from network); 24 Nov 2008 19:24:15 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 24 Nov 2008 19:24:15 -0000 From: Pedro Alves To: Michael Snyder Subject: Re: [RFA] Add optional argument to "info threads" command Date: Mon, 24 Nov 2008 22:10:00 -0000 User-Agent: KMail/1.9.10 Cc: "gdb-patches@sourceware.org" References: <4928BC24.5020600@vmware.com> <200811240308.49485.pedro@codesourcery.com> <492AFAE8.4040405@vmware.com> In-Reply-To: <492AFAE8.4040405@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811241924.14165.pedro@codesourcery.com> 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: 2008-11/txt/msg00658.txt.bz2 On Monday 24 November 2008 19:05:12, Michael Snyder wrote: > Well, all your observations are correct -- but the same thing > also happens if you merely switch the thread of focus using the > "thread" command. > > I do think that prune-threads and target_find_new_threads > are being called too aggressively from somewhere, but it > isn't directly from info_threads_command. It's inside print_thread_info, and IIUC, you're calling it on each of the ids in range? > I think this is a separate, pre-existing problem that this patch > helps to reveal. I'm thinking about the case where you have 200 threads, and you do 'info threads 40-45'. That'll do 15 prune_threads, target_find_new_threads and frame restores. That'll be around '14 * (200 + 200 + 1)' roundtrips extra at least instead of the current (200 + 200). The worst case, is of course, if you do 'info threads 1-200'. Then you'll have '199 * (200 + 200 + 1)' extra target roundtrips compared to plain 'info threads'. That's around 80000? Unless I'm missing something. Isn't this the same reasoning behind having thread_apply_command and thread_apply_all implementations, instead of having one call into the other? (Upps, just spotted a cleanups bug in thread_apply_command). -- Pedro Alves