Apple Silicon PMU Holes: Counter Tool Exposes Documentation Gap
A new open-source tool documents Apple Silicon's PMU counters, exposing a critical documentation gap that hurts Linux-on-Mac developers and profiling tool maintainers. This article explains what changed, who benefits, and what Apple must do next.
- Bugsiki published a reverse-engineered PMU counter list and a companion Python tool for Apple Silicon (M1, M2, M3 series).
- The tool exposes counters like cycle count, instruction count, and cache misses, but many counters remain undocumented or unstable across chip generations.
- This matters because Apple's official documentation for PMU counters is near-nonexistent, forcing developers to rely on fragile reverse-engineering efforts.
- The key tension: Apple gains performance secrecy but loses developer trust and Linux ecosystem compatibility.
What Did Bugsiki Actually Reverse-Engineer?
According to the blog post published on January 7, 2026, bugsiki (a pseudonymous developer) documented over 60 PMU counters across Apple's M1, M2, and M3 families. The tool, available on GitHub, reads the PMU via the sysctl interface on macOS and via the perf_event_open syscall on Linux-asahi. The counters include standard ones like INST_RETIRED and CPU_CYCLES, but also Apple-specific counters like L1D_CACHE_MISS and BRANCH_MISPREDICT. Bugsiki reported that counter availability varies significantly between M1 and M3, and some counters crash the system on certain firmware versions.
This is not an official Apple document. This is a developer's best effort to decode a black box. The post explicitly warns that counter IDs changed between M1 and M3 without notice, and Apple has never published an official PMU specification for any Apple Silicon chip. The tool works, but it's a fragile workaround, not a stable API.
Why Does Apple Keep PMU Counters Hidden?
Apple has never explained its PMU documentation policy, but the evidence points to a deliberate strategy of hardware secrecy. On Intel Macs, Apple provided standard x86 PMU counters via the perf subsystem. On Apple Silicon, the PMU is a custom Apple design, and Apple has not released any public register-level documentation. Bugsiki noted that even the counter definitions change between chip generations without any public changelog. This forces developers to either reverse-engineer each new chip or rely on Apple's Instruments app, which exposes only a fraction of the available counters.
According to the Asahi Linux project, which has been reverse-engineering Apple Silicon since 2021, the PMU is one of the most opaque components. Asahi Linux lead developer Hector Martin previously stated that Apple's PMU is "reverse-engineering hell" because counters are not only undocumented but also behave differently depending on which CPU cluster (E-core vs P-core) they are read from. The bugsiki tool confirms this: counters that work on M1's Icestorm cores may crash on M3's E-cores.
This is not an accident. Apple likely keeps PMU counters hidden to prevent competitors from benchmarking their chips at a granular level, and to avoid supporting a stable performance counter ABI across OS updates. The cost is borne entirely by developers.
Who Benefits From This Tool?
Three groups benefit immediately. First, Linux-on-Apple-Silicon users: the Asahi Linux kernel can now expose a richer set of perf events, enabling better profiling for scientific computing, game emulation, and server workloads on Apple hardware. Second, profiling tool authors: projects like perf, FlameGraph, and Valgrind can integrate the counter definitions to provide meaningful output on Apple Silicon. Third, compiler and optimization engineers: understanding cache miss rates and branch misprediction ratios on Apple Silicon can guide code generation improvements in LLVM and GCC.
However, the tool has clear limitations. It requires macOS or Linux-asahi, and it depends on bugsiki's reverse-engineering being accurate for a given firmware version. According to Hacker News commenters on the same thread, some counters produce nonsensical values on M3 Pro chips, suggesting that bugsiki's mapping is incomplete. The tool is a starting point, not a finished product.
What Are the Operational Tradeoffs for Developers?
If you adopt this tool for production profiling, you trade convenience for fragility. The counters may change with any macOS or firmware update, and Apple could patch the sysctl interface to block access entirely. The tool does not support M4 chips (if they exist by the time you read this), and it may never support them unless bugsiki or another developer reverse-engineers them.
On the other hand, ignoring the tool means you continue profiling Apple Silicon with Instruments, which exposes only a curated subset of counters and cannot be scripted or integrated into CI pipelines. The tradeoff is between a stable but limited official tool and an unstable but powerful open-source one.
For teams running Linux on Apple Silicon for server workloads (e.g., AWS Mac instances), this tool is essential. For macOS application developers, the value depends on whether you need microarchitectural counters beyond what Instruments provides. Most app developers do not; kernel and compiler developers absolutely do.
| Dimension | Apple Instruments | Bugsiki PMU Tool |
|---|---|---|
| Counter coverage | ~20 counters, curated | 60+ counters, reverse-engineered |
| Platform support | macOS only | macOS + Linux-asahi |
| Stability | Stable across OS updates | Fragile; may break on firmware update |
| Scriptability | Limited (DTrace, Instruments CLI) | Full (Python API, perf_event) |
| CI/CD integration | Difficult | Straightforward |
| Verdict | Safe for production profiling | Powerful but risky; best for research and Linux |
My thesis is simple: Apple's PMU secrecy is a strategic mistake that costs them developer trust and ecosystem growth, and this tool is both a symptom and a partial cure. In the short term, bugsiki's work is a lifeline for the Asahi Linux project and for any developer who needs to understand Apple Silicon's performance characteristics at a granular level. In the long term, however, Apple's refusal to document PMU counters will push more performance-sensitive workloads away from macOS and toward Linux or Windows on Arm. The winners here are the open-source community and Asahi Linux; the losers are Apple's developer relations team and any engineer who has to maintain a profiling tool that depends on reverse-engineered counter mappings. I predict that within 18 months, Apple will either quietly release an official PMU documentation PDF or the Asahi Linux project will surpass Apple's own profiling tools in counter coverage and reliability.
- Apple will release an official PMU documentation PDF for Apple Silicon by mid-2027 β the pressure from Asahi Linux and enterprise Mac deployments will force Apple's hand, but the documentation will cover only a subset of counters and will not include register-level details.
- Asahi Linux will integrate bugsiki's counter definitions into the mainline Linux kernel by Q3 2026 β making Apple Silicon the best-documented Arm platform for Linux performance analysis, ironically surpassing Apple's own macOS support.
- At least one major profiling tool (perf, Valgrind, or LLVM's BOLT) will add Apple Silicon support based on this tool by the end of 2026 β enabling performance engineers to finally treat Apple Silicon as a first-class target for low-level optimization.
- 2021Asahi Linux begins reverse-engineering Apple Silicon
Asahi Linux project starts, identifies PMU as a major undocumented component.
- 2023Apple releases M3 with undocumented PMU changes
Apple ships M3 with altered PMU counters, breaking existing reverse-engineering efforts.
- January 2026Bugsiki publishes PMU counter list and tool
Developer bugsiki releases detailed article and Python tool documenting Apple Silicon PMU counters.
- Mid-2027 (predicted)Apple releases official PMU documentation
Predicted: Apple publishes official PMU documentation under developer pressure.
- 2021: Asahi Linux project begins reverse-engineering Apple Silicon; PMU identified as a major gap.
- 2023: Apple releases M3 with undocumented PMU counter changes; existing reverse-engineering efforts break.
- January 2026: Bugsiki publishes PMU counter list and tool; Hacker News discussion reveals widespread developer frustration.
- Mid-2027 (predicted): Apple releases official PMU documentation.
PMU Counter Coverage: Apple Instruments vs. Bugsiki Tool (estimated)
Article Summary:
- Apple Silicon's PMU counters are now partially documented and toolable, but the tool is fragile and depends on reverse-engineering that may break with any OS update.
- Developers who need microarchitectural counters for Linux-on-Apple-Silicon or for compiler optimization should adopt this tool now; macOS app developers can safely wait for official Apple documentation.
- Apple's PMU secrecy is a strategic liability that benefits the open-source community at Apple's expense; the company will likely be forced to release official documentation within 18 months.
- The Asahi Linux project is now the de facto leader in Apple Silicon performance analysis, surpassing Apple's own tools in counter coverage and transparency.
- Ignoring this tool means accepting the status quo of Apple's curated, limited Instruments; adopting it means accepting fragility in exchange for power.
Source and attribution
Hacker News
CPU Counters on Apple Silicon: article + tool
Discussion
Add a comment