From dbee7fb775e763edd247380fbb8fcecc66df1fc6 Mon Sep 17 00:00:00 2001 From: Nicolargo Date: Mon, 9 May 2016 16:15:56 +0200 Subject: [PATCH] Idle process is back on FreeBSD and Windows (issue #844) --- glances/processes.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/glances/processes.py b/glances/processes.py index 93ba0b71..7d9f27c3 100644 --- a/glances/processes.py +++ b/glances/processes.py @@ -406,24 +406,25 @@ class GlancesProcesses(object): if self.no_kernel_threads and not WINDOWS and is_kernel_thread(proc): continue - # If self.max_processes is None: Only retreive mandatory stats - # Else: retreive mandatory and standard stats + # If self.max_processes is None: Only retrieve mandatory stats + # Else: retrieve mandatory and standard stats s = self.__get_process_stats(proc, mandatory_stats=True, standard_stats=self.max_processes is None) + # ignore the 'idle' process on Windows and *BSD + # ignore the 'kernel_task' process on OS X + # waiting for upstream patch from psutil + if (BSD and s['name'] == 'idle' or + WINDOWS and s['name'] == 'System Idle Process' or + OSX and s['name'] == 'kernel_task'): + continue # Continue to the next process if it has to be filtered if s is None or (self.is_filtered(s['cmdline']) and self.is_filtered(s['name'])): excluded_processes.add(proc) continue + # Ok add the process to the list processdict[proc] = s - # ignore the 'idle' process on Windows and *BSD - # ignore the 'kernel_task' process on OS X - # waiting for upstream patch from psutil - if (BSD and processdict[proc]['name'] == 'idle' or - WINDOWS and processdict[proc]['name'] == 'System Idle Process' or - OSX and processdict[proc]['name'] == 'kernel_task'): - continue # Update processcount (global statistics) try: self.processcount[str(proc.status())] += 1