From owner-cvs-src-old@FreeBSD.ORG Wed Feb 18 21:52:23 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8ADF61065717 for ; Wed, 18 Feb 2009 21:52:23 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 16ACD8FC19 for ; Wed, 18 Feb 2009 21:52:23 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ILqM9m027180 for ; Wed, 18 Feb 2009 21:52:22 GMT (envelope-from attilio@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1ILqMtu027179 for cvs-src-old@freebsd.org; Wed, 18 Feb 2009 21:52:22 GMT (envelope-from attilio@repoman.freebsd.org) Message-Id: <200902182152.n1ILqMtu027179@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to attilio@repoman.freebsd.org using -f From: Attilio Rao Date: Wed, 18 Feb 2009 21:52:13 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern kern_proc.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 21:52:25 -0000 attilio 2009-02-18 21:52:13 UTC FreeBSD src repository Modified files: sys/kern kern_proc.c Log: SVN rev 188764 on 2009-02-18 21:52:13Z by attilio - Add a function (fill_kinfo_aggregate()) which aggregates relevant members for a kinfo entry on a process-wide system. - Use the newly introduced function in order to fix cases like KERN_PROC_PROC where aggregating stats are broken because they just consider the first thread in the pool for each process. (Note, additively, that KERN_PROC_PROC is rather inaccurate on thread-wide informations like the 'state' of the process. Such informations should maybe be invalidated and being forceably discarded by the consumers?). - Simplify the logic of sysctl_out_proc() and adjust the fill_kinfo_thread() accordingly. - Remove checks on the FIRST_THREAD_IN_PROC() being NULL but add assertives. This patch should fix aggregate statistics for KERN_PROC_PROC. This is one of the reasons why top doesn't use this option and now it can be use it safely. ps, when launched in order to display just processes, now should report correct cpu utilization percentages and times (as opposed by the old code). Reviewed by: jhb, emaste Sponsored by: Sandvine Incorporated Revision Changes Path 1.279 +44 -22 src/sys/kern/kern_proc.c