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.22 by ats, Sun Jul 18 21:30:11 2004 UTC vs.
Revision 1.23 by tdb, Sat Sep 24 13:29:22 2005 UTC

# Line 45 | Line 45
45   #include <sys/param.h>
46   #include <uvm/uvm.h>
47   #endif
48 + #ifdef WIN32
49 + #include "win32.h"
50 + #endif
51  
52   static sg_page_stats page_stats;
53 + #ifndef WIN32
54   static int page_stats_uninit=1;
55 + #endif
56  
57   sg_page_stats *sg_get_page_stats(){
58   #ifdef SOLARIS
# Line 145 | Line 150 | sg_page_stats *sg_get_page_stats(){
150          page_stats.pages_pagein = uvm->pgswapin;
151          page_stats.pages_pageout = uvm->pgswapout;
152   #endif
153 + #ifdef WIN32
154 +        sg_set_error(SG_ERROR_UNSUPPORTED, "Win32");
155 +        return NULL;
156 + #endif
157  
158          return &page_stats;
159   }
160  
161   sg_page_stats *sg_get_page_stats_diff(){
153        sg_page_stats *page_ptr;
162          static sg_page_stats page_stats_diff;
163 + #ifndef WIN32
164 +        sg_page_stats *page_ptr;
165  
166          if(page_stats_uninit){
167                  page_ptr=sg_get_page_stats();
# Line 174 | Line 184 | sg_page_stats *sg_get_page_stats_diff(){
184          page_stats_diff.pages_pagein=page_stats.pages_pagein-page_stats_diff.pages_pagein;
185          page_stats_diff.pages_pageout=page_stats.pages_pageout-page_stats_diff.pages_pageout;
186          page_stats_diff.systime=page_stats.systime-page_stats_diff.systime;
187 <        
187 >
188 > #else /* WIN32 */
189 >        if(read_counter_large(SG_WIN32_PAGEIN, &page_stats_diff.pages_pagein)) {
190 >                sg_set_error(SG_ERROR_PDHREAD, PDH_PAGEIN);
191 >                return NULL;
192 >        }
193 >        if(read_counter_large(SG_WIN32_PAGEOUT, &page_stats_diff.pages_pageout)) {
194 >                sg_set_error(SG_ERROR_PDHREAD, PDH_PAGEIN);
195 >                return NULL;
196 >        }
197 >        page_stats_diff.systime = 0;
198 > #endif /* WIN32 */
199 >
200          return &page_stats_diff;
201   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines