From nobody@FreeBSD.org  Sat Dec 27 00:14:49 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 589731065673
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 27 Dec 2008 00:14:49 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 488C58FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 27 Dec 2008 00:14:49 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id mBR0EnPf032639
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 27 Dec 2008 00:14:49 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id mBR0Env3032637;
	Sat, 27 Dec 2008 00:14:49 GMT
	(envelope-from nobody)
Message-Id: <200812270014.mBR0Env3032637@www.freebsd.org>
Date: Sat, 27 Dec 2008 00:14:49 GMT
From: "Nikola Kneevi&#263;" <laladelausanne@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ps -lH doesn't show the proper CPU#
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         129965
>Category:       bin
>Synopsis:       [patch] ps(1): ps -lH doesn't show the proper CPU#
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    gavin
>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:  Tue Nov 15 23:20:08 UTC 2011
>Originator:     Nikola Kneevi&#263;
>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@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:
Responsible-Changed-From-To: freebsd-bugs->gavin 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Mon Jul 19 12:44:41 UTC 2010 
Responsible-Changed-Why:  
I'll grab this one 

http://www.freebsd.org/cgi/query-pr.cgi?pr=129965 

From: Glen Barber <gjb@FreeBSD.org>
To: bug-followup@FreeBSD.org, gavin@FreeBSD.org
Cc:  
Subject: Re: bin/129965: [patch] ps(1): ps -lH doesn't show the proper CPU#
Date: Tue, 15 Nov 2011 18:18:33 -0500

 --aM3YZ0Iwxop3KEKx
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 Hi Gavin,
 
 I have a patch against HEAD that applies cleanly.  Is there any chance
 this can be committed?
 
 Regards,
 
 Glen
 
 --=20
 Glen Barber | gjb@FreeBSD.org
 FreeBSD Documentation Project
 
 
 Index: ps/keyword.c
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 --- ps/keyword.c	(revision 227541)
 +++ ps/keyword.c	(working copy)
 @@ -76,7 +76,7 @@
  	{"comm", "COMMAND", NULL, LJUST, ucomm, 0, CHAR, NULL, 0},
  	{"command", "COMMAND", NULL, COMM|LJUST|USER, command, 0,
  		CHAR, NULL, 0},
 -	{"cpu", "CPU", NULL, 0, kvar, KOFF(ki_estcpu), UINT, "d", 0},
 +	{"cpu", "CPU", NULL, 0, kvar, KOFF(ki_lastcpu), CHAR, "d", 0},
  	{"cputime", "", "time", 0, NULL, 0, CHAR, NULL, 0},
  	{"egid", "", "gid", 0, NULL, 0, CHAR, NULL, 0},
  	{"egroup", "", "group", 0, NULL, 0, CHAR, NULL, 0},
 
 --aM3YZ0Iwxop3KEKx
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (Darwin)
 
 iQEcBAEBCAAGBQJOwvNJAAoJEFJPDDeguUajvuwH/19njneYK2YhiSW4eeP7odAr
 Y5I34tBIBgWGBv8aGQEwcaQ2vpzJx3hCt0jmTzC/apGHghvxIqHmIVqDJTtLrxu5
 OcT04BK/V8vltHoAN3k5msm9aIKDT3UpccIUs4NrmzAGWuZF5in+1bov9/VDVkhN
 wue35FemXPNE8w9MRXD8dkAqnHKpgHWaqzzorzBFnYB2v+A/g3ah7z7Z2Yc661qG
 tDnTfwcfvbaAxHplomOeiiejD1SxLBey5mfPoS59OXqXBMESv4qmGl81YtJZEHgi
 AAs0Z9k8pvPvahQpK0W8/csdifDhfUs56LA2IFKQWGOtxrIyjePG7rqxWpMExv8=
 =NPiG
 -----END PGP SIGNATURE-----
 
 --aM3YZ0Iwxop3KEKx--
>Unformatted:
