Hardware Counters

Hardware performance counter skill for low-level CPU analysis. Use when collecting PMU events with perf stat, using the PAPI library, measuring cache miss rates and branch misprediction ratios, computing IPC, or correlating PMU events to source lines. Activates on queries about hardware counters, PMU events, perf stat -e, PAPI, cache miss rate, branch misprediction, IPC measurement, or CPU performance events.

293 stars 36 forksGit & Code Review

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add mohitmishra786/low-level-dev-skills --skill hardware-counters
Manual install
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git /tmp/low-level-dev-skills
mkdir -p ~/.claude/skills
cp -r /tmp/low-level-dev-skills/skills/profilers/hardware-counters ~/.claude/skills/hardware-counters

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Hardware Performance Counters

## Purpose

Guide agents through hardware performance counter analysis: collecting PMU events with `perf stat -e`, using the PAPI library for portable counter access, interpreting cache miss rates and branch misprediction ratios, computing IPC, and correlating events to source lines with `perf annotate`.

## Triggers

- "How do I measure cache miss rate with perf?"
- "How do I count branch mispredictions?"
- "How do I compute IPC (instructions per clock) with perf?"
- "How do I use the PAPI library for hardware counters?"
- "How do I see which source lines cause the most cache misses?"
- "How do I measure memory bandwidth with performance counters?"

## Workflow

### 1. perf stat — basic counter collection

```bash
# Basic hardware event summary
perf stat ./prog

# Output:
#  Performance counter stats for './prog':
#
#      1,234,567,890      instructions
#        456,789,012      cycles
#         12,345,678      cache-misses         #    1.23 % of all cache refs
#         23,456,789      branch-misses        #    2.34 % of all branches
#
#       0.456789012 seconds time elapsed

# Derived metrics (computed from the output)
# IPC = instructions / cycles = 1,234,567,890 / 456,789,012 ≈ 2.70
# CPI = cycles / instructions ≈ 0.37
```

### 2. Specifying PMU events with -e
Read the full skill on GitHub

Details

Skill name
hardware-counters
Path
skills/profilers/hardware-counters/SKILL.md
License
MIT
Repo updated
14 November 2026

FAQ

What does the Hardware Counters skill do?

Hardware performance counter skill for low-level CPU analysis. Use when collecting PMU events with perf stat, using the PAPI library, measuring cache miss rates and branch misprediction ratios, computing IPC, or correlating PMU events to source lines. Activates on queries about hardware counters, PMU events, perf stat -e, PAPI, cache miss rate, branch misprediction, IPC measurement, or CPU performance events.

How do I install the Hardware Counters skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add mohitmishra786/low-level-dev-skills --skill hardware-counters. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Hardware Counters popular?

It lives in mohitmishra786/low-level-dev-skills, which has 293 GitHub stars and 36 forks.

Related skills

Abi and Calling Conventions

293

mohitmishra786/low-level-dev-skills

ABI and calling conventions skill for cross-language boundaries. Use when explaining System V AMD64, ARM AAPCS, RISC-V psABI, stack frames, variadic calls, or FFI register rules. Activates on queries about calling convention, ABI, System V AMD64, AAPCS, stack frame, variadic function, or FFI registers.

Software Development36

Adc Dac Baremetal

293

mohitmishra786/low-level-dev-skills

Bare-metal ADC and DAC skill. Use when configuring analog sampling, DMA-driven ADC, calibration, or DAC output on MCUs. Activates on queries about ADC bare-metal, sampling time, DMA ADC, or DAC channel setup.

Other36

Af Xdp

293

mohitmishra786/low-level-dev-skills

AF_XDP skill for high-performance XDP sockets. Use when creating AF_XDP sockets, configuring UMEM and XSK rings, XDP_REDIRECT programs, copy vs zero-copy mode, or comparing with DPDK. Activates on queries about AF_XDP, xsk_umem, XDP_REDIRECT, libbpf xsk, or zero-copy XDP.

Software Development36

C Github

179

daxaur/openpaw

Interact with GitHub using the `gh` CLI and `jq`. Manage PRs, issues, repositories, and Actions workflows. Make raw API calls with `gh api` for anything not covered by built-in commands.

Git & Code ReviewIn 1 list13

Branch Prediction and Speculation

293

mohitmishra786/low-level-dev-skills

Branch prediction and speculation skill for CPU security and performance. Use when explaining branch predictors, mispredict penalties, speculative execution, Spectre/Meltdown mitigations, or branchless patterns. Activates on queries about branch prediction, speculative execution, Spectre, Meltdown, mispredict, or branchless code.

Git & Code Review36

C Linear

179

daxaur/openpaw

Manage Linear issues and projects using the `linear` CLI. List and filter issues, create new issues, update status, start work on a branch, and create linked pull requests directly from the terminal.

Git & Code ReviewIn 1 list13

Browse the most popular Claude skills, all git & code review skills, or write your own with the skills generator.