Environment variables for custom tools#
This page documents the environment variables that affect a custom tool built
against ROCprofiler-SDK — that is, a shared library that implements
rocprofiler_configure (see ROCprofiler-SDK tool library). It does not cover the
ROCPROF_* variables consumed by rocprofv3; those are documented separately
in the rocprofv3 how-to guides.
Only variables that are part of the public custom-tool contract are listed here. Internal SDK tuning knobs and development/test overrides are intentionally omitted: they are subject to change without notice and should not be relied on by external tools.
Variables are grouped by the role they play in a custom tool’s lifecycle.
Tool discovery and loading#
These variables control how ROCprofiler-SDK locates and loads your tool library.
At least one of the following mechanisms must be configured before the first
ROCm runtime call so that registration can discover the tool. With
ROCP_TOOL_LIBRARIES the library is dlopened by the SDK during
registration (triggered by the first ROCm runtime call); with LD_PRELOAD the
library is mapped by the dynamic loader at process start.
Variable |
Default |
Description |
|---|---|---|
|
(unset) |
Colon-separated list of absolute paths to shared libraries that export
Warning The current parser splits on |
|
(unset) |
Standard dynamic-loader mechanism. If your tool library is listed in
|
Note
ROCP_TOOL_LIBRARIES failure modes differ:
If an entry cannot be
dlopened (for example, the file does not exist or has unresolved dependencies), the SDK callsROCP_FATALand the process terminates.If an entry is loaded but does not export
rocprofiler_configure, a warning is logged and that library is simply not registered as a tool; the process continues.
Logging and diagnostics#
These variables are the first thing to reach for when debugging a custom tool that is not being loaded, not being initialized, or not receiving callbacks.
Variable |
Default |
Description |
|---|---|---|
|
|
Severity threshold for SDK log output. Accepted values:
Log messages are emitted to |
Queue interception behavior#
This variable controls how ROCprofiler-SDK intercepts HSA queue operations. It is an advanced knob: most tools do not need to set it, and the default is chosen automatically based on the services your tool enables.
Variable |
Default |
Description |
|---|---|---|
|
(auto) |
Boolean ( When unset, the SDK chooses automatically: inline interposition is enabled only when no registered context requires dispatch counter collection, thread trace (ATT), or PC sampling; otherwise the legacy path is used. If you set this to |
Beta-feature opt-in#
Tools that use beta services must enable them explicitly. Without these variables, the corresponding configuration calls return an error.
Variable |
Default |
Description |
|---|---|---|
|
|
Enables the PC sampling service. Required to call
|
|
|
Enables Streaming Performance Monitor (SPM) counter collection. |
Agent visibility#
These standard ROCm runtime variables influence which agents the SDK exposes to your tool through the agent-information API. They are not owned by ROCprofiler-SDK, but custom tools that enumerate agents need to be aware of them.
Variable |
Default |
Description |
|---|---|---|
|
(all) |
Standard ROCm runtime selector. Restricts the set of agents the runtime
— and therefore the SDK — sees. Affects iteration through
|
|
(all) |
HIP-level device selectors. These affect which agents HIP exposes but do not directly hide agents from the SDK; tools that correlate HIP device ordinals with SDK agent IDs must account for the mapping. |
Minimal worked example#
Launching an application with a custom tool libmy_tool.so and verbose SDK
logging:
export ROCP_TOOL_LIBRARIES=/path/to/libmy_tool.so
export ROCPROFILER_LOG_LEVEL=info
./my_application
Equivalent invocation using LD_PRELOAD (useful when the tool must also
intercept symbols from the target):
LD_PRELOAD=/path/to/libmy_tool.so \
ROCPROFILER_LOG_LEVEL=info \
./my_application
See also#
ROCprofiler-SDK tool library — overview of the custom tool API and
rocprofiler_configure.Implementing process attachment tools — environment considerations when attaching to an already-running process.