Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jul 2012 10:50:59 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-current@freebsd.org
Cc:        Erich Dollansky <erichfreebsdlist@ovitrap.com>, AN <andy@neu.net>
Subject:   Re: problem with top
Message-ID:  <201207021050.59694.jhb@freebsd.org>
In-Reply-To: <201207010654.58777.erichfreebsdlist@ovitrap.com>
References:  <alpine.BSF.2.00.1206301944150.89948@mail.neu.net> <201207010654.58777.erichfreebsdlist@ovitrap.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday, June 30, 2012 7:54:58 pm Erich Dollansky wrote:
> Hi,
> 
> On Sunday, July 01, 2012 06:51:41 AM AN wrote:
> > FreeBSD FBSD10 10.0-CURRENT FreeBSD 10.0-CURRENT #23 r237852: Sat Jun 30 
> > 18:45:27 EDT 2012     root@FBSD10:/usr/obj/usr/src/sys/MYKERNEL  amd64
> > 
> > After a recent upgrade, I am seeing a formatting issue with top.
> > 
> > top -SPH -s 1:
> > 
> > last pid: 26011;  load averages:  3.61,  2.80,  1.56                 up 
> > 0+00:23:30  19:48:46
> > 268 processes: 6 running, 245 sleeping, 17 waiting
> > CPU 0: 22.0% user,  0.0% nice,  0.8% system,  0.8% interrupt, 76.4% idle
> > CPU 16877.6ctive, 2313M Inact,  6.3M Wired, 3 0.8 Cache, 1440M65.4, 7674M 
> > Free
> > CPU 2: 28.3% user,  0.0% nice,  2.4% system,  0.0% interrupt, 69.3% idle
> > CPU 3: 36.2% user,  0.0% nice,  1.6% system,  0.0% interrupt, 62.2% idle
> > Mem: 455M Active, 2302M Inact, 3151M Wired, 3900K Cache, 1440M Buf, 7943M 
> > Free
> > Swap: 20G Total, 20G Free
> > 
> > 
> > Seems like the entry for CPU 1 is wrong.
> 
> I also noticed this but thought it is of temporary nature. The data of CPU 1 
is getting overwritten by the data of the memory usage.

Ah, I think I have found the bug for this, can you try this change:

Index: usr.bin/top/machine.c
===================================================================
--- machine.c	(revision 225593)
+++ machine.c	(working copy)
@@ -263,6 +263,7 @@ update_layout(void)
 {
 
 	y_mem = 3;
+	y_arc = 4;
 	y_swap = 4 + arc_enabled;
 	y_idlecursor = 5 + arc_enabled;
 	y_message = 5 + arc_enabled;
@@ -271,7 +272,8 @@ update_layout(void)
 	Header_lines = 7 + arc_enabled;
 
 	if (pcpu_stats) {
-		y_mem = ncpus - 1;
+		y_mem += ncpus - 1;
+		y_arc += ncpus - 1;
 		y_swap += ncpus - 1;
 		y_idlecursor += ncpus - 1;
 		y_message += ncpus - 1;


-- 
John Baldwin



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