--- projects/libstatgrab/docs/page_stat.txt 2003/08/24 21:43:24 1.1 +++ projects/libstatgrab/docs/page_stat.txt 2003/08/24 21:59:09 1.2 @@ -1,24 +1,42 @@ -page_stat_t *get_page_stats(); -page_stat_t *get_page_stats_diff(); +Page Statistics +=============== +$Id: page_stat.txt,v 1.2 2003/08/24 21:59:09 tdb Exp $ + +Data Structure +-------------- + typedef struct{ long long pages_pagein; long long pages_pageout; time_t systime; }page_stat_t; -pages_pagein is the number of pages swapped into memory -pages_pageout is the number of pages swapped from memory to swap +pages_pagein is the number of pages swapped in to memory +pages_pageout is the number of pages swapped out of memory (to swap) -get_page_stats() and get_page_stats_diff() both -return a pointer to a static buffer of type page_stat_t +Functions +--------- -get_page_stats() will return the number of pages the system -has paged in and out since bootup. get_page_stats_diff() -will return the difference since last time it was called. -If it has not been called before, it will return get_page_stats() +page_stat_t *get_page_stats(); +page_stat_t *get_page_stats_diff(); -BUGS +get_page_stats() and get_page_stats_diff() both return a pointer +to a static buffer of type page_stat_t. + +get_page_stats() will return the number of pages the system has +paged in and out since bootup. get_page_stats_diff() will return +the difference since last time it was called. If it has not been +called before, it will return get_page_stats(). + +Bugs +---- + Solaris doesn't seem to report accurately. It reports the number -of pages swapped into memory, not necessarily from swap. This -feature isn't deamed entirely reliable :) +of pages swapped into memory, not necessarily from swap. This feature +isn't deemed entirely reliable :) + +Example +------- + +An example can be found in examples/page_stats.c