一键导入
debugging-rocprof-sys
Use when rocprofiler-systems crashes, hangs, produces wrong output, fails to instrument, or has GPU/MPI/threading issues during profiling
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when rocprofiler-systems crashes, hangs, produces wrong output, fails to instrument, or has GPU/MPI/threading issues during profiling
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Given a TheRock nightly build (URL or run-id), return the rocm-systems pin_sha used in that build
Check whether a given rocm-systems commit is included in a specific TheRock nightly build
Find the first TheRock nightly build that includes a given rocm-systems commit
Reviews Pull Requests or local diffs with an 8-agent fan-out covering static analysis, dead code, code smells + quality (naming, complexity, single-responsibility, magic numbers), language rules (C++/Python/CMake), architecture, simplification, performance (hot-path classification, allocations, locks, I/O), and undefined behaviour (signed overflow, lifetime, strict aliasing, data races, sanitizer coverage; C/C++/unsafe-Rust only). Use when the user asks to "review this PR", "review the diff", "audit this branch", "/pr-review", or when staging changes before push.
Walk through a PR review interactively, one finding at a time. Generate review via pr-review, then for each issue present analysis + proposed inline comment, let user accept/edit/skip, accumulate into a PENDING GitHub review, submit at end.
Use when user wants to list, analyze, review, or summarize GitHub PR comments on a pull request number or URL
| name | debugging-rocprof-sys |
| description | Use when rocprofiler-systems crashes, hangs, produces wrong output, fails to instrument, or has GPU/MPI/threading issues during profiling |
Collaborative debugging for rocprofiler-systems issues. Work WITH the user through systematic triage, not autonomously.
This is a COLLABORATIVE skill. At each step: 1. Present findings and reasoning to the user 2. Ask before escalating to heavier tools (gdb, strace) 3. Never assume root cause without evidence 4. Never attach debuggers to processes without user confirmationaskplanning-bugfixexploration-explore-codedigraph debugging {
"User reports issue" [shape=doublecircle];
"Gather context" [shape=box];
"Classify problem" [shape=diamond];
"Enable debug logging" [shape=box];
"Logs reveal root cause?" [shape=diamond];
"Conclude" [shape=doublecircle];
"Choose escalation tool" [shape=diamond];
"Run tool with user" [shape=box];
"Root cause found?" [shape=diamond];
"Deep dive: source + minimal repro" [shape=box];
"User reports issue" -> "Gather context";
"Gather context" -> "Classify problem";
"Classify problem" -> "Enable debug logging";
"Enable debug logging" -> "Logs reveal root cause?";
"Logs reveal root cause?" -> "Conclude" [label="yes"];
"Logs reveal root cause?" -> "Choose escalation tool" [label="no"];
"Choose escalation tool" -> "Run tool with user";
"Run tool with user" -> "Root cause found?";
"Root cause found?" -> "Conclude" [label="yes"];
"Root cause found?" -> "Deep dive: source + minimal repro" [label="no"];
"Deep dive: source + minimal repro" -> "Conclude";
}
Use AskUserQuestion to collect:
| Question | Why |
|---|---|
| What command are you running? | Which tool: run, instrument, sample, causal |
| What happens vs what you expect? | Classifies the problem |
| Multiprocess? (fork, MPI) | Process-level complexity |
| Multithreaded? (pthreads, OpenMP, HIP) | Thread-level complexity |
| Works without rocprof-sys? | Isolates profiler vs app |
| ROCm version and GPU? | Hardware/driver context |
| Category | Indicators | Start With |
|---|---|---|
| Config/Setup | Wrong output, missing data | Logs, rocprof-sys-avail |
| Crash/Segfault | SIGSEGV, SIGABRT | Logs, then gdb |
| Hang/Deadlock | Never finishes | gdb attach, strace |
| Incorrect Output | Wrong values | Logs, trace query |
| Instrumentation Failure | Dyninst errors | Logs with -vvv |
| GPU/ROCm Issue | Missing GPU data | Logs, amd-smi, env vars |
| Multiprocess Issue | Fork/MPI failures | Logs with PID, strace -f |
| Performance Overhead | Profiled app too slow | Sampling config, strace -c |
export ROCPROFSYS_LOG_LEVEL=debug # trace|debug|info|warn|error|critical|off
export ROCPROFSYS_VERBOSE=3
export ROCPROFSYS_LOG_FILE=/tmp/rocprof-sys-debug.log
# For instrumentation issues
rocprof-sys-instrument -vvv -- ./app
rocprof-sys-avail -G /tmp/current-config.cfg --all
env | grep ROCPROFSYS
| Pattern | Meaning |
|---|---|
[critical] or [error] | Direct failure |
throw / exception | C++ exception |
signal / SIG | Signal received - check if app or profiler |
fork / pid | Process lifecycle |
pthread / thread | Thread lifecycle |
perfetto | Trace backend issues |
dyninst / instrumentation | Binary rewriting |
rocm / hip / hsa | GPU subsystem |
Decision point: Present log findings to user. If root cause is clear, go to Phase 4. Otherwise, escalate.
Ask user before using any of these tools. Explain WHY the chosen tool fits.
| Problem | Tool | Reason |
|---|---|---|
| Crash/signal | gdb | Inspect crash state, backtrace |
| Hang/deadlock | gdb attach + strace | See what's blocked |
| Syscall failures, missing files | strace | Trace OS interactions |
| Library call issues | ltrace | Trace shared library calls |
| GPU device issues | amd-smi | Check GPU visibility and state |
| Library deps | ldd | Check shared library resolution |
| Symbol issues | nm / objdump | Check symbol availability |
| Memory issues | valgrind | Detect memory errors |
Standard gdb usage applies. These are rocprof-sys-specific considerations:
rocprof frames in backtrace to distinguish profiler vs app crashset follow-fork-mode child or attach to specific rank PIDthread apply all bt to see all thread statesrocprofiler_systems_v1::configure, fork_gotcha::audit-f for threaded apps, -ff -o prefix for multiprocessopen("/dev/kfd") failures (GPU access)futex(FUTEX_WAIT) suggests deadlock in profilermpirun -n 4 strace -ff -o /tmp/strace-mpi rocprof-sys-run -- ./appIf Phase 2 narrows but doesn't resolve, inspect source or create minimal repro.
Source inspection: Use exploration-explore-code to navigate the rocprof-sys source when needed.
--balanced)Summarize: problem, root cause, evidence, tools used, resolution.
If code fix needed, suggest planning-bugfix.
| Gotcha | Details |
|---|---|
| Fork + OpenMPI + libfabric | May segfault; use binary rewrite instead of runtime |
| GPU handles after fork | AMD SMI reinitializes in parent, disabled in child |
| Perfetto buffer overflow | Increase ROCPROFSYS_PERFETTO_BUFFER_SIZE_KB |
| Thread vs process sampling | Different env vars control each |
| Signal conflicts | App and profiler may both want SIGPROF/SIGALRM |
| Mistake | Fix |
|---|---|
| Jumping straight to gdb | Check logs first - most issues are config errors |
strace without -f on threaded apps | Always -f for threads, -ff for multiprocess |
| Not testing without profiler first | Isolate profiler vs app issue |
| Ignoring env vars | Always env | grep ROCPROFSYS |
Skipping rocprof-sys-avail | Validates config before deeper debugging |
| After This Skill | Use |
|---|---|
| Root cause found, fix needed | planning-bugfix |
| Need to understand code area | exploration-explore-code |
| Fix needs tests | testing-gtest-gmock or testing-pytest |