diff options
author | Santo Cariotti <santo@dcariotti.me> | 2023-10-16 22:41:38 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2023-10-16 22:41:38 +0200 |
commit | 1d8941667906dced913a308c9a39fd055ac5186f (patch) | |
tree | b016664c7243eb67014509860385aa6182a0cd78 /src/ui.rs | |
parent | 38e07fae8b3d06cd43b4c9793c07c2048b32d095 (diff) |
Filter sys calls
Diffstat (limited to 'src/ui.rs')
-rw-r--r-- | src/ui.rs | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -76,11 +76,18 @@ impl UI { _ = waitpid(pid, None)?; } + let filters: Vec<&str> = match &args.filter { + Some(filter) => filter.split(",").collect::<Vec<&str>>(), + None => vec![], + }; while !should_quit { if have_to_trace { if let Some(reg) = trace_next(pid)? { have_to_print ^= true; if have_to_print { + if !filters.is_empty() && !filters.contains(®.rax()) { + continue; + } self.add_line(reg); } } else { |