Skip to content

Commit

Permalink
Remove auto-open on Mac
Browse files Browse the repository at this point in the history
The theory is that the operator of the program can chain `open output.svg` after the py-spy command.
  • Loading branch information
akx committed Jan 3, 2022
1 parent 4417b18 commit f12ac85
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,7 @@ fn record_samples(pid: remoteprocess::Pid, config: &Config) -> Result<(), Error>

match config.format.as_ref().unwrap() {
FileFormat::flamegraph => {
println!("{}Wrote flamegraph data to '{}'. Samples: {} Errors: {}", lede, filename, samples, errors);
// open generated flame graph in the browser on OSX (theory being that on linux
// you might be SSH'ed into a server somewhere and this isn't desired, but on
// that is pretty unlikely for osx) (note to self: xdg-open will open on linux)
#[cfg(target_os = "macos")]
std::process::Command::new("open").arg(&filename).spawn()?;
println!("{}Wrote flamegraph SVG to '{}'. Samples: {} Errors: {}", lede, filename, samples, errors);
},
FileFormat::speedscope => {
println!("{}Wrote speedscope file to '{}'. Samples: {} Errors: {}", lede, filename, samples, errors);
Expand Down

0 comments on commit f12ac85

Please sign in to comment.