Skip to content

Commit

Permalink
Merge pull request #388 from mstange/fix-android-reuse-threads
Browse files Browse the repository at this point in the history
Fix process renaming with --reuse-threads.
  • Loading branch information
mstange authored Oct 15, 2024
2 parents 8c486e0 + c06b2b5 commit 8d4648c
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions samply/src/linux_shared/processes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,20 +213,19 @@ where
}

if let Some(process_recycler) = self.process_recycler.as_mut() {
let Some(process_recycling_data) = process_recycler.recycle_by_name(&name)
else {
if let Some(process_recycling_data) = process_recycler.recycle_by_name(&name) {
let (old_recycling_data, old_name) =
process.rename_with_recycling(name, process_recycling_data);
if let Some(old_name) = old_name {
process_recycler.add_to_pool(&old_name, old_recycling_data);
}
return;
};
let (old_recycling_data, old_name) =
process.rename_with_recycling(name, process_recycling_data);
if let Some(old_name) = old_name {
process_recycler.add_to_pool(&old_name, old_recycling_data);
}
} else {
let main_thread_label_frame =
make_thread_label_frame(profile, Some(&name), pid, pid);
process.rename_without_recycling(name, main_thread_label_frame, profile);
}

let main_thread_label_frame =
make_thread_label_frame(profile, Some(&name), pid, pid);
process.rename_without_recycling(name, main_thread_label_frame, profile);
}
}
}
Expand Down

0 comments on commit 8d4648c

Please sign in to comment.