fix: make perf-self-profile compile on macOS#174
Merged
Conversation
✅ Deploy Preview for dial9-tokio-telemetry canceled.
|
b99ba44 to
6b67704
Compare
rcoh
approved these changes
Apr 9, 2026
Contributor
rcoh
left a comment
There was a problem hiding this comment.
LGTM. Do you mind adding something to the github actions matrix that verifies these changes to make sure we don't regress?
Cfg-gates linux-specific code to allow compilation on non-linux platofrms. Also fixes missing required-features for blocking_pool_tracking example and silences dead code warnings that fired without the cpu-profiling feature enabled.
7ab78eb to
d4dc2bc
Compare
rcoh
approved these changes
Apr 10, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #14
Summary
Makes
dial9-perf-self-profilecompile on platforms other than Linux by re-organizing some of the implementation through splitting between platform specific and platform-agnostic code (and gating the linux-specific).Note: I think that this approach could be a good idea long-term, it prevents lots of individual cfg gates everywhere, this might make it easier to maintain/extend without having to manually add cfgs frequently, and it should make adding support for other platforms later easier. That said it comes at the cost of some bigger diffs now, so I'm happy to switch to a smaller set of changes and more individual gating if that's preferred.
Breakdown
Moves Linux-specific code behind
sys/linux/. On non-Linux,PerfSamplerconstructors returnio::ErrorKind::Unsupportedand everything else is a no-op.Shared types (
Sample,SymbolInfo,SymbolTableEntry, etc.) stay in their original files. The Linux impl. (PerfSampler, ringbuffer,resolve_symbol, offline symbolization) moves intosys/linux/.In case it makes it easier to review, it now looks like this:
While at it, fixed a few things that caused warnings on macOS: the
blocking_pool_trackingexample was missingrequired-features, some items in events.rs/event_writer.rs needed cpu-profiling feature gating, and a couple test files were pulling inmod commonunconditionally but they only use it behind feature gates.