ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/page_stats.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/page_stats.c (file contents):
Revision 1.23 by tdb, Sat Sep 24 13:29:22 2005 UTC vs.
Revision 1.24 by tdb, Sun Oct 3 18:35:58 2010 UTC

# Line 45 | Line 45
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
# Line 70 | Line 76 | sg_page_stats *sg_get_page_stats(){
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;
# Line 149 | Line 161 | sg_page_stats *sg_get_page_stats(){
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");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines