From owner-freebsd-hackers@FreeBSD.ORG Sat Jun 14 17:26:09 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF1F61065673 for ; Sat, 14 Jun 2008 17:26:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 97BC38FC15 for ; Sat, 14 Jun 2008 17:26:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 01BFD46C20; Sat, 14 Jun 2008 13:26:09 -0400 (EDT) Date: Sat, 14 Jun 2008 18:26:08 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Stephen Montgomery-Smith In-Reply-To: <4851F593.2030504@math.missouri.edu> Message-ID: <20080614182550.C66582@fledge.watson.org> References: <4851F593.2030504@math.missouri.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: Small change to top X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jun 2008 17:26:09 -0000 On Thu, 12 Jun 2008, Stephen Montgomery-Smith wrote: > top doesn't get TIME right for threaded processes. How about this small > change: Could you file a PR for this so that it doesn't get lost? Thanks! Robert N M Watson Computer Laboratory University of Cambridge > > --- usr.bin/top/machine.c-orig 2008-06-12 23:06:08.000000000 -0500 > +++ usr.bin/top/machine.c 2008-06-12 23:06:51.000000000 -0500 > @@ -725,6 +725,7 @@ > prev_pp = pp; > } else { > prev_pp->ki_pctcpu += pp->ki_pctcpu; > + prev_pp->ki_runtime += pp->ki_runtime; > } > } > > > (Sorry if the mail client messes up the patch, but it is so short that it can > be easily entered by hand.) > > I do realize that this is not foolproof, because it won't measure any threads > that have finished. But it is perhaps a bit better than the current state of > affairs, which randomly picks a runtime of one of the threads. > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >