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.
  • Loading branch information
Cody Piersall committed Jul 15, 2023
1 parent fea1c42 commit 38cf06d
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 38cf06d

Please sign in to comment.