Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Jun 1995 01:43:47 +0800 (WST)
From:      Peter Wemm <peter@haywire.DIALix.COM>
To:        ports@FreeBSD.org
Subject:   More 'top' tweaks
Message-ID:  <Pine.SV4.3.91.950607012818.1654A-100000@haywire.DIALix.COM>

next in thread | raw e-mail | index | archive | help
Thanks for fixing top to not show 100% swap in use.. :-)

These are my favourite tweaks to top, which makes it print the amount of 
memory currently in use by disk cached pages.

Linux shows this stat BTW..

I'm a little concerned by the width of the Memory: line  that this causes 
though.  Under heavy swap, the line wraps around.  That's only 
cosmetic..  I'm tempted to delete the label "Memory: " altogether.

Since I'm new here and still finding my feet, I'm not 100% certain this 
is right..  Is this the correct format for something that would go in 
patch-ac?

Cheers,
-Peter
----------- utils/top/patches/patch-ac -------------
*** machine/m_freebsd20.old.c	Tue Jun  6 19:02:56 1995
--- machine/m_freebsd20.c	Tue Jun  6 19:21:58 1995
***************
*** 220,223 ****
  #else
!     "K Act ", "K Inact ", "K Wired ", "K Free ", "% Swap, ",
!     "Kin ", "Kout", 
  #endif
--- 220,223 ----
  #else
!     "K Act ", "K Inact ", "K Wired ", "K Cache ", "K Free ", "% Swap ",
!     "Kin ", "Kout",
  #endif
***************
*** 426,436 ****
  	memory_stats[2] = pagetok(sum.v_wire_count);
! 	memory_stats[3] = pagetok(sum.v_free_count);
  
          if (swappgsin < 0) {
- 	    memory_stats[5] = 0;
  	    memory_stats[6] = 0;
  	} else {
! 	    memory_stats[5] = pagetok(((sum.v_swappgsin - swappgsin)));
! 	    memory_stats[6] = pagetok(((sum.v_swappgsout - swappgsout)));
  	}
          swappgsin = sum.v_swappgsin;
--- 426,438 ----
  	memory_stats[2] = pagetok(sum.v_wire_count);
! 	memory_stats[3] = pagetok(sum.v_cache_count);
! 	memory_stats[4] = pagetok(sum.v_free_count);
  
          if (swappgsin < 0) {
  	    memory_stats[6] = 0;
+ 	    memory_stats[7] = 0;
  	} else {
! 	    memory_stats[6] = pagetok(((sum.v_swappgsin - swappgsin)));
! 	    memory_stats[7] = pagetok(((sum.v_swappgsout - swappgsout)));
  	}
+ 
          swappgsin = sum.v_swappgsin;
***************
*** 439,442 ****
  #ifdef USE_SWAP
!         if ((memory_stats[5] > 0 || memory_stats[6]) > 0 || swap_delay == 0) {
! 	    memory_stats[4] = swapmode();
  	}
--- 441,444 ----
  #ifdef USE_SWAP
!         if ((memory_stats[6] > 0 || memory_stats[7]) > 0 || swap_delay == 0) {
! 	    memory_stats[5] = swapmode();
  	}
***************
*** 444,446 ****
  #else
!         memory_stats[4] = 0;
  #endif
--- 446,448 ----
  #else
!         memory_stats[5] = 0;
  #endif
***************
*** 448,450 ****
  
! 	memory_stats[7] = -1;
      }
--- 450,452 ----
  
! 	memory_stats[8] = -1;
      }




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SV4.3.91.950607012818.1654A-100000>