filter out the system Idle process from proc_list
This commit is contained in:
parent
2fa069d068
commit
3945733a4b
|
@ -470,10 +470,15 @@ SIGAR_DECLARE(int) sigar_proc_list_get(sigar_t *sigar,
|
||||||
i++, inst = PdhNextInstance(inst))
|
i++, inst = PdhNextInstance(inst))
|
||||||
{
|
{
|
||||||
PERF_COUNTER_BLOCK *counter_block = PdhGetCounterBlock(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);
|
SIGAR_PROC_LIST_GROW(proclist);
|
||||||
|
|
||||||
proclist->data[proclist->number++] =
|
proclist->data[proclist->number++] = pid;
|
||||||
PERF_VAL(PERF_IX_PID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
|
|
Loading…
Reference in New Issue