From 3945733a4b12fc93f7f500a9db4cdcc1eaf3d293 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 28 Jul 2004 21:50:06 +0000 Subject: [PATCH] filter out the system Idle process from proc_list --- src/os/win32/win32_sigar.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/os/win32/win32_sigar.c b/src/os/win32/win32_sigar.c index 41944cd3..d300b87d 100644 --- a/src/os/win32/win32_sigar.c +++ b/src/os/win32/win32_sigar.c @@ -470,10 +470,15 @@ SIGAR_DECLARE(int) sigar_proc_list_get(sigar_t *sigar, i++, inst = PdhNextInstance(inst)) { PERF_COUNTER_BLOCK *counter_block = PdhGetCounterBlock(inst); + DWORD pid = PERF_VAL(PERF_IX_PID); + + if (pid == 0) { + continue; /* dont include the system Idle process */ + } + SIGAR_PROC_LIST_GROW(proclist); - proclist->data[proclist->number++] = - PERF_VAL(PERF_IX_PID); + proclist->data[proclist->number++] = pid; } return SIGAR_OK;