NetBSD Problem Report #7025

Received: (qmail 15758 invoked from network); 21 Feb 1999 05:00:57 -0000
Message-Id: <199902210500.OAA02632@mirage.ceres.dti.ne.jp>
Date: Sun, 21 Feb 1999 14:00:20 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@gnats.netbsd.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: top output is not sorted by cpu value on alpha
X-Send-Pr-Version: 3.95

>Number:         7025
>Category:       bin
>Synopsis:       top output is not sorted by cpu value on alpha
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 20 21:05:00 +0000 1999
>Closed-Date:    Mon Apr 12 05:16:24 +0000 1999
>Last-Modified:  Mon Apr 12 05:21:53 +0000 1999
>Originator:     Izumi Tsutsui
>Release:        NetBSD-current source supped on 19990219
>Organization:
Izumi Tsutsui	Himeji City, Japan
>Environment:
NetBSD devonair 1.3I NetBSD 1.3I (DEVONAIR) #15: Sat Feb 20 23:48:10 JST 1999 \
    tsutsui@devonair:/usr/src/sys/arch/alpha/compile/DEVONAIR alpha

>Description:
On alpha, outputs of top are not sorted by cpu value even though
they can be sorted by res, size and time sort keys.

>How-To-Repeat:
Just type `top -s0' on alpha. Running top does not appear at the top.

>Fix:
Apply attached patch. type of p_pctcpu is u_int32_t,
and type of lresult is pctcpu which is typedef'ed as long.

--- machine/m_netbsd13.c.orig	Mon Feb 15 09:30:26 1999
+++ machine/m_netbsd13.c	Sun Feb 21 03:31:31 1999
@@ -664,7 +664,7 @@
  */

 #define ORDERKEY_PCTCPU \
-    if (lresult = PP(p2, p_pctcpu) - PP(p1, p_pctcpu),\
+    if (lresult = (pctcpu)PP(p2, p_pctcpu) - PP(p1, p_pctcpu),\
 	(result = lresult > 0 ? 1 : lresult < 0 ? -1 : 0) == 0)

 #define ORDERKEY_CPTICKS \

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ross 
State-Changed-When: Sun Apr 11 22:16:24 PDT 1999 
State-Changed-Why:  
Fixed, state change suggested by originator. 
I didn't actually know about this PR and independently developed a 
similar patch .. otherwise I would have given the originator credit. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.