Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Adds tree view #223

Merged
merged 21 commits into from
Sep 7, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add some comments to taste
  • Loading branch information
ClementTsang committed Sep 4, 2020
commit 94dfafeadc10e3e7d71aae3f60749d2f4196ad00
6 changes: 2 additions & 4 deletions src/data_conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ pub fn tree_process_data(
) -> Vec<ConvertedProcessData> {
// Let's first build up a (really terrible) parent -> child mapping...
// At the same time, let's make a mapping of PID -> process data!
// TODO: ideally... I shouldn't have to do this... this seems kinda... geh.
let mut parent_child_mapping: HashMap<u32, Vec<u32>> = HashMap::default();
let mut pid_process_mapping: HashMap<u32, &ConvertedProcessData> = HashMap::default();

Expand All @@ -480,7 +479,7 @@ pub fn tree_process_data(
if let Some(zero_pid) = parent_child_mapping.get(&0) {
pids_to_explore.extend(zero_pid);
} else {
// FIXME: Remove this, this is for debugging
// FIXME: Remove this, this is for debugging... mainly because idk how the heck windows will behave
debug!("PID 0 had no children during tree building...");
}

Expand All @@ -494,8 +493,7 @@ pub fn tree_process_data(
}

// Now let's "rearrange" our current list of converted process data into the correct
// order required...

// order required... and we're done!
explored_pids
.iter()
.filter_map(|pid| match pid_process_mapping.remove(pid) {
Expand Down