From bad61311be00e3fe4bb00dcfbd35d9829939613a Mon Sep 17 00:00:00 2001 From: Guillaume Chazarain Date: Sun, 20 Apr 2008 02:26:10 +0200 Subject: [PATCH] Filter processes to display before trimming them to avoid removing processes that would be displayed after the trimming. For example, sorting by PID could place I/O active processes at the end, but we don't want to delete them as they would be shown anyway is -o is used. --- iotop/ui.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iotop/ui.py b/iotop/ui.py index 05b3b96..aff8268 100644 --- a/iotop/ui.py +++ b/iotop/ui.py @@ -167,11 +167,12 @@ class IOTopUI(object): return not self.options.only or p.did_some_io() processes = self.process_list.processes.values() + processes = filter(should_format, processes) key = IOTopUI.sorting_keys[self.sorting_key][0] processes.sort(key=key, reverse=self.sorting_reverse) if not self.options.batch: del processes[self.height - 2:] - return [format(p) for p in processes if should_format(p)] + return map(format, processes) def refresh_display(self, total_read, total_write, duration): summary = 'Total DISK READ: %s | Total DISK WRITE: %s' % ( -- 2.11.4.GIT