Skip to content

Commit 7f1a5f9

Browse files
authored
Merge pull request #1478 from rust-lang/runtime-linux
Only depend on `perf-event-open` on Linux
2 parents f2132c3 + 52a3fe2 commit 7f1a5f9

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

collector/benchlib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ env_logger = "0.9.0"
1515
clap = { version = "3.2", features = ["derive"] }
1616
libc = "0.2"
1717

18-
[target.'cfg(unix)'.dependencies]
18+
[target.'cfg(target_os = "linux")'.dependencies]
1919
perf-event = "0.4.7"
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#[cfg(unix)]
2-
mod unix;
1+
#[cfg(target_os = "linux")]
2+
mod linux;
33

4-
#[cfg(windows)]
5-
mod windows;
4+
#[cfg(not(target_os = "linux"))]
5+
mod non_linux;
66

7-
#[cfg(unix)]
8-
pub use unix::benchmark_function;
7+
#[cfg(target_os = "linux")]
8+
pub use linux::benchmark_function;
99

10-
#[cfg(windows)]
11-
pub use windows::benchmark_function;
10+
#[cfg(not(target_os = "linux"))]
11+
pub use non_linux::benchmark_function;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::comm::messages::BenchmarkStats;
22

33
pub fn benchmark_function<F: FnOnce() -> R, R>(_func: F) -> anyhow::Result<BenchmarkStats> {
4-
panic!("Runtime benchmarking is not supported on Windows");
4+
panic!("Runtime benchmarking is only supported on Linux");
55
}

0 commit comments

Comments
 (0)