Skip to content

Commit 9d22298

Browse files
authored
Merge pull request #2471 from djc/crabgrind-linux
collector: scope precise_crabgrind feature to Linux
2 parents 670e08c + 0119868 commit 9d22298

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

collector/benchlib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ serde_json = { workspace = true }
1616

1717
libc = "0.2"
1818
flate2 = { version = "1", optional = true }
19-
crabgrind = { version = "0.1.10", optional = true }
2019

2120
[target.'cfg(target_os = "linux")'.dependencies]
21+
crabgrind = { version = "0.1.10", optional = true }
2222
perf-event = "0.4.9"
2323

2424
[features]

collector/benchlib/src/profile.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ pub fn profile_function<F: Fn() -> Bench, R, Bench: FnOnce() -> R>(benchmark_con
33

44
// With the `precise-cachegrind` feature, we want to enable cachegrind recording
55
// only for the actual execution of the profiled function.
6-
#[cfg(feature = "precise-cachegrind")]
6+
#[cfg(all(target_os = "linux", feature = "precise-cachegrind"))]
77
{
88
crabgrind::cachegrind::start_instrumentation();
99
}
1010

1111
func();
1212

13-
#[cfg(feature = "precise-cachegrind")]
13+
#[cfg(all(target_os = "linux", feature = "precise-cachegrind"))]
1414
{
1515
crabgrind::cachegrind::stop_instrumentation();
1616
}

0 commit comments

Comments
 (0)