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.6.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
45
46/**
47 * @brief Callback to be triggered every kernel dispatch, indicating to start and/or stop ATT
48 */
51 const rocprofiler_agent_t* agent,
52 rocprofiler_correlation_id_t correlation_id,
54 rocprofiler_dispatch_id_t dispatch_id,
55 rocprofiler_user_data_t* userdata_shader,
56 void* userdata_config);
57
58/**
59 * @brief Enables the advanced thread trace service for dispatch-based tracing.
60 * The tool has an option to enable/disable thread trace on every dispatch callback.
61 * This service enables kernel serialization.
62 * @param [in] context_id context_id.
63 * @param [in] parameters List of ATT-specific parameters.
64 * @param [in] num_parameters Number of parameters. Zero is allowed.
65 * @param [in] dispatch_callback Control fn which decides when ATT starts/stop collecting.
66 * @param [in] shader_callback Callback fn where the collected data will be sent to.
67 * @param [in] callback_userdata Passed back to user.
68 */
71 rocprofiler_context_id_t context_id,
73 size_t num_parameters,
76 void* callback_userdata) ROCPROFILER_API;
77
78/** @} */
79
80ROCPROFILER_EXTERN_C_FINI
Stores the properties of an agent (CPU, GPU, etc.)
Definition agent.h:111
rocprofiler_status_t
Status codes.
Definition fwd.h:53
uint64_t rocprofiler_dispatch_id_t
Definition fwd.h:487
uint64_t rocprofiler_kernel_id_t
Kernel identifier type.
Definition fwd.h:481
Context ID.
Definition fwd.h:539
ROCProfiler Record Correlation ID.
Definition fwd.h:555
User-assignable data type.
Definition fwd.h:514
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_START_AND_STOP
@ ROCPROFILER_ATT_CONTROL_NONE