From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 26 19:21:00 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 540AA1065674 for ; Fri, 26 Dec 2008 19:21:00 +0000 (UTC) (envelope-from laladelausanne@gmail.com) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.187]) by mx1.freebsd.org (Postfix) with ESMTP id CFA788FC12 for ; Fri, 26 Dec 2008 19:20:59 +0000 (UTC) (envelope-from laladelausanne@gmail.com) Received: by mu-out-0910.google.com with SMTP id i2so1922981mue.3 for ; Fri, 26 Dec 2008 11:20:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:mime-version:subject:date:x-mailer; bh=vL8Y2VFDqTax1omMkAeQ6cKjYqsCouSJNocm1FuNUIo=; b=irkwcnwoA9MU8B+qBab5/N8ddnFMFEmeXBq8BuCf3NeIh0UGyly59c5qYBcWzaifdJ PqPKD8/gIpb2NO4Z3cGk8I10jLmW3H9zkrBIHWL0kf8D58vm8UhMfAnctPJyCXVlgJyU DlUbbGwCX2/9Kx5K9CfN3cvYDUlmMMbA6AQqs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:mime-version:subject:date:x-mailer; b=ksgLtP1x5pSJr8V7JLDPJZby+ecVtXRjiyZRyFSQrYQSDsac3rL/0evjjUuHWu714J aMLS6YIiqFOzeLz1yjNeQeedXNRhoSGL7heQTXgaJXOT4qoZtT7uwkHq5sIRZGtq206C vP6xxYeuldW/dL2gcEIrqDje+O0twR8I+58Dk= Received: by 10.103.171.6 with SMTP id y6mr3953890muo.31.1230319258546; Fri, 26 Dec 2008 11:20:58 -0800 (PST) Received: from ?192.168.1.11? (dyn.144-85-136-010.dsl.vtx.ch [144.85.136.10]) by mx.google.com with ESMTPS id i5sm24569935mue.16.2008.12.26.11.20.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 26 Dec 2008 11:20:57 -0800 (PST) Message-Id: <7555893E-5D2F-4C3C-A1C7-7BCC2461AE23@gmail.com> From: =?UTF-8?Q?Nikola_Kne=C5=BEevi=C4=87?= To: freebsd-hackers@freebsd.org Content-Type: multipart/mixed; boundary=Apple-Mail-5-756468613 Mime-Version: 1.0 (Apple Message framework v930.3) Date: Fri, 26 Dec 2008 20:20:55 +0100 X-Mailer: Apple Mail (2.930.3) Subject: ps not showing CPU# correctly 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: Fri, 26 Dec 2008 19:21:00 -0000 --Apple-Mail-5-756468613 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Hi, on my system, I noticed that ps(1) is not showing the CPU# correctly (it always displays 0). There was a bug in it, and it was fetching ki_estcpu instead of ki_lastcpu. The attached patch fixes this issue. Cheers, Nikola --Apple-Mail-5-756468613 Content-Disposition: attachment; filename=ps.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="ps.patch" Content-Transfer-Encoding: 7bit diff -ur ps.orig/keyword.c ps.new/keyword.c --- /usr/src/bin/ps/keyword.c 2007-10-28 18:10:36.000000000 +0100 +++ /usr/src/bin/ps/keyword.c 2008-12-26 20:14:03.000000000 +0100 @@ -83,7 +83,7 @@ NULL, 0}, {"command", "COMMAND", NULL, COMM|LJUST|USER, command, NULL, 16, 0, CHAR, NULL, 0}, - {"cpu", "CPU", NULL, 0, kvar, NULL, 3, KOFF(ki_estcpu), UINT, "d", + {"cpu", "CPU", NULL, 0, kvar, NULL, 3, KOFF(ki_lastcpu), CHAR, "d", 0}, {"cputime", "", "time", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, {"emul", "EMUL", NULL, LJUST, emulname, NULL, EMULLEN, 0, CHAR, --Apple-Mail-5-756468613 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit --Apple-Mail-5-756468613--