Linux perf profiler skill for CPU performance analysis. An agent skill from mohitmishra786/low-level-dev-skills.

MITAuto-check: notesDevelopment

Install Linux Perf

skills CLI
$ npx skills add mohitmishra786/low-level-dev-skills --skill linux-perf -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mohitmishra786/low-level-dev-skills linux-perf --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/profilers/linux-perf .claude/skills/linux-perf && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
linux-perf
GitHub stars
253
Token cost
~1.4k tokens
SKILL.md length
299 words
Files
2 (incl. references)
Skills in repo
138
Repo updated
First seen
Licence
MIT

At a glance

Linux perf profiler skill for CPU performance analysis. An agent skill from mohitmishra786/low-level-dev-skills.

  • Works in 9 steps: Prerequisites → perf stat — quick counters → perf record — sampling → …
  • Collecting sampling profiles with perf record
  • SKILL.md covers Purpose, Triggers, Workflow and Related skills
  • Calls apt, dnf and git; reaches github.com

What it does

Linux Perf is an agent skill from mohitmishra786/low-level-dev-skills. Linux perf profiler skill for CPU performance analysis. Use when collecting sampling profiles with perf record, generating perf report, measuring hardware counters (cache misses, branch mispredicts, IPC), identifying hot functions, or feeding perf data into flamegraph tools. Activates on queries about perf, Linux performance counters, PMU events, off-CPU profiling, perf stat, perf annotate, or sampling-based profiling on Linux.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/events.md`).

It sits in Development, covering Performance optimization. It works with Linux. The repository describes itself as: A curated suite of AI agent skills for systems and low-level programming with C/C++, Rust, and Zig toolchains, covering compilers, debuggers, profilers, build systems…. The licence is MIT.

When your agent uses it

  • Collecting sampling profiles with perf record
  • Generating perf report
  • Measuring hardware counters (cache misses
  • Branch mispredicts

Example prompts

  • “/linux-perf”

Workflow steps

9 steps, taken from the step headings in SKILL.md.

  1. Prerequisites
  2. perf stat — quick counters
  3. perf record — sampling
  4. perf report — interactive analysis
  5. perf annotate — hot instructions
  6. perf top — live profiling
  7. Feed into flamegraphs
  8. Common issues
  9. Useful events

What it can do on your machine

Read from SKILL.md and the folder at commit bdc5847. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • apt
    • dnf
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Linux Perf loads about 1.4k tokens when it runs, and up to ~2.2k if it reads all its reference files. Until then it costs about 111 tokens; SKILL.md has 299 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~111
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteRuns commands with sudoSKILL.md:26
    sudo apt install linux-perf    # Debian/Ubuntu (version-matched)
  • NoteRuns commands with sudoSKILL.md:27
    sudo dnf install perf          # Fedora/RHEL
  • NoteRuns commands with sudoSKILL.md:35
    sudo sysctl -w kernel.perf_event_paranoid=1
  • NoteRuns commands with sudoSKILL.md:38
    echo 'kernel.perf_event_paranoid=1' | sudo tee /etc/sysctl.d/99-perf.conf
  • NoteRuns commands with sudoSKILL.md:39
    sudo sysctl -p /etc/sysctl.d/99-perf.conf
  • NoteRuns commands with sudoSKILL.md:133
    sudo perf top -g
  • NoteRuns commands with sudoSKILL.md:136
    sudo perf top -p 12345
  • NoteRuns commands with sudoSKILL.md:161
    here | Kernel symbols not visible | Use `sudo perf record`; install `linux-image-$(uname -r)-dbgsym` |
  • NoteRuns commands with sudoSKILL.md:162
    | Kernel symbols unavailable | `echo 0 | sudo tee /proc/sys/kernel/kptr_restrict` |

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mohitmishra786/low-level-dev-skills at commit bdc5847, republished under its MIT licence (© mohitmishra786). 299 words, ~1,418 tokens.

Download SKILL.mdSave it as .claude/skills/linux-perf/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
linux-perf
description
Linux perf profiler skill for CPU performance analysis. Use when collecting sampling profiles with perf record, generating perf report, measuring hardware counters (cache misses, branch mispredicts, IPC), identifying hot functions, or feeding perf data into flamegraph tools. Activates on queries about perf, Linux performance counters, PMU events, off-CPU profiling, perf stat, perf annotate, or sampling-based profiling on Linux.

Linux perf

Purpose

Guide agents through perf for CPU profiling: sampling, hardware counter measurement, hotspot identification, and integration with flamegraph generation.

Triggers

  • "Which function is consuming the most CPU?"
  • "How do I measure cache misses / IPC?"
  • "How do I use perf to find hotspots?"
  • "How do I generate a flamegraph from perf data?"
  • "perf shows [unknown] or [kernel] frames"

Workflow

1. Prerequisites
bash
# Install
sudo apt install linux-perf    # Debian/Ubuntu (version-matched)
sudo dnf install perf          # Fedora/RHEL

# Check permissions
# By default perf requires root or paranoid level ≤ 1
cat /proc/sys/kernel/perf_event_paranoid
# 2 = only CPU stats (not kernel), 1 = user+kernel, 0 = all, -1 = no restrictions

# Temporarily lower (session only)
sudo sysctl -w kernel.perf_event_paranoid=1

# Persistent
echo 'kernel.perf_event_paranoid=1' | sudo tee /etc/sysctl.d/99-perf.conf
sudo sysctl -p /etc/sysctl.d/99-perf.conf

Compile the target with debug symbols for useful frame data:

bash
gcc -g -O2 -fno-omit-frame-pointer -o prog main.c
# -fno-omit-frame-pointer: essential for frame-pointer-based unwinding
# Alternative: compile with DWARF CFI and use --call-graph=dwarf
2. perf stat — quick counters
bash
# Basic hardware counters
perf stat ./prog

# With specific events
perf stat -e cache-misses,cache-references,instructions,cycles,branch-misses ./prog

# Wall-clock comparison: N runs
perf stat -r 5 ./prog

# Attach to existing process
perf stat -p 12345 sleep 10

Interpret perf stat output:

  • IPC (instructions per cycle) < 1.0: memory-bound or stalled pipeline
  • cache-miss rate > 5%: significant cache pressure
  • branch-miss rate > 5%: branch predictor struggling
3. perf record — sampling
bash
# Default: sample at 1000 Hz (cycles event)
perf record -g ./prog

# Specify frequency
perf record -F 999 -g ./prog

# Specific event
perf record -e cache-misses -g ./prog

# Attach to running process
perf record -F 999 -g -p 12345 sleep 30

# Off-CPU profiling (time spent waiting)
perf record -e sched:sched_switch -ag sleep 10

# DWARF call graphs (better for binaries without frame pointers)
perf record -F 999 --call-graph=dwarf ./prog

# Save to named file
perf record -o myapp.perf.data -g ./prog
4. perf report — interactive analysis
bash
perf report                          # reads perf.data
perf report -i myapp.perf.data
perf report --no-children            # self time only (not cumulative)
perf report --sort comm,dso,sym      # sort by fields
perf report --stdio                  # non-interactive text output

Navigation in TUI:

  • Enter — expand a symbol
  • a — annotate (show assembly with hit counts)
  • s — show source (needs debug info)
  • d — filter by DSO (library)
  • t — filter by thread
  • ? — help
5. perf annotate — hot instructions
bash
# Show assembly with hit percentages
perf annotate sym_name

# From report: press 'a' on a symbol
# Or directly:
perf annotate -i perf.data --symbol=hot_function --stdio

High hit count on a mov or vmovdqa suggests a cache miss at that load.

6. perf top — live profiling
bash
# Live top, like 'top' but for functions
sudo perf top -g

# Filter by process
sudo perf top -p 12345
7. Feed into flamegraphs
bash
# Generate perf script output
perf script > out.perf

# Use Brendan Gregg's FlameGraph tools
git clone https://github.com/brendangregg/FlameGraph
./FlameGraph/stackcollapse-perf.pl out.perf > out.folded
./FlameGraph/flamegraph.pl out.folded > flamegraph.svg

# Open flamegraph.svg in browser

See skills/profilers/flamegraphs for reading flamegraphs and interpreting results.

8. Common issues
ProblemCauseFix
Permission deniedperf_event_paranoid too highLower paranoid level or run with sudo
[unknown] framesMissing frame pointers or debug infoRecompile with -fno-omit-frame-pointer or use --call-graph=dwarf
[kernel] everywhereKernel symbols not visibleUse sudo perf record; install linux-image-$(uname -r)-dbgsym
No kallsymsKernel symbols unavailable`echo 0
Empty report for short programProgram exits too fastUse -F 9999 or instrument longer workload
DWARF unwinding slowLarge DWARF stackLimit with --call-graph dwarf,512
9. Useful events
bash
# List all available events
perf list

# Common hardware events
cycles
instructions
cache-references
cache-misses
branch-instructions
branch-misses
stalled-cycles-frontend
stalled-cycles-backend

# Software events
context-switches
cpu-migrations
page-faults

# Tracepoints (requires root)
sched:sched_switch
syscalls:sys_enter_read

For a counter reference and interpretation guide, see references/events.md.

  • Use skills/profilers/flamegraphs for SVG flamegraph generation and reading
  • Use skills/profilers/valgrind for cache simulation and memory profiling
  • Use skills/compilers/gcc or skills/compilers/clang for PGO from perf data (AutoFDO)

© mohitmishra786, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/profilers/linux-perf of mohitmishra786/low-level-dev-skills.

  • SKILL.md
  • references/events.md

Open the folder on GitHubat commit bdc5847

Compare with similar skills

Linux Perf next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Linux Perf compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Linux Perf this skillmohitmishra786/low-level-dev-skills253—~1.4kAutomated safety check: NotesMIT
PlotJuggler 4 Perf ProfilingPlotJuggler/PlotJuggler6.2k—~1.6kAutomated safety check: NotesMPL-2.0
The Art of Debuggingstas00/the-art-of-debugging1.7k—~6.1kAutomated safety check: NotesCC-BY-SA-4.0
Linux perf Profiling Guideintel/intel-performance-skills332—~3.1kAutomated safety check: NotesCustom licence
Dotnet Debuggingnovotnyllc/dotnet-artisan233—~2.1kAutomated safety check: PassMIT
PerftestBrowserWorks/waterfox-android3791 repos~2.3kAutomated safety check: PassCustom licence

Similar skills

  • PlotJuggler 4 Perf Profiling

    PlotJuggler/PlotJuggler

    Guides CPU profiling of PlotJuggler 4 on Linux with perf: count first, record cheaply with LBR, then read per-thread, flat, flamegraph or time-window views.

    6.2k GitHub stars~1.6k tokensUpdated 7 days ago
    DevelopmentAuto-check: notes
  • The Art of Debugging

    stas00/the-art-of-debugging

    Condensed debugging method and tool recipes for Unix, Python and PyTorch programs: crashes, hangs, segfaults, wrong output, CUDA OOM, NaN values and slowness.

    1.7k GitHub stars~6.1k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Linux perf Profiling Guide

    intel/intel-performance-skills

    Official

    Guides perf-based profiling of Linux programs through five flows: quick hardware counters, hotspot profiling, cache contention, core-scaling, and a report.

    332 GitHub stars~3.1k tokensUpdated 9 days ago
    DevelopmentAuto-check: notes
  • Dotnet Debugging

    novotnyllc/dotnet-artisan

    Debugs Windows and Linux/macOS applications (native, .NET/CLR, mixed-mode) with WinDbg MCP (crash dumps, !analyze, !syncblk, !dlk, !runaway, !dumpheap, !gcroot, BSOD), dotnet-dump, lldb with SOS…

    233 GitHub stars~2.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Perftest

    BrowserWorks/waterfox-android

    Run Firefox performance tests locally or in CI. An agent skill from BrowserWorks/waterfox-android.

    379 GitHub starsUsed in 1 repo~2.3k tokens
    DevelopmentAuto-check passed
  • Performance

    static-web-server/static-web-server

    Optimize or review performance for the Static Web Server (SWS) project — profiling, bottlenecks, resource usage, compression, and caching

    2.4k GitHub stars~3.1k tokensUpdated today
    Backend & APIsAuto-check passed

More from mohitmishra786/low-level-dev-skills

All 138 skills in this repo
  • ARM and AArch64 Assembly

    mohitmishra786/low-level-dev-skills

    Guides reading and writing AArch64 and ARM Thumb assembly: compiler output, inline asm, registers, the AAPCS calling convention and NEON or SVE basics.

    253 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check passed
  • RISC-V Assembly Guide

    mohitmishra786/low-level-dev-skills

    Reference for RISC-V assembly on RV32 and RV64: register names and calling convention, extension naming, GCC and Clang inline asm, and QEMU with GDB debugging.

    253 GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check passed
  • x86-64 Assembly Reference

    mohitmishra786/low-level-dev-skills

    Explains x86-64 registers, the System V AMD64 calling convention, and how to read compiler-generated or inline assembly.

    253 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Bazel for C and C++

    mohitmishra786/low-level-dev-skills

    Guides your agent through Bazel for C/C++ projects: BUILD files, Bzlmod dependencies, toolchain registration, remote execution, dependency queries and sandbox debugging.

    253 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Binary Hardening

    mohitmishra786/low-level-dev-skills

    Binary hardening skill for security-hardened C/C++ builds. An agent skill from mohitmishra786/low-level-dev-skills.

    253 GitHub stars~2k tokensUpdated 3 mo ago
    Auto-check passed
  • Binutils

    mohitmishra786/low-level-dev-skills

    GNU binutils skill for binary manipulation and analysis. An agent skill from mohitmishra786/low-level-dev-skills.

    253 GitHub stars~1.2k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Categories

Questions about Linux Perf

What does Linux Perf do?

Linux perf profiler skill for CPU performance analysis. An agent skill from mohitmishra786/low-level-dev-skills. Linux Perf is an agent skill from mohitmishra786/low-level-dev-skills. Linux perf profiler skill for CPU performance analysis.

When should I use Linux Perf?

Linux Perf fits situations like: collecting sampling profiles with perf record; generating perf report; measuring hardware counters (cache misses; branch mispredicts.

How do I install Linux Perf in Claude Code?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill linux-perf -a claude-code`. Or copy the skill folder (skills/profilers/linux-perf in mohitmishra786/low-level-dev-skills) into .claude/skills/linux-perf in your project. Claude Code loads it when a task matches its description.

How do I install Linux Perf in Codex?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill linux-perf -a codex`. Or copy the skill folder (skills/profilers/linux-perf in mohitmishra786/low-level-dev-skills) into .agents/skills/linux-perf in your project. Codex loads it when a task matches its description.

Can I use Linux Perf in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mohitmishra786/low-level-dev-skills --skill linux-perf -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/linux-perf, .gemini/skills/linux-perf, .github/skills/linux-perf and .opencode/skills/linux-perf in your project.

What does Linux Perf need to run?

Going by SKILL.md and its folder, Linux Perf needs the command-line tools its instructions call (apt, dnf and git).

Does Linux Perf access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Linux Perf safe to install?

Our automated static check of SKILL.md found notes only (runs commands with sudo), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Linux Perf use?

Linux Perf is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Linux Perf use?

About 1.4k tokens (SKILL.md is roughly 5.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 814 tokens, read only when the agent opens those files.

What are the alternatives to Linux Perf?

Skills that share tags, products or a category with Linux Perf: PlotJuggler 4 Perf Profiling (PlotJuggler/PlotJuggler, 6.2k stars), The Art of Debugging (stas00/the-art-of-debugging, 1.7k stars), Linux perf Profiling Guide (intel/intel-performance-skills, 332 stars) and Dotnet Debugging (novotnyllc/dotnet-artisan, 233 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Linux Perf?

mohitmishra786 (a GitHub user) maintains it in mohitmishra786/low-level-dev-skills, which has 253 GitHub stars. The repository holds 138 skills in this directory. The repository was last updated on June 27, 2026.

Source: mohitmishra786/low-level-dev-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.