Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Dec 2008 01:07:21 +0100 (CET)
From:      Nikola.Knezevic.laladelausanne@gmail.com
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/129966: ps(1) always shows 0 for CPU#
Message-ID:  <200812270007.mBR07L7m028667@nslrack53.epfl.ch>
Resent-Message-ID: <200812270040.mBR0e1AO037417@freefall.freebsd.org>

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

>Number:         129966
>Category:       bin
>Synopsis:       ps(1) always shows 0 for CPU#
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 27 00:40:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Nikola Knezevic
>Release:        FreeBSD 7.1-PRERELEASE amd64
>Organization:
EPFL IC IIF NSL 
>Environment:
System: FreeBSD nslrack53.epfl.ch 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #5: Wed Sep 17 12:18:55 CEST 2008 knl@nslrack53.epfl.ch:/usr/obj/usr/src/sys/MXCORE amd64


	
>Description:
When invoked with -Hl arguments, ps(1) shows 0 for CPU#, although there are many cores on the system.
	
>How-To-Repeat:
On the command line, run:
    ps -axHl
	
>Fix:
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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812270007.mBR07L7m028667>