-
Notifications
You must be signed in to change notification settings - Fork 18
fix: gate gungraun to linux #456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
2056262
fix: feature gate gungraun
b8caca1
refactoring
eb5766c
Merge branch 'main' into u/psandana/gungraun-detector
psandana e34eb1d
fixing license headers
a0854ce
fix multitude
6f1ab70
fmt
9d77f62
Merge branch 'u/psandana/gungraun-detector' of https://github.com/mic…
8b8be24
benches as main.rs files
c2391ef
Potential fix for pull request finding
psandana 3e90b8a
Potential fix for pull request finding
psandana b793303
fix docs
3289172
Merge branch 'main' into u/psandana/gungraun-detector
psandana 85fff3d
mutants fix
32e39d3
Merge branch 'u/psandana/gungraun-detector' of https://github.com/mic…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| //! Instruction-precise allocation benchmarks for multitude. | ||
| //! | ||
| //! Mirrors `benches/criterion_alloc.rs` 1:1: each gungraun function | ||
| //! `<group>_<variant>` corresponds to a criterion benchmark | ||
| //! `<group>/<variant>`. | ||
| //! | ||
| //! Run with `cargo bench --bench gungraun_alloc` on a Linux host with Valgrind. | ||
|
|
||
| #![allow(missing_docs, reason = "Benchmark")] | ||
| #![allow(unused_results, reason = "black_box of bench input is intentional")] | ||
| #![allow( | ||
| clippy::needless_pass_by_value, | ||
| reason = "gungraun bench inputs are passed by value by the framework" | ||
| )] | ||
| #![allow(clippy::ref_as_ptr, reason = "trivial pointer cast in bench plumbing")] | ||
| #![allow(clippy::too_many_lines, reason = "benchmark file")] | ||
| #![cfg_attr( | ||
| target_os = "linux", | ||
| expect( | ||
| clippy::exit, | ||
| clippy::missing_docs_in_private_items, | ||
| unused_qualifications, | ||
| reason = "Triggered by Gungraun macro expansion. Upstream tracking issues are pending." | ||
| ) | ||
| )] | ||
|
|
||
| // Gungraun requires Valgrind, which is Linux-only. On other platforms this | ||
| // bench target compiles to a no-op so `cargo build --all-targets` still works. | ||
| #[cfg(not(target_os = "linux"))] | ||
| fn main() {} | ||
|
|
||
| #[cfg(target_os = "linux")] | ||
| mod linux; | ||
|
|
||
| #[cfg(target_os = "linux")] | ||
| use linux::*; | ||
|
|
||
| #[cfg(target_os = "linux")] | ||
| gungraun::main!( | ||
| config = gungraun::LibraryBenchmarkConfig::default() | ||
| .tool(gungraun::Callgrind::with_args(["--branch-sim=yes"])); | ||
| library_benchmark_groups = alloc_group | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| //! Instruction-precise drop benchmarks for multitude. | ||
| //! | ||
| //! Mirrors `benches/criterion_drop.rs` 1:1: each gungraun function | ||
| //! `drop_<variant>` corresponds to a criterion benchmark `drop/<variant>`. | ||
| //! Each setup pre-fills an arena with N handles; the bench body drops them | ||
| //! (handle vec + arena), measuring per-handle smart-pointer drop plus chunk | ||
| //! teardown at arena drop. | ||
|
|
||
| #![allow(missing_docs, reason = "Benchmark")] | ||
| #![allow(unused_results, reason = "black_box of bench input is intentional")] | ||
| #![allow(clippy::too_many_lines, reason = "benchmark file")] | ||
| #![cfg_attr( | ||
| target_os = "linux", | ||
| expect( | ||
| clippy::exit, | ||
| clippy::missing_docs_in_private_items, | ||
| unused_qualifications, | ||
| reason = "Triggered by Gungraun macro expansion. Upstream tracking issues are pending." | ||
| ) | ||
| )] | ||
|
|
||
| // Gungraun requires Valgrind, which is Linux-only. On other platforms this | ||
| // bench target compiles to a no-op so `cargo build --all-targets` still works. | ||
| #[cfg(not(target_os = "linux"))] | ||
| fn main() {} | ||
|
|
||
| #[cfg(target_os = "linux")] | ||
| mod linux; | ||
|
|
||
| #[cfg(target_os = "linux")] | ||
| use linux::*; | ||
|
|
||
| #[cfg(target_os = "linux")] | ||
| gungraun::main!( | ||
| config = gungraun::LibraryBenchmarkConfig::default() | ||
| .tool(gungraun::Callgrind::with_args(["--branch-sim=yes"])); | ||
| library_benchmark_groups = drop_group | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # Licensed under the MIT License. | ||
|
|
||
| # Installs the Callgrind benchmark toolchain (gungraun-runner). Linux-only: | ||
| # Callgrind requires Valgrind, which is Linux-only. The runner is the helper | ||
| # binary that Callgrind bench binaries (built with `harness = false`) hand | ||
| # their work off to via an encoded payload. | ||
| # | ||
| # Keep the version in lockstep with the `gungraun` workspace dep in | ||
| # Cargo.toml and the constants.env file. | ||
| # `gungraun-runner` enforces strict string equality on the version | ||
| # (`gungraun-runner::runner::compare_versions`), so any patch-level drift | ||
| # between the library and the runner causes `*_cg` benches to fail at runtime | ||
| # with VersionMismatch. | ||
|
|
||
| $ErrorActionPreference = "Stop" | ||
| $PSNativeCommandUseErrorActionPreference = $true | ||
|
|
||
| if (-not $IsLinux) { | ||
| Write-Host "Callgrind toolchain is Linux-only; skipping." | ||
| return | ||
| } | ||
|
|
||
|
psandana marked this conversation as resolved.
|
||
| cargo install --locked gungraun-runner --version $env:GUNGRAUN_RUNNER_VERSION | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.