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 "[EMAIL PROTECTED]"

_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to