rocprofiler-systems-instrumenting-binaries
Guides instrumentation with `rocprof-sys-instrument` - choosing runtime instrumentation vs binary rewrite (`-o`), including or excluding functions and modules…
от amd★ 523 звезды на GitHub
Установить rocprofiler-systems-instrumenting-binaries в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Instrumenting Binaries
rocprof-sys-instrument decides which functions of a program get instrumented and
either does it while the program runs or writes a new instrumented binary. For the
full, current flag list run rocprof-sys-instrument --help (use
--help | grep -A3 -- --<flag> for one flag).
How to answer
Keep answers short: under about 1200 characters unless the user asks for more.
Lead with the direct answer and the command, then add only the caveats from this
skill that apply to the question (for example: binary rewrite skips shared libraries,
-MR ignores -R, patterns are unanchored regular expressions, -l pairs with a
lower -i and more detail means more overhead, how to list modules with
--print-available). Do not add alternatives or background nobody asked for.
Prerequisites
rocprof-sys-instrumentandrocprof-sys-runonPATH; if not, runsource <install-prefix>/share/rocprofiler-systems/setup-env.sh.- Build the target with
-gwhen you can: modules are then source files and the tool can report file and line information. Without debug info a whole binary is one module named after the binary.
Runtime instrumentation vs binary rewrite
| Runtime instrumentation | Binary rewrite | |
|---|---|---|
| Selected by | the default (no -o) |
-o [<output>] |
| Command | rocprof-sys-instrument [opts] -- ./app args |
rocprof-sys-instrument [opts] -o app.inst -- ./app |
| What gets instrumented | the executable and the shared libraries it loads | only the target's own code; shared libraries are not instrumented |
| Cost (upstream guidance) | more memory, slower to set up, more run-time overhead | much faster to set up, lower overhead |
| Runs the app | yes, immediately, with args |
no; run rocprof-sys-run -- ./app.inst args later |
| Arguments after the target | passed to the app | ignored (give them when you run the result) |
- Pick runtime when the performance of the libraries the app loads matters.
- Pick binary rewrite for the lowest overhead, for repeated runs, and for MPI applications (upstream guidance).
--exe-only(runtime only) leaves every shared library out;--max-library-functions Nskips shared libraries with more thanNfunctions (default 20000;0disables the check).-owith no file name writes<name>.instin the current directory (target in the current directory) orinstrumented/<name>for a library.
Function vs module
- A function is one symbol, for example
big_aorDomain::BuildMesh. - A module is the container a function is defined in: its source file when
the binary has debug info (
/path/mod_a.cpp), otherwise the binary or library itself (/path/app). Shared libraries appear as their own modules in runtime mode.
rocprof-sys-instrument --simulate -o app.inst --print-available modules -- ./app
rocprof-sys-instrument --simulate -o app.inst --print-available functions -- ./app
rocprof-sys-instrument --simulate -o app.inst --print-available pair -- ./app
pair prints one [module] --> [function][#instructions] line per function.
Module options (-MI, -ME, -MR) act on every function in the matching modules;
function options (-I, -E, -R) act on individual functions.
Including, excluding and restricting
| Option | Meaning |
|---|---|
-I / -MI (include) |
Force these in, even if the size heuristics would skip them. Does not narrow anything else. |
-R / -MR (restrict) |
Instrument only what matches, ignoring the size heuristics. |
-E / -ME (exclude) |
Never instrument these. Always applied, and wins over include and restrict. |
Matching rules (all verified):
- Patterns are regular expressions matched anywhere in the name (substring, not
anchored).
tinymatchestiny_aandtiny_b; write^tiny_a$for an exact match. - Several patterns after one option are OR'd:
-I tiny_a medium_bis the same as-I 'tiny_a|medium_b'. - Module patterns match the module name (the source file or binary path). Function
patterns match the function name, and also the signature when
--label argsis set (so-I '\(long int\)$'only works together with--label args). - Exclude beats include at any level:
-ME 'mod_' -I tiny_ainstruments nothing. -MR mod_ainstruments every function ofmod_a, including tiny ones and ones with loops, regardless of the size thresholds.
Gotcha: if you give both --module-restrict and --function-restrict, the function
restriction is silently ignored. -MR mod_a -R '^medium_b$' instrumented all of
mod_a, not the union the upstream docs describe. Use one of the two, or combine
-MR with -E.
Examples:
# Only one source file
rocprof-sys-instrument -o app.inst -MR 'solver\.cpp$' -- ./app
# Everything the heuristics pick, minus one noisy library
rocprof-sys-instrument -o app.inst -ME 'libm\.so' -- ./app
# Add a small function the heuristics skip
ro
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- .federated.json
- evals/evals.json
- evals/machine.yml
- skill-card.md
FAQ
Что делает скилл rocprofiler-systems-instrumenting-binaries?
Guides instrumentation with `rocprof-sys-instrument` - choosing runtime instrumentation vs binary rewrite (`-o`), including or excluding functions and modules with regex options, previewing what will be instrumented with a dry run (`--simulate`, `--dump-info`, `--print-*`), tuning granularity (`--min-instructions`, `--min-address-range`, `--instrument-loops`), rewriting libraries, and diagnosing why a function is missing from, or too numerous in, a trace. Use when the user asks about rocprof-sys-instrument, binary rewrite, instrumenting a shared library, function or module include/exclude regexes, dry runs, or the difference between a function and a module. Do NOT use to pick a `--preset` (use `choosing-a-profiling-preset`), to list settings, counters or ROCm domains (use `discovering-profiling-options`), or to attach to an already-running process (a separate tool, `rocprof-sys-attach`).
Как установить скилл rocprofiler-systems-instrumenting-binaries?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rocprofiler-systems-instrumenting-binaries запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…