45 |
|
#include <sys/param.h> |
46 |
|
#include <uvm/uvm.h> |
47 |
|
#endif |
48 |
+ |
#ifdef AIX |
49 |
+ |
#include <libperfstat.h> |
50 |
+ |
#endif |
51 |
+ |
#ifdef HPUX |
52 |
+ |
#include <sys/pstat.h> |
53 |
+ |
#endif |
54 |
|
#ifdef WIN32 |
55 |
|
#include "win32.h" |
56 |
|
#endif |
76 |
|
#if defined(NETBSD) || defined(OPENBSD) |
77 |
|
struct uvmexp *uvm; |
78 |
|
#endif |
79 |
+ |
#ifdef AIX |
80 |
+ |
perfstat_memory_total_t mem; |
81 |
+ |
#endif |
82 |
+ |
#ifdef HPUX |
83 |
+ |
struct pst_vminfo vminfo; |
84 |
+ |
#endif |
85 |
|
|
86 |
|
page_stats.systime = time(NULL); |
87 |
|
page_stats.pages_pagein=0; |
161 |
|
|
162 |
|
page_stats.pages_pagein = uvm->pgswapin; |
163 |
|
page_stats.pages_pageout = uvm->pgswapout; |
164 |
+ |
#endif |
165 |
+ |
#ifdef AIX |
166 |
+ |
/* return code is number of structures returned */ |
167 |
+ |
if(perfstat_memory_total(NULL, &mem, sizeof(perfstat_memory_total_t), 1) != 1) { |
168 |
+ |
sg_set_error_with_errno(SG_ERROR_SYSCTLBYNAME, "perfstat_memory_total"); |
169 |
+ |
return NULL; |
170 |
+ |
} |
171 |
+ |
|
172 |
+ |
page_stats.pages_pagein = mem.pgins; |
173 |
+ |
page_stats.pages_pageout = mem.pgouts; |
174 |
+ |
#endif |
175 |
+ |
#ifdef HPUX |
176 |
+ |
if( pstat_getvminfo( &vminfo, sizeof(vminfo), 1, 0 ) == -1 ) { |
177 |
+ |
sg_set_error_with_errno(SG_ERROR_SYSCTLBYNAME, "pstat_getswap"); |
178 |
+ |
return NULL; |
179 |
+ |
}; |
180 |
+ |
|
181 |
+ |
page_stats.pages_pagein = vminfo.psv_spgin; |
182 |
+ |
page_stats.pages_pageout = vminfo.psv_spgout; |
183 |
|
#endif |
184 |
|
#ifdef WIN32 |
185 |
|
sg_set_error(SG_ERROR_UNSUPPORTED, "Win32"); |