From ab82fb3689bcec835cd9ab925dbed795b2b84241 Mon Sep 17 00:00:00 2001 From: Guillaume Chazarain Date: Wed, 10 Jun 2009 16:08:40 +0200 Subject: [PATCH] Fixed interaction between --accumulated and --only --- NEWS | 1 + iotop/data.py | 4 +++- iotop/ui.py | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 5d0a64c..9a9c77a 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ 0.3.1 ~~~~~ o Fixed the ioprio syscall detection when running on i386/x86_64 +o Fixed interaction between --accumulated and --only 0.3 ~~~ diff --git a/iotop/data.py b/iotop/data.py index 2456129..dc98bd2 100644 --- a/iotop/data.py +++ b/iotop/data.py @@ -261,7 +261,9 @@ class ProcessInfo(DumpableObject): cmdline = ' '.join(parts).strip() return safe_utf8_decode(cmdline) - def did_some_io(self): + def did_some_io(self, accumulated): + if accumulated: + return not self.stats_accum.is_all_zero() return not all(t.stats_delta.is_all_zero() for t in self.threads.itervalues()) diff --git a/iotop/ui.py b/iotop/ui.py index e7f3cdd..80847f1 100644 --- a/iotop/ui.py +++ b/iotop/ui.py @@ -198,7 +198,8 @@ class IOTopUI(object): return line def should_format(p): - return not self.options.only or p.did_some_io() + return not self.options.only or \ + p.did_some_io(self.options.accumulated) processes = filter(should_format, self.process_list.processes.values()) key = IOTopUI.sorting_keys[self.sorting_key][0] -- 2.11.4.GIT