Kool release.... I think the next could be McGWKR ie. Son of GWKR
Have got a patch for the *new* cache field in /proc/meminfo.
It kills both "top" and "ps" which is to be expected...
Here is a patch that got me going.....
Cheers. Hope this helps.
------------------------------->8-------------------------------------
diff -uNr procps-0.97-orig/ps.c procps-0.97/ps.c
--- procps-0.97-orig/ps.c Mon Sep 26 04:46:20 1994
+++ procps-0.97/ps.c Wed Jan 3 23:31:01 1996
@@ -659,6 +659,6 @@
}
read(fd,memory,299);
close(fd);
- sscanf(memory, "%*s %*s %*s %*s %*s %*s %u", &GL_main_mem);
+ sscanf(memory, "%*s %*s %*s %*s %*s %*s %*s %u", &GL_main_mem);
GL_time_now = time(0L);
}
+#include <linux/sched.h>
diff -uNr procps-0.97-orig/top.c procps-0.97/top.c
--- procps-0.97-orig/top.c Mon Sep 26 04:46:22 1994
+++ procps-0.97/top.c Wed Jan 3 23:41:12 1996
@@ -601,7 +601,7 @@
{
char memory[1024];
static int fd;
- unsigned int main_mem, used_mem, free_mem, shared_mem, buf_mem;
+ unsigned int main_mem, used_mem, free_mem, shared_mem, buf_mem,
cache_mem;
unsigned int swap_mem, used_swap, free_swap;
fd = open("/proc/meminfo", O_RDONLY, 0);
@@ -611,12 +611,12 @@
}
read(fd, memory, sizeof(memory) - 1);
close(fd);
- sscanf(memory, "%*s %*s %*s %*s %*s %*s %u %u %u %u %u %*s %u %u %u",
- &main_mem, &used_mem, &free_mem, &shared_mem, &buf_mem,
+ sscanf(memory, "%*s %*s %*s %*s %*s %*s %*s %u %u %u %u %u %u %*s %u
%u %u",
+ &main_mem, &used_mem, &free_mem, &shared_mem, &buf_mem,
&cache_mem,
&swap_mem, &used_swap, &free_swap);
- printf("Mem: %5dK av, %5dK used, %5dK free, %5dK shrd, %5dK
buff%s\n",
+ printf("Mem: %5dK av, %5dK used, %5dK free, %5dK shrd, %5dK buff,
%5dK cache,%s\n",
main_mem / 1024, used_mem / 1024, free_mem / 1024,
- shared_mem / 1024, buf_mem / 1024, clrtoeol);
+ shared_mem / 1024, buf_mem / 1024, cache_mem / 1024, clrtoeol);
printf("Swap: %5dK av, %5dK used, %5dK free%s\n%s\n",
swap_mem / 1024, used_swap / 1024, free_swap / 1024,
clrtoeol, clrtoeol);
------------------------------->8-------------------------------------
--
Shane Watts ( Unix Network Admin ) http://www.mlckew.edu.au/~shane/
----------------------------------------------------------------------
"Oh dear, I think you'll find reality's on the blink again."
-- Marvin The Paranoid Android
----------------------------------------------------------------------