Rename filt to filter_func (because we value clarity over brevity) and another small fix.

This commit is contained in:
Mike Auty
2018-12-19 22:46:33 +00:00
parent 70e8204113
commit 189c8786f1
8 changed files with 21 additions and 19 deletions
+5 -4
View File
@@ -79,20 +79,21 @@ class Bash(plugins.PluginInterface, timeliner.TimeLinerInterface):
yield (0, (task.pid, task_name, hist.get_time_object(), hist.get_command()))
def run(self):
filt = pslist.PsList.create_filter([self.config.get('pid', None)])
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
plugin = pslist.PsList.list_tasks
return renderers.TreeGrid(
[("PID", int), ("Process", str), ("CommandTime", datetime.datetime), ("Command", str)],
self._generator(plugin(self.context, self.config['primary'], self.config['vmlinux'], filter = filt)))
self._generator(plugin(self.context, self.config['primary'], self.config['vmlinux'], filter = filter_func)))
def generate_timeline(self):
filt = pslist.PsList.create_filter([self.config.get('pid', None)])
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
plugin = pslist.PsList.list_tasks
for row in self._generator(plugin(self.context, self.config['primary'], self.config['vmlinux'], filter = filt)):
for row in self._generator(
plugin(self.context, self.config['primary'], self.config['vmlinux'], filter = filter_func)):
_depth, row_data = row
description = "{} ({}): \"{}\"".format(row_data[0], row_data[1], row_data[3])
yield (description, timeliner.TimeLinerType.CREATED, row_data[2])