| 1 |
pajs |
1.1 |
page_stat_t *get_page_stats(); |
| 2 |
|
|
page_stat_t *get_page_stats_diff(); |
| 3 |
|
|
|
| 4 |
|
|
typedef struct{ |
| 5 |
|
|
long long pages_pagein; |
| 6 |
|
|
long long pages_pageout; |
| 7 |
|
|
time_t systime; |
| 8 |
|
|
}page_stat_t; |
| 9 |
|
|
|
| 10 |
|
|
pages_pagein is the number of pages swapped into memory |
| 11 |
|
|
pages_pageout is the number of pages swapped from memory to swap |
| 12 |
|
|
|
| 13 |
|
|
get_page_stats() and get_page_stats_diff() both |
| 14 |
|
|
return a pointer to a static buffer of type page_stat_t |
| 15 |
|
|
|
| 16 |
|
|
get_page_stats() will return the number of pages the system |
| 17 |
|
|
has paged in and out since bootup. get_page_stats_diff() |
| 18 |
|
|
will return the difference since last time it was called. |
| 19 |
|
|
If it has not been called before, it will return get_page_stats() |
| 20 |
|
|
|
| 21 |
|
|
BUGS |
| 22 |
|
|
Solaris doesn't seem to report accurately. It reports the number |
| 23 |
|
|
of pages swapped into memory, not necessarily from swap. This |
| 24 |
|
|
feature isn't deamed entirely reliable :) |