Skip to content

Commit

Permalink
Filter out the ps-command itself
Browse files Browse the repository at this point in the history
  • Loading branch information
raulikak committed May 17, 2024
1 parent 3efb752 commit f1eaebe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tcsfw/shell_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ def process_node(self, node: NetworkNode, data_file: BytesIO, interface: EventIn
cmd = line[columns["CM"]].strip()
if cmd.startswith("[") and cmd.endswith("]"):
continue # kernel thread
cmd_0 = cmd.split()[0]
if cmd_0 == "ps":
continue # ps command itself
if self.load_baseline:
# learning the processes
cmd_0 = cmd.split()[0]
base_ps = os.process_map.setdefault(user, [])
if cmd_0 not in base_ps:
base_ps.append(f"^{cmd_0}")
Expand Down

0 comments on commit f1eaebe

Please sign in to comment.