bin/129965: ps -lH doesn't show the proper CPU#

Nikola Knežević laladelausanne at gmail.com
Fri Dec 26 16:20:04 PST 2008


>Number:         129965
>Category:       bin
>Synopsis:       ps -lH doesn't show the proper CPU#
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 27 00:20:03 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Nikola Knežević
>Release:        7.1-PRERELEASE #5
>Organization:
EPFL IC IIF NSL
>Environment:
FreeBSD nslrack53.epfl.ch 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #5: Wed Sep 17 12:18:55 CEST 2008     knl at nslrack53.epfl.ch:/usr/obj/usr/src/sys/MXCORE  amd64
>Description:
ps -Hl shows 0 in the CPU# column for every thread. It should show the correct CPU#.
>How-To-Repeat:
observe the output of ps -axHl
>Fix:


Patch attached with submission follows:

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,


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list