Files
TheRock/rocm-systems/projects/rocprof-trace-decoder/samples/README.md
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

1.6 KiB

Python API Samples

These samples use the public rocprof_trace_decoder Python API directly. They take ATT files and code-object files as inputs, build the ISA provider in memory from the code objects, decode the ATT buffers, and print or plot results.

Install the Python package first, or run from the source tree with PYTHONPATH=python. Plotting samples require matplotlib and numpy.

The plotting samples write their PNG output to the current directory by default. Use -d DIR to choose a different output directory.

The public API does not infer code-object IDs from filenames. These sample scripts are command-line wrappers, so their input parser derives IDs from common rocprofiler capture filenames before constructing explicit CodeObject values. If exactly one code object has no inferred ID, these samples use ID 0. Multiple unnamed code objects are rejected because their IDs are ambiguous.

ISA Hotspots

Print the top 30 instructions by latency + idle:

PYTHONPATH=python python3 samples/isa_hotspots.py \
  captures/*.att \
  captures/*_code_object_id_*.out

Occupancy And Registers

Write occupancy_resources.png with active wave count plus active SGPR/VGPR allocation over time:

PYTHONPATH=python python3 samples/plot_occupancy_resources.py \
  captures/*.att \
  captures/*_code_object_id_*.out

Wave Lifetime

Write wave_lifetime.png plotting wave lifetime against s_wait* latency, non-VALU latency, VALU latency, and idle time:

PYTHONPATH=python python3 samples/plot_wave_lifetime.py \
  captures/*.att \
  captures/*_code_object_id_*.out