rocprofiler-sdk/amd_detail/thread_trace_agent.h Source File

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

Rocprofiler SDK Developer API: rocprofiler-sdk/amd_detail/thread_trace_agent.h Source File
Rocprofiler SDK Developer API 0.4.0
ROCm Profiling API and tools
thread_trace_agent.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
40/**
41 * @brief Configure Thread Trace Service for agent. There may only be one agent profile
42 * configured per context and can be only one active context that is profiling a single agent
43 * at a time. Multiple agent contexts can be started at the same time if they are profiling
44 * different agents.
45 *
46 * @param [in] context_id context id
47 * @param [in] parameters List of ATT-specific parameters.
48 * @param [in] num_parameters Number of parameters. Zero is allowed.
49 * @param [in] agent_id agent to configure profiling on.
50 * @param [in] shader_callback Callback fn where the collected data will be sent to.
51 * @param [in] callback_userdata Passed back to user.
52 */
55 rocprofiler_context_id_t context_id,
57 size_t num_parameters,
60 void* callback_userdata) ROCPROFILER_API;
61
62/** @} */
63
64ROCPROFILER_EXTERN_C_FINI
rocprofiler_status_t
Status codes.
Definition fwd.h:55
Agent Identifier.
Definition fwd.h:541
Context ID.
Definition fwd.h:502
rocprofiler_status_t rocprofiler_configure_agent_thread_trace_service(rocprofiler_context_id_t context_id, rocprofiler_att_parameter_t *parameters, unsigned long num_parameters, rocprofiler_agent_id_t agent_id, rocprofiler_att_shader_data_callback_t shader_callback, void *callback_userdata)
Configure Thread Trace Service for agent. There may only be one agent profile configured per context ...
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.