Skip to content

Commit

Permalink
Add thread name to output when using record subcommand with thread_id…
Browse files Browse the repository at this point in the history
… option. (#599)

Co-authored-by: Cody Piersall <[email protected]>
Co-authored-by: Ben Frederickson <[email protected]>
  • Loading branch information
3 people authored Jul 31, 2023
1 parent b1cbca1 commit af29a0e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,13 @@ fn record_samples(pid: remoteprocess::Pid, config: &Config) -> Result<(), Error>

if config.include_thread_ids {
let threadid = trace.format_threadid();
let thread_fmt = if let Some(thread_name) = &trace.thread_name {
format!("thread ({}): {}", threadid, thread_name)
} else {
format!("thread ({})", threadid)
};
trace.frames.push(Frame {
name: format!("thread ({})", threadid),
name: thread_fmt,
filename: String::from(""),
module: None,
short_filename: None,
Expand Down

0 comments on commit af29a0e

Please sign in to comment.