debugging-rocprof-sys
Skill5 starsChanged 16 days agoMITView on GitHub
Use when rocprofiler-systems crashes, hangs, produces wrong output, fails to instrument, or has GPU/MPI/threading issues during profiling
In this repository50 other files it gives its agents.
- analyze-pr-commentsSkill
- architecture-analyzeSkill
- architecture-tradeoffSkill
- askSkill
- code-smellsSkill
- exploration-explore-codeSkill
- git-commitSkill
- git-gh-clientSkill
- git-prepare-pull-requestSkill
- git-pull-request-statusSkill
- gitSkill
- grill-meSkill
- library-amd-smiSkill
- notify-meSkill
- planning-architectureSkill
- planning-baseSkill
- planning-bugfixSkill
- planning-docsSkill
- planning-featureSkill
- planning-refactorSkill
- programming-cmake-best-practicesSkill
- programming-cpp-constexprSkill
- programming-cpp-design-patternsSkill
- programming-cpp-naming-rulesSkill
- programming-cpp-policy-based-diSkill
- programming-cppSkill
- programming-cpp-stl-algorithmsSkill
- programming-pythonSkill
- pr-review-interactiveSkill
- pr-reviewSkill
- radisha-create-skillSkill
- radisha-helpSkill
- radisha-improve-skillSkill
- radisha-skillsSkill
- radisha-updateSkill
- refactoring-techniquesSkill
- review-architectureSkill
- rocprofsys-buildSkill
- rocprofsys-configureSkill
- rocprofsysSkill
- static-analysisSkill
- testing-gtest-gmockSkill
- testing-pytestSkill
- testing-testplanSkill
- therock-build-to-commitSkill
- therock-commit-in-buildSkill
- therock-first-build-with-commitSkill
- update-pr-descriptionSkill
- verify-pmc-metricsSkill
- watchSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 6 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Ask before escalating to heavier tools (gdb, strace)
- Distinctive: line 14
Never assume root cause without evidence
- Distinctive: line 15
Never attach debuggers to processes without user confirmation </IMPORTANT>
- Very specific: line 65
Use AskUserQuestion to collect:
- Distinctive: line 126
Ask user before using any of these tools.
- Very specific: line 145
Look for rocprof frames in backtrace to distinguish profiler vs app crash
- Very specific: line 152
Always: use -f for threaded apps, -ff -o prefix for multiprocess
- Distinctive: line 159
If Phase 2 narrows but doesn't resolve, inspect source or create minimal repro.
- Very specific: line 161
Source inspection: Use exploration-explore-code to navigate the rocprof-sys source when needed.
- Distinctive: line 167
Remove optional features one at a time (GPU, MPI, sampling)
- Very specific: line 168
Test with simplest preset (--balanced)
- Very specific: line 174
If code fix needed, suggest planning-bugfix.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Debugging rocprofiler-systems
Collaborative debugging for rocprofiler-systems issues. Work WITH the user through systematic triage, not autonomously.
<IMPORTANT>
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 confirmation
</IMPORTANT>When to Use
- Crashes or segfaults when profiling with rocprof-sys
- Missing, incorrect, or corrupted profiling output
- Instrumentation failures (Dyninst, symbol issues)
- Multiprocess (fork/MPI) or multithreaded app problems
- GPU/ROCm tracing or sampling failures
- Signal handling conflicts between app and profiler
- Profiling overhead issues
When NOT to Use
- Quick usage questions ->
ask - Root cause known, planning a fix ->
planning-bugfix - Exploring code without a bug ->
exploration-explore-code
Workflow
digraph 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";
}Phase 0: Gather Context
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 |
Problem Classification
| 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 |
Phase 1: Log Analysis (Always Start Here)
Enable Debug Logging
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 -- ./appCheck Configuration
rocprof-sys-avail -G /tmp/current-config.cfg --all
env | grep ROCPROFSYSLog Patterns
| 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.
Phase 2: Tool Escalation
Ask user before using any of these tools. Explain WHY the chosen tool fits.
Tool Selection
| 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 |
rocprof-sys-specific gdb Tips
Standard gdb usage applies. These are rocprof-sys-specific considerations:
- Look for
rocprofframes in backtrace to distinguish profiler vs app crash - For fork/MPI:
set follow-fork-mode childor attach to specific rank PID - For threads:
thread apply all btto see all thread states - Useful breakpoints:
rocprofiler_systems_v1::configure,fork_gotcha::audit
rocprof-sys-specific strace Tips
- Always use
-ffor threaded apps,-ff -o prefixfor multiprocess - Watch for
open("/dev/kfd")failures (GPU access) - Repeated
futex(FUTEX_WAIT)suggests deadlock in profiler - For MPI:
mpirun -n 4 strace -ff -o /tmp/strace-mpi rocprof-sys-run -- ./app
Phase 3: Deep Dive
If 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.
Minimal Reproduction
- Strip app to smallest failing case
- Isolate rocprof-sys mode (run vs instrument vs sample)
- Remove optional features one at a time (GPU, MPI, sampling)
- Test with simplest preset (
--balanced)
Phase 4: Conclude
Summarize: problem, root cause, evidence, tools used, resolution.
If code fix needed, suggest planning-bugfix.
Known Gotchas
| 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 |
Common Mistakes
| 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 |
Integration
| 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 |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

