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
= CTF plugin for ROCProfiler
13 December 2022
Philippe Proulx
This plugin writes the received ROCProfiler tracer and profiler records to
a https://diamon.org/ctf/[CTF] trace.
== Build requirements
* Python ≥ 3.10
* barectf ≥ 3.1.1 (`pip3 install barectf`)
* PyYAML (`apt-get install python3-yaml`)
* CppHeaderParser (`pip3 install CppHeaderParser`)
== Usage
Once installed, you may load this plugin with `rocprofv2` using
the `--plugin ctf` command-line arguments.
This plugin honours the `OUTPUT_PATH` environment variable which
`rocprofv2` sets with the `-d` option. If you pass `-d my-dir` to
`rocprofv2`, then the plugin will write the CTF trace to the
`my-dir/trace` directory.
IMPORTANT: This plugin performs important cleanup tasks at finalization
time, so the resulting CTF trace could be corrupted if the plugin is
never finalized.
Once the plugin is finalized, open the resulting trace directory with
either https://babeltrace.org/[Babeltrace{nbsp}2] or
https://www.eclipse.org/tracecompass/[Trace Compass] to view or analyze
it.
=== Event record types
This plugin writes to different CTF data streams having different types.
On the file system, the prefix of a data stream file name indicates the
data stream type, that is:
`roctx_`::
rocTX messages.
+
Each CTF event record is named `roctx` and corresponds to a rocTX
tracer record.
+
The fields are:
+
--
[horizontal]
`thread_id`::
Thread ID.
`id`::
rocTX ID.
`msg`::
rocTX message.
--
`hsa_api_`::
HSA API beginning and end function calls.
+
All CTF event records have the following common fields:
+
--
[horizontal]
`thread_id`::
Thread ID.
`queue_id`::
Queue ID.
`agent_id`::
Agent ID.
`correlation_id`::
Correlation ID.
--
+
For each ROCProfiler HSA API tracer record for the HSA function named
`__name__`, this plugin writes two event records:
+
`__name___begin`:::
Beginning of the function call.
+
The event record contains fields which correspond to most of the
parameters of the HSA function.
`__name___end`:::
End of the function call.
`hip_api_`::
HIP API beginning and end function calls.
+
All CTF event records have the following common fields:
+
--
[horizontal]
`thread_id`::
Thread ID.
`queue_id`::
Queue ID.
`agent_id`::
Agent ID.
`correlation_id`::
Correlation ID.
`kernel_name`::
Kernel name (empty string if not available).
--
+
For each ROCProfiler HIP API tracer record for the HIP function named
`__name__`, this plugin writes two event records:
+
`__name__Begin`:::
Beginning of the function call.
+
The event record contains fields which correspond to most of the
parameters of the HIP function.
`__name__End`:::
End of the function call.
`api_ops_`::
HSA/HIP API beginning and end operations.
+
All CTF event records have the following common fields:
+
--
[horizontal]
`thread_id`::
Thread ID.
`queue_id`::
Queue ID.
`agent_id`::
Agent ID.
`correlation_id`::
Correlation ID.
--
+
The possible CTF event records are:
+
`hsa_op_begin`:::
HSA API operation beginning.
`hsa_op_end`:::
HSA API operation end.
`hip_op_begin`:::
HIP API operation beginning.
+
Such an event record also has the field `kernel_name` which is the
kernel name (empty string if not available).
`hip_op_end`:::
HIP API operation end.
`profiler_`::
Profiler records.
+
All CTF event records have the following common fields:
+
--
[horizontal]
`dispatch`::
Dispatch ID.
`gpu_id`::
GPU ID.
`queue_id`::
Queue ID.
`queue_index`::
Queue index.
`process_id`::
Process ID.
`thread_id`::
Thread ID.
`kernel_id`::
Kernel ID.
`kernel_name`::
Kernel name (empty string if not available).
`counter_names`::
Array of counter names, each one having a corresponding integral
value in the `counter_values` field.
`counter_values`::
Array of integers, each one being the value of a counter of which
the name is a corresponding string in the `counter_names` field.
--
+
The possible CTF event records are:
+
`profiler_record`:::
Profiler record.
`profiler_record_with_kernel_properties`:::
Profiler record with kernel properties.
+
Such an event record also has the following fields:
+
--
`grid_size`::
Grid size.
`workgroup_size`::
Workgroup size.
`lds_size`::
Local memory size.
`scratch_size`::
Scratch size.
`arch_vgpr_count`::
Architecture vector general purpose register count.
`accum_vgpr_count`::
Accum. vector general purpose register count
`sgpr_count`::
Scalar general purpose register count.
`wave_size`::
Wavefront size.
`signal_handle`::
Signal handle.
--
`hsa_handles_`::
HSA handle type mappings.
+
Each CTF event record is named `hsa_handle_type` and maps an HSA handle
to a processor unit type (CPU or GPU).
+
The clock value of those event records is irrelevant (always{nbsp}0).
+
The fields are:
+
--
[horizontal]
`handle`::
HSA handle.
`type`::
Processor unit type (`CPU` or `GPU` enumeration label).
--