Skip to content

Commit

Permalink
Suppress output of perf --help during discovery
Browse files Browse the repository at this point in the history
Without this the output is printed to stderr, where it's just confusing.

We already do this for dtrace.
  • Loading branch information
bobrik authored and djc committed Dec 19, 2024
1 parent ac48bec commit e53170f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ mod arch {
let perf = if let Ok(path) = env::var("PERF") {
path
} else {
if Command::new("perf").arg("--help").status().is_err() {
if Command::new("perf")
.arg("--help")
.stderr(Stdio::null())
.stdout(Stdio::null())
.status()
.is_err()
{
eprintln!("perf is not installed or not present in $PATH");
exit(1);
}
Expand Down

0 comments on commit e53170f

Please sign in to comment.