add proc_mem.page_faults

This commit is contained in:
Doug MacEachern 2005-11-23 17:51:19 +00:00
parent 530157168d
commit 612c5ca97e
2 changed files with 10 additions and 0 deletions

View File

@ -274,6 +274,7 @@ typedef struct {
char state; char state;
sigar_uint64_t handles; sigar_uint64_t handles;
sigar_uint64_t threads; sigar_uint64_t threads;
sigar_uint64_t page_faults;
} sigar_win32_pinfo_t; } sigar_win32_pinfo_t;
struct sigar_t { struct sigar_t {

View File

@ -27,6 +27,7 @@ typedef enum {
} perf_cpu_offsets_t; } perf_cpu_offsets_t;
#define PERF_TITLE_CPUTIME 6 #define PERF_TITLE_CPUTIME 6
#define PERF_TITLE_PAGE_FAULTS 28
#define PERF_TITLE_MEM_VSIZE 174 #define PERF_TITLE_MEM_VSIZE 174
#define PERF_TITLE_MEM_SIZE 180 #define PERF_TITLE_MEM_SIZE 180
#define PERF_TITLE_MEM_PRIV 186 #define PERF_TITLE_MEM_PRIV 186
@ -39,6 +40,7 @@ typedef enum {
typedef enum { typedef enum {
PERF_IX_CPUTIME, PERF_IX_CPUTIME,
PERF_IX_PAGE_FAULTS,
PERF_IX_MEM_VSIZE, PERF_IX_MEM_VSIZE,
PERF_IX_MEM_SIZE, PERF_IX_MEM_SIZE,
PERF_IX_MEM_PRIV, PERF_IX_MEM_PRIV,
@ -808,6 +810,9 @@ SIGAR_DECLARE(int) sigar_proc_mem_get(sigar_t *sigar, sigar_pid_t pid,
procmem->resident = pinfo->resident; procmem->resident = pinfo->resident;
procmem->share = SIGAR_FIELD_NOTIMPL; procmem->share = SIGAR_FIELD_NOTIMPL;
procmem->rss = pinfo->resident; procmem->rss = pinfo->resident;
procmem->page_faults = pinfo->page_faults;
procmem->minor_faults = SIGAR_FIELD_NOTIMPL;
procmem->major_faults = SIGAR_FIELD_NOTIMPL;
return SIGAR_OK; return SIGAR_OK;
} }
@ -999,6 +1004,9 @@ static int get_proc_info(sigar_t *sigar, sigar_pid_t pid)
case PERF_TITLE_CPUTIME: case PERF_TITLE_CPUTIME:
perf_offsets[PERF_IX_CPUTIME] = offset; perf_offsets[PERF_IX_CPUTIME] = offset;
break; break;
case PERF_TITLE_PAGE_FAULTS:
perf_offsets[PERF_IX_PAGE_FAULTS] = offset;
break;
case PERF_TITLE_MEM_VSIZE: case PERF_TITLE_MEM_VSIZE:
perf_offsets[PERF_IX_MEM_VSIZE] = offset; perf_offsets[PERF_IX_MEM_VSIZE] = offset;
break; break;
@ -1051,6 +1059,7 @@ static int get_proc_info(sigar_t *sigar, sigar_pid_t pid)
pinfo->priority = PERF_VAL(PERF_IX_PRIORITY); pinfo->priority = PERF_VAL(PERF_IX_PRIORITY);
pinfo->handles = PERF_VAL(PERF_IX_HANDLE_CNT); pinfo->handles = PERF_VAL(PERF_IX_HANDLE_CNT);
pinfo->threads = PERF_VAL(PERF_IX_THREAD_CNT); pinfo->threads = PERF_VAL(PERF_IX_THREAD_CNT);
pinfo->page_faults = PERF_VAL(PERF_IX_PAGE_FAULTS);
return SIGAR_OK; return SIGAR_OK;
} }