Re: problem with top

From: John Baldwin <jhb_at_freebsd.org>
Date: Mon, 2 Jul 2012 10:50:59 -0400
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_at_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)
_at__at_ -263,6 +263,7 _at__at_ update_layout(void)
 {
 
 	y_mem = 3;
+	y_arc = 4;
 	y_swap = 4 + arc_enabled;
 	y_idlecursor = 5 + arc_enabled;
 	y_message = 5 + arc_enabled;
_at__at_ -271,7 +272,8 _at__at_ 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
Received on Mon Jul 02 2012 - 13:04:38 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:28 UTC