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.
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.
$ npx skills add PlotJuggler/PlotJuggler --skill perf-profile -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install PlotJuggler/PlotJuggler perf-profile --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/PlotJuggler/PlotJuggler.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/perf-profile .claude/skills/perf-profile && rm -rf skills-srcUse ~/.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/
Install the "perf-profile" agent skill from https://github.com/PlotJuggler/PlotJuggler/tree/main-4.x/.claude/skills/perf-profile into .claude/skills/perf-profile/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "perf-profile", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/PlotJuggler/PlotJuggler/tree/main-4.x/.claude/skills/perf-profileType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add PlotJuggler/PlotJuggler --skill perf-profile -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install PlotJuggler/PlotJuggler perf-profile --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PlotJuggler/PlotJuggler.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/perf-profile .agents/skills/perf-profile && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "perf-profile" agent skill from https://github.com/PlotJuggler/PlotJuggler/tree/main-4.x/.claude/skills/perf-profile into .agents/skills/perf-profile/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "perf-profile", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add PlotJuggler/PlotJuggler --skill perf-profile -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install PlotJuggler/PlotJuggler perf-profile --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PlotJuggler/PlotJuggler.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/perf-profile .cursor/skills/perf-profile && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "perf-profile" agent skill from https://github.com/PlotJuggler/PlotJuggler/tree/main-4.x/.claude/skills/perf-profile into .cursor/skills/perf-profile/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "perf-profile", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/PlotJuggler/PlotJuggler.git --path .claude/skills/perf-profile--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add PlotJuggler/PlotJuggler --skill perf-profile -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install PlotJuggler/PlotJuggler perf-profile --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PlotJuggler/PlotJuggler.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/perf-profile .gemini/skills/perf-profile && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "perf-profile" agent skill from https://github.com/PlotJuggler/PlotJuggler/tree/main-4.x/.claude/skills/perf-profile into .gemini/skills/perf-profile/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "perf-profile", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install PlotJuggler/PlotJuggler perf-profileInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add PlotJuggler/PlotJuggler --skill perf-profile -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/PlotJuggler/PlotJuggler.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/perf-profile .github/skills/perf-profile && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "perf-profile" agent skill from https://github.com/PlotJuggler/PlotJuggler/tree/main-4.x/.claude/skills/perf-profile into .github/skills/perf-profile/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "perf-profile", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add PlotJuggler/PlotJuggler --skill perf-profile -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install PlotJuggler/PlotJuggler perf-profile --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PlotJuggler/PlotJuggler.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/perf-profile .opencode/skills/perf-profile && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "perf-profile" agent skill from https://github.com/PlotJuggler/PlotJuggler/tree/main-4.x/.claude/skills/perf-profile into .opencode/skills/perf-profile/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "perf-profile", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
perf-profileGuides 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.
This skill sets the rules for investigating performance problems in PlotJuggler 4 on Linux, such as sluggish plot zooming, dropped frames, GUI jank, a slower file load or startup, or a suspected regression from a commit. Its recorded failure modes include a 523 MB DWARF perf.data where every report took minutes, a hybrid-CPU event split that hid half the samples, and DWARF stacks that unwound to nothing through stripped Qt. The governing rule is to count first, record cheaply in a single view, unwind exactly once and never re-process.
The steps start with a wall-clock comparison of the same headless load on two builds, since a regression claim is settled by a number rather than a profile. Environment setup, live counting with perf top and perf stat, and recording with perf record follow, using a prime sampling frequency of 997, LBR call graphs and the process pinned to the performance cores so only one PMU is involved. A views.sh helper is included for the per-thread, flat, flamegraph and time-window views.
The recipes are written around the author's own hybrid-core Intel laptop and assume perf_event_paranoid is 1 or lower, otherwise sudo is needed, so CPU ranges and settings may need adjusting on another machine.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 346dee6. It shows what the files ask for, not the result of running them.
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.
Ships script files (Shell), which the agent can run.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
PlotJuggler 4 Perf Profiling loads about 1.6k tokens when it runs. Until then it costs about 91 tokens; SKILL.md has 657 words of instructions outside code blocks.
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.
The automated check noted patterns worth knowing about, such as sudo or a known installer.
`sudo sysctl kernel.perf_event_paranoid=1` for the session.`sudo offcputime-bpfcc -df -p "$PID" 30` — sudo prompts: hand it to the user.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.
The full file from PlotJuggler/PlotJuggler at commit 346dee6, republished under its MPL-2.0 licence (© PlotJuggler). 657 words, ~1,586 tokens.
.claude/skills/perf-profile/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Recorded failure modes: a 523 MB DWARF perf.data where every perf report took
minutes; the hybrid-CPU event split silently hiding half the samples behind | head;
DWARF user-stacks unwinding to nothing through stripped Qt while LBR resolved full
chains (paintGL → QOpenGL2PaintEngineEx → libgallium). The rule: count first,
record cheap and single-view, unwind exactly once, never re-process.
This machine: perf 7.0.12, i7-13700H hybrid (cpu_core = CPUs 0-11, cpu_atom = 12-19),
Arch LBR depth 32 on both PMUs, tracefs root-only, sudo prompts. Check
cat /proc/sys/kernel/perf_event_paranoid first: the recipes below assume ≤1; at ≥3
(the Debian/Ubuntu default) even user-space sampling of your own PID needs sudo or
sudo sysctl kernel.perf_event_paranoid=1 for the session.
A suspected regression ("load went from 11 s to 38 s since PR #N") is settled by a number, not a profile. Run the same headless load on both builds first; profile only if the delta is real:
/usr/bin/time -v ./build/pj_app/plotjuggler4 --nosplash --layout <layout.pj4.xml> --exit-after-layout
# -> "Elapsed (wall clock)" + "Maximum resident set size"; repeat on a worktree at the suspect baseexport DEBUGINFOD_URLS= # Qt is stripped + absent from Ubuntu's server: leaving
# this set re-queries the network every report (TTL 600s)
OUT=~/pjperf/$(date +%Y%m%d-%H%M%S); mkdir -p "$OUT" # /home, NEVER /tmp (tmpfs=RAM)PID=$(pgrep -x plotjuggler4)
perf top -p "$PID" -F 997 # live triage, no file
perf stat -p "$PID" -I 1000 # this CPU emits TopdownL1 + IPC for free;
# watch context-switches/s spike at the janktaskset -acp 0-11 "$PID" # pin to P-cores -> ONE PMU -> no hybrid split (unpin to re-verify)
perf record -F 997 --call-graph lbr -N --switch-events -p "$PID" -o "$OUT/rec.data"-F 997 — prime; never 999/1000 (aliases with 60/120/144 Hz refresh → skewed samples).lbr — no frame pointers needed; unwinds through stripped Qt/Mesa; ~20× smaller files.-N — don't copy the ~380 MB binary into ~/.debug; repeated runs fill the disk.--switch-events — free, unprivileged off-CPU timeline (gaps in hotspot's per-thread view).main()-rooted flame graph → --call-graph dwarf,8192 -F 499 instead.perf record -vv shows the configured freq/period.perf script -i "$OUT/rec.data" --header --no-inline \
-F comm,tid,time,event,ip,sym,dso > "$OUT/all.script"--inline is on by default and is a top analysis cost — always --no-inline.
Sanity-check the events present (two cpu_* lines = the hybrid split is live):
grep -oE 'cpu_(core|atom)/[a-z]+/[A-Za-z]*|task-clock' "$OUT/all.script" | sort | uniq -c
views.sh beside this file: per-second histogram, per-thread counts, flat leaves,
per-TID leaves, time-window cut. Interactive: ~/Apps/hotspot-v1.6.0-x86_64.AppImage "$OUT/rec.data" (per-thread timeline, drag a time range). Folded stacks without Perl:
perf report -i "$OUT/rec.data" --no-inline --stdio -g folded,0 (,0 — the default
0.5% threshold silently drops the tail). Caveat: LBR's 32-frame ceiling truncates
outer frames, so flame graphs render disconnected towers (hot sub-trees, still
readable); record DWARF when a rooted flame graph matters. Never pipe perf report
through head — each event section prints separately and you'll read only the first.
Flat profile but frames still drop → the jank is a wait. --switch-events shows it as
gaps in hotspot's GUI-thread band. For the switch-out stacks without root
(context-switches is a software event): perf record -e context-switches -c 1 -g --call-graph lbr -p "$PID". Real wait-duration stacks need
sudo offcputime-bpfcc -df -p "$PID" 30 — sudo prompts: hand it to the user.
comm = plotjuggler4 for all);
named ones are foreign: <app>:gdrv0 = Mesa glthread, QDBusConnection, FFmpeg
workers. Kernel frames print as raw 0xffffffff… (kptr_restrict) — ignorable.QPixmap::toImage). Batch the geometry instead.gdrv0/libgallium → driver-side; cross-check ./run.sh --apitrace.--latency, report --latency
(parallelism-weighted overhead finds the serialized critical path).perf record -a, tracepoints (sched:*, --filter), perf sched, perf trace,
perf probe — all root-only on this box (perf_event_paranoid ≥1 + tracefs 0700).perf record --off-cpu — perf built without BPF skeletons; flag parses, then refuses.libunwind: OFF is fine).Performance claims need numbers (see verify-live): before/after sample share of the
named symbol, or replot rate ≤60 Hz — and say which views actually ran.
© PlotJuggler, MPL-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file in .claude/skills/perf-profile of PlotJuggler/PlotJuggler.
Open the folder on GitHubat commit 346dee6
PlotJuggler 4 Perf Profiling 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| PlotJuggler 4 Perf Profiling this skillPlotJuggler/PlotJuggler | 6.2k | — | ~1.6k | Automated safety check: Notes | MPL-2.0 | |
| The Art of Debuggingstas00/the-art-of-debugging | 1.7k | — | ~6.1k | Automated safety check: Notes | CC-BY-SA-4.0 | |
| Dotnet Debuggingnovotnyllc/dotnet-artisan | 233 | — | ~2.1k | Automated safety check: Pass | MIT | |
| Kernel Debugging Advancedmohitmishra786/low-level-dev-skills | 253 | — | ~855 | Automated safety check: Pass | MIT | |
| Cmux Debugging Guidemanaflow-ai/cmux | 28k | 1 repos | ~1.1k | Automated safety check: Pass | Custom licence | |
| Electron Heap Snapshot Analysiskeybase/client | 9.3k | — | ~875 | Automated safety check: Pass | BSD-3-Clause |
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.
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…
mohitmishra786/low-level-dev-skills
Advanced kernel debugging skill for ftrace, trace-cmd, perf, kprobes, kgdb, and crash analysis.
manaflow-ai/cmux
Covers debug logging, the Debug menu, profiling rules and runtime pitfalls for working on the cmux macOS terminal app.
keybase/client
Analyzes V8, Chrome and Electron .heapsnapshot files with Node scripts to find memory leaks, detached DOM nodes and the retainer paths that keep objects alive.
mono/SkiaSharp
Fix bugs in SkiaSharp C bindings. An agent skill from mono/SkiaSharp.
PlotJuggler/PlotJuggler
Directs porting of widgets, dialogs, panels and transforms from PlotJuggler 3 to PlotJuggler 4 by lifting the original files intact and rebinding only the data paths.
PlotJuggler/PlotJuggler
Runs a gated finish-line checklist before committing a PlotJuggler PJ4 change: build proof, red-test triage, hooks, docs freshness and a diff self-review.
PlotJuggler/PlotJuggler
Confirms that a change to PlotJuggler 4 really works in the running app by proving the rebuild, launching with real data and measuring the result.
Works with
Categories
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. This skill sets the rules for investigating performance problems in PlotJuggler 4 on Linux, such as sluggish plot zooming, dropped frames, GUI jank, a slower file load or startup, or a suspected regression from a commit.data where every report took minutes, a hybrid-CPU event split that hid half the samples, and DWARF stacks that unwound to nothing through stripped Qt.
PlotJuggler 4 Perf Profiling fits situations like: plot zooming in PlotJuggler 4 feels sluggish or drops frames; A file load or startup got slower after a particular commit; turning a perf.data recording into per-thread, flat or flamegraph views; deciding whether a suspected regression is real before capturing a profile.
Run `npx skills add PlotJuggler/PlotJuggler --skill perf-profile -a claude-code`. Or copy the skill folder (.claude/skills/perf-profile in PlotJuggler/PlotJuggler) into .claude/skills/perf-profile in your project. Claude Code loads it when a task matches its description.
Run `npx skills add PlotJuggler/PlotJuggler --skill perf-profile -a codex`. Or copy the skill folder (.claude/skills/perf-profile in PlotJuggler/PlotJuggler) into .agents/skills/perf-profile in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add PlotJuggler/PlotJuggler --skill perf-profile -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/perf-profile, .gemini/skills/perf-profile, .github/skills/perf-profile and .opencode/skills/perf-profile in your project.
Going by SKILL.md and its folder, PlotJuggler 4 Perf Profiling needs a shell for the scripts in its folder. Our summary lists: Linux with perf installed; A built plotjuggler4 binary; perf_event_paranoid at 1 or lower, or sudo.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
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.
PlotJuggler 4 Perf Profiling is published under the MPL-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.6k tokens (SKILL.md is roughly 6.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with PlotJuggler 4 Perf Profiling: The Art of Debugging (stas00/the-art-of-debugging, 1.7k stars), Dotnet Debugging (novotnyllc/dotnet-artisan, 233 stars), Kernel Debugging Advanced (mohitmishra786/low-level-dev-skills, 253 stars) and Cmux Debugging Guide (manaflow-ai/cmux, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
PlotJuggler (a GitHub organization) maintains it in PlotJuggler/PlotJuggler, which has 6,233 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on October 1, 2026.
Source: PlotJuggler/PlotJuggler on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.