Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jun 2008 12:56:04 -0500 (CDT)
From:      Stephen Montgomery-Smith <stephen@math.missouri.edu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/124591: top gets TIME wrong for threaded processes
Message-ID:  <200806141756.m5EHu4M8048333@cauchy.math.missouri.edu>
Resent-Message-ID: <200806141840.m5EIe2bR023962@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         124591
>Category:       bin
>Synopsis:       top gets TIME wrong for threaded processes
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 14 18:40:02 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Stephen Montgomery-Smith
>Release:        FreeBSD 7.0-STABLE i386
>Organization:
>Environment:
FreeBSD laptop3.gateway.2wire.net 8.0-CURRENT FreeBSD 8.0-CURRENT #2: Wed Jun 11 23:17:45 CDT 2008     stephen@laptop3.gateway.2wire.net:/usr/obj/usr/src/sys/LAPTOP3  i386

	
>Description:

When running a threaded program, top picks randomly one of the threads from which to report TIME.  It would be better if it totalled them.

>How-To-Repeat:
	
>Fix:

--- 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;
 		}
 	}
 

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806141756.m5EHu4M8048333>