From owner-freebsd-hackers@FreeBSD.ORG Sat Jun 4 14:58:35 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B96D616A41C for ; Sat, 4 Jun 2005 14:58:35 +0000 (GMT) (envelope-from matt@gsicomp.on.ca) Received: from skippyii.compar.com (webpos.compar.com [216.208.38.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 12D9C43D1F for ; Sat, 4 Jun 2005 14:58:34 +0000 (GMT) (envelope-from matt@gsicomp.on.ca) Received: from hermes (CPE00062566c7bb-CM000039c69a66.cpe.net.cable.rogers.com [69.193.82.185]) by skippyii.compar.com (8.13.1/8.13.1) with ESMTP id j54F9MkM081636; Sat, 4 Jun 2005 11:09:23 -0400 (EDT) (envelope-from matt@gsicomp.on.ca) Message-ID: <001c01c56915$ed39e030$1200a8c0@gsicomp.on.ca> From: "Matt Emmerton" To: "Neo-Vortex" , References: <20050604235846.X62115@Neo-Vortex.net> Date: Sat, 4 Jun 2005 10:58:52 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Cc: Subject: Re: vmstat reporting incorrect cpu usage 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, 04 Jun 2005 14:58:35 -0000 ----- Original Message ----- From: "Neo-Vortex" To: Sent: Saturday, June 04, 2005 10:01 AM Subject: vmstat reporting incorrect cpu usage > I've noticed if i run vmstat with no params when rebuilding the kernel i > get this right: > > # vmstat > procs memory page disk faults cpu > r b w avm fre flt re pi po fr sr ad0 in sy cs us sy id > 2 1 0 294156 44596 313 0 0 0 296 1 0 82 85 225 14 8 78 > # > > But, if i run it like this > > # vmstat -c 2 > procs memory page disk faults cpu > r b w avm fre flt re pi po fr sr ad0 in sy cs us sy id > 1 1 0 299580 38204 313 0 0 0 296 1 0 82 85 225 14 8 78 > 1 1 0 294996 42876 886 0 0 0 2061 0 3 2222 1364 2231 81 19 0 > # > > The second result shows what top does, but the first one seems to be > completely wrong... > > # vmstat -c 6 > procs memory page disk faults cpu > r b w avm fre flt re pi po fr sr ad0 in sy cs us sy id > 1 1 0 300136 36196 313 0 0 0 296 1 0 82 85 225 14 8 78 > 1 1 0 301040 35312 230 0 0 0 9 0 0 2193 489 2156 87 13 0 > 1 1 0 296720 39644 1234 0 0 0 2326 0 5 2190 1530 2185 70 30 0 > 1 1 0 297092 39228 1435 0 0 0 1336 0 3 2200 1562 2188 75 25 0 > 1 1 0 298488 37844 1573 0 0 0 1229 0 4 2206 1592 2191 69 31 0 > 1 1 0 299372 36908 316 0 0 0 123 0 96 2301 618 2442 86 14 0 > # > > Only the first one seems to do it though... > > FreeBSD 5.3-RELEASE. > > Does this happen for anyone else? (Mabe someone running 5.4 can test > this?) The first line is the average since the system was last booted; all other lines are instantaneous. -- Matt Emmerton