﻿# ROCprofiler thread trace: wave timing, missing data and instruction cycles

Interpret ROCprofiler thread traces with dispatch and compute-unit selection, architecture-specific cycle totals, decoder quality events and tracing-induced serialization.

Author: Retrivium editorial team
Updated: 2026-11-05
Canonical URL: https://retrivium.ai/journal/rocprofiler-thread-trace-wave-cycles-capture-loss-boundaries/
Language: en

ROCprofiler thread trace examines how selected GPU waves execute instructions. Its detail is useful only with a clear capture scope. A large instruction-latency total, an empty statistics file and a long application response are different observations; none should be substituted for the others without checking which dispatches and execution resources were traced.

## Preserve the selected dispatch and execution resources

The reviewed [versioned thread-trace guide](https://rocm.docs.amd.com/projects/rocprofiler-sdk/en/docs-7.14.0/how-to/using-thread-trace.html) describes instruction timing, scheduling and stall analysis for selected kernel executions. The trace is constrained by compute-unit, shader-engine and SIMD selection, rather than automatically describing every wave on the GPU.

The guide explains that a valid dispatch can produce an empty statistics file if no wave reaches the selected compute unit. That is a collection-scope explanation, not evidence that the application did no GPU work. A useful record therefore includes the dispatch identity, iteration, device and selection parameters before interpreting either present or absent events.

## Interpret cycles according to the architecture

The statistics reference distinguishes Hitcount, Latency, Stall and Idle. Hitcount adds executions across traced waves. Latency is expressed in cycles and defined differently for gfx9 versus gfx10 and later, using issue time or execute time alongside stall time.

These accumulated values are not automatically elapsed kernel time or request latency. Summing instruction rows without accounting for overlap can construct a duration that never occurred on the wall clock. Keep the clock domain and aggregation rule attached to the number. A kernel-level explanation should then be connected to the surrounding application timeline before it becomes an end-to-end performance claim.

## Decode with code-object and data-quality evidence

The [decoder API documentation](https://rocm.docs.amd.com/projects/rocprofiler-sdk/en/docs-7.14.0/api-reference/thread_trace.html) requires the relevant code-object information to interpret instruction addresses. It separately describes data-loss events and incomplete instruction stitching. A decoded address that cannot be resolved is not automatically an unknown application function or proof of a compiler bug.

The API also recommends deferred processing because capture can generate data faster than decoding consumes it. Buffer capacity, selected resources and enabled counters therefore belong to the measurement record. A larger buffer can reduce a collection problem while consuming more device memory; it does not establish that the underlying workload became faster.

## Keep tracing-induced scheduling separate from ordinary execution

The API distinguishes dispatch tracing from device tracing and describes serialization behavior, including an option to serialize otherwise untraced kernels. Changing concurrency changes the observed workload. A trace collected under that condition is useful for instruction analysis but cannot silently replace the application's normal overlapping execution profile.

The [correlation-record guide](/journal/fg2-rocprofiler-correlation-record-delivery-not-event-order/) explains delayed delivery, and the [profiler-method guide](/journal/learn-gpu-profiler-sampling-instrumentation/) addresses measurement scope. We read documentation and collected no GPU trace. The intended outcome is an inspectable instruction-level observation with its selection and loss conditions, followed by a separately measured application comparison, rather than a speedup inferred directly from a hotspot table.

## Sources

- [Versioned ROCprofiler thread-trace guide](https://rocm.docs.amd.com/projects/rocprofiler-sdk/en/docs-7.14.0/how-to/using-thread-trace.html).
- [Versioned thread-trace service and decoder API](https://rocm.docs.amd.com/projects/rocprofiler-sdk/en/docs-7.14.0/api-reference/thread_trace.html).
