rocprofiler-sdk/amd_detail/thread_trace_dispatch.h Source File

rocprofiler-sdk/amd_detail/thread_trace_dispatch.h Source File#

Rocprofiler SDK Developer API: rocprofiler-sdk/amd_detail/thread_trace_dispatch.h Source File
Rocprofiler SDK Developer API 0.4.0
ROCm Profiling API and tools
thread_trace_dispatch.h
Go to the documentation of this file.
1// MIT License
2//
3// Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
4//
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in all
13// copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21// SOFTWARE.
22
23#pragma once
24
28#include <rocprofiler-sdk/fwd.h>
29#include <rocprofiler-sdk/hsa.h>
30
31ROCPROFILER_EXTERN_C_INIT
32
33/**
34 * @defgroup THREAD_TRACE Thread Trace Service
35 * @brief Provides API calls to enable and handle thread trace data
36 *
37 * @{
38 */
39
47
48/**
49 * @brief Callback to be triggered every kernel dispatch, indicating to start and/or stop ATT
50 */
53 const rocprofiler_agent_t* agent,
54 rocprofiler_correlation_id_t correlation_id,
56 rocprofiler_dispatch_id_t dispatch_id,
57 rocprofiler_user_data_t* userdata_shader,
58 void* userdata_config);
59
60/**
61 * @brief Enables the advanced thread trace service for dispatch-based tracing.
62 * The tool has an option to enable/disable thread trace on every dispatch callback.
63 * This service enables kernel serialization.
64 * @param [in] context_id context_id.
65 * @param [in] parameters List of ATT-specific parameters.
66 * @param [in] num_parameters Number of parameters. Zero is allowed.
67 * @param [in] dispatch_callback Control fn which decides when ATT starts/stop collecting.
68 * @param [in] shader_callback Callback fn where the collected data will be sent to.
69 * @param [in] callback_userdata Passed back to user.
70 */
73 rocprofiler_context_id_t context_id,
75 size_t num_parameters,
78 void* callback_userdata) ROCPROFILER_API;
79
80/** @} */
81
82ROCPROFILER_EXTERN_C_FINI
Stores the properties of an agent (CPU, GPU, etc.)
Definition agent.h:111
rocprofiler_status_t
Status codes.
Definition fwd.h:55
uint64_t rocprofiler_dispatch_id_t
Definition fwd.h:460
uint64_t rocprofiler_kernel_id_t
Kernel identifier type.
Definition fwd.h:454
Context ID.
Definition fwd.h:502
ROCProfiler Record Correlation ID.
Definition fwd.h:518
User-assignable data type.
Definition fwd.h:487
rocprofiler_att_control_flags_t
rocprofiler_att_control_flags_t(* rocprofiler_att_dispatch_callback_t)(rocprofiler_queue_id_t queue_id, const rocprofiler_agent_t *agent, rocprofiler_correlation_id_t correlation_id, rocprofiler_kernel_id_t kernel_id, rocprofiler_dispatch_id_t dispatch_id, rocprofiler_user_data_t *userdata_shader, void *userdata_config)
Callback to be triggered every kernel dispatch, indicating to start and/or stop ATT.
rocprofiler_status_t rocprofiler_configure_dispatch_thread_trace_service(rocprofiler_context_id_t context_id, rocprofiler_att_parameter_t *parameters, unsigned long num_parameters, rocprofiler_att_dispatch_callback_t dispatch_callback, rocprofiler_att_shader_data_callback_t shader_callback, void *callback_userdata)
Enables the advanced thread trace service for dispatch-based tracing. The tool has an option to enabl...
void(* rocprofiler_att_shader_data_callback_t)(int64_t shader_engine_id, void *data, unsigned long data_size, rocprofiler_user_data_t userdata)
Callback to be triggered every time some ATT data is generated by the device.
@ ROCPROFILER_ATT_CONTROL_STOP
@ ROCPROFILER_ATT_CONTROL_START_AND_STOP
@ ROCPROFILER_ATT_CONTROL_NONE
@ ROCPROFILER_ATT_CONTROL_START