From 0d0544d1ba503961564c706c456f65056e53a2db Mon Sep 17 00:00:00 2001 From: Antoine Busque Date: Fri, 10 Apr 2015 19:04:21 -0400 Subject: [PATCH] Fix: properly handle empty filters for IO file stats --- lttnganalyses/lttnganalyses/io.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lttnganalyses/lttnganalyses/io.py b/lttnganalyses/lttnganalyses/io.py index 9cf62e0..981524a 100644 --- a/lttnganalyses/lttnganalyses/io.py +++ b/lttnganalyses/lttnganalyses/io.py @@ -65,16 +65,13 @@ class IoAnalysis(Analysis): self.tids[tid].reset() def get_files_stats(self, pid_filter_list, comm_filter_list): - if pid_filter_list is None: - pid_filter_list = [] - if comm_filter_list is None: - comm_filter_list = [] - files_stats = {} for proc_stats in self.tids.values(): - if proc_stats.pid not in pid_filter_list or \ - proc_stats.comm not in comm_filter_list: + if pid_filter_list is not None and \ + proc_stats.pid not in pid_filter_list or \ + comm_filter_list is not None and \ + proc_stats.comm not in comm_filter_list: continue for fd_list in proc_stats.fds.values(): -- 2.34.1