Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Dec 2008 20:20:55 +0100
From:      =?UTF-8?Q?Nikola_Kne=C5=BEevi=C4=87?= <laladelausanne@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   ps not showing CPU# correctly
Message-ID:  <7555893E-5D2F-4C3C-A1C7-7BCC2461AE23@gmail.com>

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

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7555893E-5D2F-4C3C-A1C7-7BCC2461AE23>