rocprofiler-sdk/callback_tracing.h Source File

rocprofiler-sdk/callback_tracing.h Source File#

ROCprofiler-SDK developer API: rocprofiler-sdk/callback_tracing.h Source File
ROCprofiler-SDK developer API 1.0.0
ROCm Profiling API and tools
callback_tracing.h
1// MIT License
2//
3// Copyright (c) 2023-2025 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
25#include <rocprofiler-sdk/defines.h>
26#include <rocprofiler-sdk/fwd.h>
27#include <rocprofiler-sdk/hip.h>
28#include <rocprofiler-sdk/hsa.h>
29#include <rocprofiler-sdk/marker.h>
30#include <rocprofiler-sdk/ompt.h>
31#include <rocprofiler-sdk/rccl.h>
32#include <rocprofiler-sdk/rocdecode.h>
33#include <rocprofiler-sdk/rocjpeg.h>
34
35#include <hsa/hsa.h>
36#include <hsa/hsa_amd_tool.h>
37#include <hsa/hsa_ext_amd.h>
38#include <hsa/hsa_ven_amd_loader.h>
39
40#include <stdint.h>
41
42ROCPROFILER_EXTERN_C_INIT
43
44/**
45 * @defgroup CALLBACK_TRACING_SERVICE Synchronous Tracing Services
46 * @brief Receive immediate callbacks on the calling thread
47 *
48 * @{
49 */
50
51/**
52 * @brief ROCProfiler Enumeration for code object storage types (identical values to
53 * `hsa_ven_amd_loader_code_object_storage_type_t` enumeration)
54 */
56{
57 ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_NONE = HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_NONE,
58 ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_FILE = HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_FILE,
59 ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_MEMORY =
60 HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_MEMORY,
61 ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_LAST,
63
64/**
65 * @brief ROCProfiler HSA API Callback Data.
66 */
68{
69 uint64_t size; ///< size of this struct
70 rocprofiler_hsa_api_args_t args;
71 rocprofiler_hsa_api_retval_t retval;
73
74/**
75 * @brief ROCProfiler HIP runtime and compiler API Tracer Callback Data.
76 */
78{
79 uint64_t size; ///< size of this struct
80 rocprofiler_hip_api_args_t args;
81 rocprofiler_hip_api_retval_t retval; ///< return value of function call
82
83 /// @var args
84 /// @brief Arguments of the function call. @see
85 /// ::rocprofiler_iterate_callback_tracing_kind_operation_args for generic
86 /// access/stringification of the arguments.
88
89/**
90 * @brief ROCProfiler OMPT Callback Data
91 */
93{
94 uint64_t size; ///< size of this struct
95 rocprofiler_ompt_args_t args;
97
98/**
99 * @brief ROCProfiler Marker Tracer Callback Data.
100 */
102{
103 uint64_t size; ///< size of this struct
104 rocprofiler_marker_api_args_t args;
105 rocprofiler_marker_api_retval_t retval;
107
108/**
109 * @brief ROCProfiler RCCL API Callback Data.
110 */
112{
113 uint64_t size; ///< size of this struct
114 rocprofiler_rccl_api_args_t args;
115 rocprofiler_rccl_api_retval_t retval;
117
118/**
119 * @brief ROCProfiler rocDecode API Callback Data.
120 */
122{
123 uint64_t size; ///< size of this struct
124 rocprofiler_rocdecode_api_args_t args;
125 rocprofiler_rocdecode_api_retval_t retval;
127
128/**
129 * @brief ROCProfiler rocJPEG API Callback Data.
130 */
132{
133 uint64_t size; ///< size of this struct
134 rocprofiler_rocjpeg_api_args_t args;
135 rocprofiler_rocjpeg_api_retval_t retval;
137
138/**
139 * @brief ROCProfiler Code Object Load Tracer Callback Record.
140 */
142{
143 uint64_t size; ///< size of this struct
144 uint64_t code_object_id; ///< unique code object identifier
145 union
146 {
147 rocprofiler_agent_id_t rocp_agent; ///< Deprecated. Renamed to agent_id
148 rocprofiler_agent_id_t agent_id; ///< The agent on which this loaded code object is loaded
149 };
150 hsa_agent_t hsa_agent; ///< Deprecated. The agent on which this loaded code object is loaded
151 const char* uri; ///< The URI name from which the code object was loaded
152 uint64_t load_base;
153 uint64_t load_size;
154 int64_t load_delta;
156
157 /// @var load_base
158 /// @brief The base memory address at which the code object is loaded. This is the base address
159 /// of the allocation for the lowest addressed segment of the code object that is loaded. Note
160 /// that any non-loaded segments before the first loaded segment are ignored.
161 ///
162 /// @var load_size
163 /// @brief The byte size of the loaded code objects contiguous memory allocation.
164 ///
165 /// @var load_delta
166 /// @brief The signed byte address difference of the memory address at which the code object is
167 /// loaded minus the virtual address specified in the code object that is loaded.
168 ///
169 /// @var storage_type
170 /// @brief storage type of the code object reader used to load the loaded code object
171 ///
172
173 union
174 {
175 struct
176 {
177 int storage_file; ///< file descriptor of the code object that was loaded. Access this
178 ///< field if ::rocprofiler_code_object_storage_type_t is
179 ///< ::ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_FILE
180 };
181 struct
182 {
183 uint64_t memory_base; ///< The memory address of the first byte of the code object that
184 ///< was loaded. Access this
185 ///< field if ::rocprofiler_code_object_storage_type_t is
186 ///< ::ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_MEMORY
187 uint64_t
188 memory_size; ///< The memory size in bytes of the code object that was loaded.
189 ///< Access this field if ::rocprofiler_code_object_storage_type_t is
190 ///< ::ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_MEMORY
191 };
192 };
194
195/**
196 * @brief The NULL value of a code object id. Used when code object is unknown.
197 */
198#define ROCPROFILER_CODE_OBJECT_ID_NONE ROCPROFILER_UINT64_C(0)
199
200/**
201 * @brief ROCProfiler Code Object Kernel Symbol Tracer Callback Record.
202 *
203 */
205{
206 uint64_t size; ///< size of this struct
207 uint64_t kernel_id; ///< unique symbol identifier value
208 uint64_t code_object_id; ///< parent unique code object identifier
209 const char* kernel_name; ///< name of the kernel
215 uint32_t sgpr_count; ///< Scalar general purpose register count
216 uint32_t arch_vgpr_count; ///< Architecture vector general purpose register count
217 uint32_t accum_vgpr_count; ///< Accum vector general purpose register count
220
221 /// @var kernel_object
222 /// @brief kernel object handle, used in the kernel dispatch packet
223 ///
224 /// @var kernarg_segment_size
225 /// @brief size of memory (in bytes) allocated for kernel arguments. Will be multiple of 16
226 ///
227 /// @var kernarg_segment_alignment
228 /// @brief Alignment (in bytes) of the buffer used to pass arguments to the kernel
229 ///
230 /// @var group_segment_size
231 /// @brief Size of static group segment memory required by the kernel (per work-group), in
232 /// bytes. AKA: LDS size
233 ///
234 /// @var private_segment_size
235 /// @brief Size of static private, spill, and arg segment memory required by this kernel (per
236 /// work-item), in bytes. AKA: scratch size
237 ///
238 /// @var kernel_code_entry_byte_offset
239 /// @brief Relative offset from kernel_object address to calculate the first address of a
240 /// kernel.
241 ///
242 /// @var kernel_address
243 /// @brief The first address of a kernel. Useful for PC sampling.
244 ///
246// rename struct
247
248typedef struct rocprofiler_callback_tracing_code_object_host_kernel_symbol_register_data_t
249{
250 uint64_t size; ///< size of this struct
251 uint64_t host_function_id; ///< unique host function identifier value
252 uint64_t kernel_id; ///< unique symbol identifier value
253 uint64_t code_object_id; ///< parent unique code object identifier
254 rocprofiler_address_t host_function; ///< kernel host function pointer
255 rocprofiler_address_t modules; ///< reference address where modules will be loaded
256 const char* device_function;
257 uint32_t thread_limit; ///< thread limit
258 rocprofiler_dim3_t thread_ids; ///< thread ids address
259 rocprofiler_dim3_t block_ids; ///< block ids address
260 rocprofiler_dim3_t block_dims; ///< block dimensions address
261 rocprofiler_dim3_t grid_dims; ///< grid dimensions address
262 uint64_t workgroup_size; ///< workgroup size address
263
264 /// @var device_function
265 /// @brief device function name used to map the metadata during kernel launch
266} rocprofiler_callback_tracing_code_object_host_kernel_symbol_register_data_t;
267
268/**
269 * @brief ROCProfiler Kernel Dispatch Callback Tracer Record.
270 *
271 */
279
280/**
281 * @brief ROCProfiler Memory Copy Callback Tracer Record.
282 *
283 * The timestamps in this record will only be non-zero in the ::ROCPROFILER_CALLBACK_PHASE_EXIT
284 * callback
285 */
287{
288 uint64_t size; ///< size of this struct
289 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
290 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
291 rocprofiler_agent_id_t dst_agent_id; ///< destination agent of copy
292 rocprofiler_agent_id_t src_agent_id; ///< source agent of copy
293 uint64_t bytes; ///< bytes copied
294 rocprofiler_address_t dst_address; ///< destination address
297
298/**
299 * @brief ROCProfiler Memory Allocation Tracer Record.
300 */
302{
303 uint64_t size; ///< size of this struct
304 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
305 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
306 rocprofiler_agent_id_t agent_id; ///< agent id for memory allocation
307 rocprofiler_address_t address; ///< starting address for memory allocation
308 uint64_t allocation_size; ///< size of memory allocation
310
311/**
312 * @brief ROCProfiler Scratch Memory Callback Data.
313 */
315{
316 uint64_t size; ///< size of this struct
317 rocprofiler_agent_id_t agent_id;
318 rocprofiler_queue_id_t queue_id;
319 rocprofiler_scratch_alloc_flag_t flags;
320 hsa_amd_tool_event_kind_t args_kind;
321 rocprofiler_scratch_memory_args_t args;
323
324/**
325 * @brief ROCProfiler Runtime Initialization Data.
326 */
328{
329 uint64_t size; ///< size of this struct
330 uint64_t version;
331 uint64_t instance; ///< Number of times this runtime had been loaded previously
332
333 /// @var version
334 /// @brief The version number of the library
335 ///
336 /// Version number is encoded as: (10000 * MAJOR) + (100 * MINOR) + PATCH
338
339/**
340 * @brief ROCProfiler Stream Handle Callback Data.
341 */
348
349/**
350 * @brief API Tracing callback function. This function is invoked twice per API function: once
351 * before the function is invoked and once after the function is invoked. The external correlation
352 * id value within the record is assigned the value at the top of the external correlation id stack.
353 * It is permissible to invoke ::rocprofiler_push_external_correlation_id within the enter phase;
354 * when a new external correlation id is pushed during the enter phase, rocprofiler will use that
355 * external correlation id for any async events and provide the new external correlation id during
356 * the exit callback... In other words, pushing a new external correlation id within the enter
357 * callback will result in that external correlation id value in the exit callback (which may or may
358 * not be different from the external correlation id value in the enter callback). If a tool pushes
359 * new external correlation ids in the enter phase, it is recommended to pop the external
360 * correlation id in the exit callback.
361 *
362 * @param [in] record Callback record data
363 * @param [in,out] user_data This paramter can be used to retain information in between the enter
364 * and exit phases.
365 * @param [in] callback_data User data provided when configuring the callback tracing service
366 */
368 rocprofiler_user_data_t* user_data,
369 void* callback_data) ROCPROFILER_NONNULL(2);
370
371/**
372 * @brief Callback function for mapping ::rocprofiler_callback_tracing_kind_t ids to
373 * string names. @see rocprofiler_iterate_callback_tracing_kind_names.
374 */
376 void* data);
377
378/**
379 * @brief Callback function for mapping the operations of a given
380 * ::rocprofiler_callback_tracing_kind_t to string names. @see
381 * rocprofiler_iterate_callback_tracing_kind_operation_names.
382 */
386 void* data);
387
388/**
389 * @brief Callback function for iterating over the function arguments to a traced function.
390 * This function will be invoked for each argument.
391 * @see rocprofiler_iterate_callback_tracing_operation_args
392 *
393 * @param [in] kind domain
394 * @param [in] operation associated domain operation
395 * @param [in] arg_number the argument number, starting at zero
396 * @param [in] arg_value_addr the address of the argument stored by rocprofiler.
397 * @param [in] arg_indirection_count the total number of indirection levels for the argument, e.g.
398 * int == 0, int* == 1, int** == 2
399 * @param [in] arg_type the typeid name of the argument
400 * @param [in] arg_name the name of the argument in the prototype (or rocprofiler union)
401 * @param [in] arg_value_str conversion of the argument to a string, e.g. operator<< overload
402 * @param [in] arg_dereference_count the number of times the argument was dereferenced when it was
403 * converted to a string
404 * @param [in] data user data
405 */
409 uint32_t arg_number,
410 const void* const arg_value_addr,
411 int32_t arg_indirection_count,
412 const char* arg_type,
413 const char* arg_name,
414 const char* arg_value_str,
415 int32_t arg_dereference_count,
416 void* data);
417
418/**
419 * @brief Configure Callback Tracing Service. The callback tracing service provides two synchronous
420 * callbacks around an API function on the same thread as the application which is invoking the API
421 * function. This function can only be invoked once per ::rocprofiler_callback_tracing_kind_t value,
422 * i.e. it can be invoked once for the HSA API, once for the HIP API, and so on but it will fail if
423 * it is invoked for the HSA API twice. Please note, the callback API does have the potentially
424 * non-trivial overhead of copying the function arguments into the record. If you are willing to let
425 * rocprofiler record the timestamps, do not require synchronous notifications of the API calls, and
426 * want to lowest possible overhead, use the
427 * @see BUFFER_TRACING_SERVICE.
428 *
429 * @param [in] context_id Context to associate the service with
430 * @param [in] kind The domain of the callback tracing service
431 * @param [in] operations Array of operations in the domain (i.e. enum values which identify
432 * specific API functions). If this is null, all API functions in the domain will be traced
433 * @param [in] operations_count If the operations array is non-null, set this to the size of the
434 * array.
435 * @param [in] callback The function to invoke before and after an API function
436 * @param [in] callback_args Data provided to every invocation of the callback function
437 * @return ::rocprofiler_status_t
438 * @retval ::ROCPROFILER_STATUS_ERROR_CONFIGURATION_LOCKED Invoked outside of the initialization
439 * function in ::rocprofiler_tool_configure_result_t provided to rocprofiler via
440 * ::rocprofiler_configure function
441 * @retval ::ROCPROFILER_STATUS_ERROR_CONTEXT_NOT_FOUND The provided context is not valid/registered
442 * @retval ::ROCPROFILER_STATUS_ERROR_SERVICE_ALREADY_CONFIGURED if the same
443 * ::rocprofiler_callback_tracing_kind_t value is provided more than once (per context) -- in other
444 * words, we do not support overriding or combining the operations in separate function calls.
445 *
446 */
450 const rocprofiler_tracing_operation_t* operations,
451 size_t operations_count,
453 void* callback_args) ROCPROFILER_API;
454
455/**
456 * @brief Query the name of the callback tracing kind. The name retrieved from this function is a
457 * string literal that is encoded in the read-only section of the binary (i.e. it is always
458 * "allocated" and never "deallocated").
459 *
460 * @param [in] kind Callback tracing domain
461 * @param [out] name If non-null and the name is a constant string that does not require dynamic
462 * allocation, this paramter will be set to the address of the string literal, otherwise it will
463 * be set to nullptr
464 * @param [out] name_len If non-null, this will be assigned the length of the name (regardless of
465 * the name is a constant string or requires dynamic allocation)
466 * @return ::rocprofiler_status_t
467 */
470 const char** name,
471 uint64_t* name_len) ROCPROFILER_API;
472
473/**
474 * @brief Query the name of the callback tracing kind. The name retrieved from this function is a
475 * string literal that is encoded in the read-only section of the binary (i.e. it is always
476 * "allocated" and never "deallocated").
477 *
478 * @param [in] kind Callback tracing domain
479 * @param [in] operation Enumeration id value which maps to a specific API function or event type
480 * @param [out] name If non-null and the name is a constant string that does not require dynamic
481 * allocation, this paramter will be set to the address of the string literal, otherwise it will
482 * be set to nullptr
483 * @param [out] name_len If non-null, this will be assigned the length of the name (regardless of
484 * the name is a constant string or requires dynamic allocation)
485 * @return ::rocprofiler_status_t
486 * @retval ::ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUND Domain id is not valid
487 * @retval ::ROCPROFILER_STATUS_SUCCESS Valid domain provided, regardless if there is a constant
488 * string or not.
489 */
493 const char** name,
494 uint64_t* name_len) ROCPROFILER_API;
495
496/**
497 * @brief Iterate over all the mappings of the callback tracing kinds and get a callback for each
498 * kind.
499 *
500 * @param [in] callback Callback function invoked for each enumeration value in
501 * ::rocprofiler_callback_tracing_kind_t with the exception of the `NONE` and `LAST` values.
502 * @param [in] data User data passed back into the callback
503 * @return ::rocprofiler_status_t
504 */
507 void* data) ROCPROFILER_API ROCPROFILER_NONNULL(1);
508
509/**
510 * @brief Iterates over all the mappings of the operations for a given
511 * ::rocprofiler_callback_tracing_kind_t and invokes the callback with the kind id, operation id,
512 * and user-provided data.
513 *
514 * @param [in] kind which tracing callback kind operations to iterate over
515 * @param [in] callback Callback function invoked for each operation associated with
516 * ::rocprofiler_callback_tracing_kind_t with the exception of the `NONE` and `LAST` values.
517 * @param [in] data User data passed back into the callback
518 * @return ::rocprofiler_status_t
519 * @retval ::ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUND Invalid domain id
520 * @retval ::ROCPROFILER_STATUS_SUCCESS Valid domain
521 */
526 void* data) ROCPROFILER_API ROCPROFILER_NONNULL(2);
527
528/**
529 * @brief Iterates over all the arguments for the traced function (when available). This is
530 * particularly useful when tools want to annotate traces with the function arguments. See
531 * @example samples/api_callback_tracing/client.cpp for a usage example.
532 *
533 * It is recommended to use this function when the record phase is ::ROCPROFILER_CALLBACK_PHASE_EXIT
534 * or ::ROCPROFILER_CALLBACK_PHASE_NONE. When the phase is ::ROCPROFILER_CALLBACK_PHASE_ENTER, the
535 * function may have output parameters which have not set. In the case of an output parameter with
536 * one level of indirection, e.g. `int* output_len`, this is considered safe since the output
537 * parameter is either null or, in the worst case scenario, pointing to an uninitialized value which
538 * will result in garbage values to be stringified. However, if the output parameter has more than
539 * one level of indirection, e.g. `const char** output_name`, this can result in a segmentation
540 * fault because the dereferenced output parameter may be uninitialized and point to an invalid
541 address. E.g.:
542 *
543 * @code{.cpp}
544 * struct dim3
545 * {
546 * int x;
547 * int y;
548 * int z;
549 * };
550 *
551 * static dim3 default_dims = {.x = 1, .y = 1, .z = 1};
552 *
553 * void set_dim_x(int val, dim3* output_dims) { output_dims->x = val; }
554 *
555 * void get_default_dims(dim3** output_dims) { *output_dims = default_dims; }
556 *
557 * int main()
558 * {
559 * dim3 my_dims; // uninitialized value. x, y, and z may be set to random values
560 * dim3* current_dims; // uninitialized pointer. May be set to invalid address
561 *
562 * set_dim_x(3, &my_dims); // if rocprofiler-sdk wrapped this function and tried to stringify
563 * // in the enter phase, dereferencing my_dims is not problematic
564 * // since there is an actual dim3 allocation
565 *
566 * get_default_dims(&current_dims); // if rocprofiler-sdk wrapped this function,
567 * // and tried to stringify in the enter phase,
568 * // current_dims may point to an address outside
569 * // of the address space of this process and
570 * // cause a segfault
571 * }
572 * @endcode
573 *
574 *
575 * @param[in] record Record provided by service callback
576 * @param[in] callback The callback function which will be invoked for each argument
577 * @param[in] max_dereference_count In the callback enter phase, certain arguments may be output
578 * parameters which have not been set. When the output parameter has multiple levels of indirection,
579 * it may be invalid to dereference the output parameter more than once and doing so may result in a
580 * segmentation fault. Thus, it is recommended to set this parameter to a maximum value of 1 when
581 * the phase is ::ROCPROFILER_CALLBACK_PHASE_ENTER to ensure that output parameters which point to
582 * uninitialized pointers do not cause segmentation faults.
583 * @param[in] user_data Data to be passed to each invocation of the callback
584 */
586rocprofiler_iterate_callback_tracing_kind_operation_args(
589 int32_t max_dereference_count,
590 void* user_data) ROCPROFILER_API ROCPROFILER_NONNULL(2);
591
592/** @} */
593
594ROCPROFILER_EXTERN_C_FINI
int32_t rocprofiler_tracing_operation_t
Tracing Operation ID. Depending on the kind, operations can be determined. If the value is equal to z...
Definition fwd.h:516
rocprofiler_status_t
Status codes.
Definition fwd.h:49
uint64_t rocprofiler_timestamp_t
ROCProfiler Timestamp.
Definition fwd.h:502
rocprofiler_callback_tracing_kind_t
Service Callback Tracing Kind.
Definition fwd.h:152
Agent Identifier.
Definition fwd.h:677
Context ID.
Definition fwd.h:600
Multi-dimensional struct of data used to describe GPU workgroup and grid sizes.
Definition fwd.h:702
ROCProfiler kernel dispatch information.
Definition fwd.h:793
Stores memory address for profiling.
Definition fwd.h:565
User-assignable data type.
Definition fwd.h:555
uint64_t version
The version number of the library.
uint32_t group_segment_size
Size of static group segment memory required by the kernel (per work-group), in bytes....
rocprofiler_hip_api_retval_t retval
return value of function call
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
uint32_t kernarg_segment_alignment
Alignment (in bytes) of the buffer used to pass arguments to the kernel.
uint64_t code_object_id
unique code object identifier
rocprofiler_code_object_storage_type_t storage_type
storage type of the code object reader used to load the loaded code object
uint32_t arch_vgpr_count
Architecture vector general purpose register count.
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_kernel_dispatch_info_t dispatch_info
Dispatch info.
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
uint32_t accum_vgpr_count
Accum vector general purpose register count.
rocprofiler_agent_id_t agent_id
agent id for memory allocation
uint64_t kernel_object
kernel object handle, used in the kernel dispatch packet
uint32_t private_segment_size
Size of static private, spill, and arg segment memory required by this kernel (per work-item),...
uint64_t instance
Number of times this runtime had been loaded previously.
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
hsa_agent_t hsa_agent
Deprecated. The agent on which this loaded code object is loaded.
rocprofiler_address_t kernel_address
The first address of a kernel. Useful for PC sampling.
rocprofiler_stream_id_t stream_id
HIP stream ID.
uint64_t load_base
The base memory address at which the code object is loaded. This is the base address of the allocatio...
uint64_t load_size
The byte size of the loaded code objects contiguous memory allocation.
rocprofiler_hip_api_args_t args
Arguments of the function call.
int64_t load_delta
The signed byte address difference of the memory address at which the code object is loaded minus the...
rocprofiler_address_t dst_address
destination address
uint32_t kernarg_segment_size
size of memory (in bytes) allocated for kernel arguments. Will be multiple of 16
int64_t kernel_code_entry_byte_offset
Relative offset from kernel_object address to calculate the first address of a kernel.
rocprofiler_address_t address
starting address for memory allocation
const char * uri
The URI name from which the code object was loaded.
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_address_t stream_value
HIP stream value.
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_address_t src_address
source address
rocprofiler_agent_id_t dst_agent_id
destination agent of copy
rocprofiler_agent_id_t src_agent_id
source agent of copy
rocprofiler_status_t rocprofiler_query_callback_tracing_kind_operation_name(rocprofiler_callback_tracing_kind_t kind, rocprofiler_tracing_operation_t operation, const char **name, uint64_t *name_len)
Query the name of the callback tracing kind. The name retrieved from this function is a string litera...
int(* rocprofiler_callback_tracing_kind_cb_t)(rocprofiler_callback_tracing_kind_t kind, void *data)
Callback function for mapping rocprofiler_callback_tracing_kind_t ids to string names.
int(* rocprofiler_callback_tracing_kind_operation_cb_t)(rocprofiler_callback_tracing_kind_t kind, rocprofiler_tracing_operation_t operation, void *data)
Callback function for mapping the operations of a given rocprofiler_callback_tracing_kind_t to string...
int(* rocprofiler_callback_tracing_operation_args_cb_t)(rocprofiler_callback_tracing_kind_t kind, rocprofiler_tracing_operation_t operation, uint32_t arg_number, const void *const arg_value_addr, int32_t arg_indirection_count, const char *arg_type, const char *arg_name, const char *arg_value_str, int32_t arg_dereference_count, void *data)
Callback function for iterating over the function arguments to a traced function. This function will ...
rocprofiler_status_t rocprofiler_configure_callback_tracing_service(rocprofiler_context_id_t context_id, rocprofiler_callback_tracing_kind_t kind, const rocprofiler_tracing_operation_t *operations, unsigned long operations_count, rocprofiler_callback_tracing_cb_t callback, void *callback_args)
Configure Callback Tracing Service. The callback tracing service provides two synchronous callbacks a...
rocprofiler_status_t rocprofiler_query_callback_tracing_kind_name(rocprofiler_callback_tracing_kind_t kind, const char **name, uint64_t *name_len)
Query the name of the callback tracing kind. The name retrieved from this function is a string litera...
rocprofiler_code_object_storage_type_t
ROCProfiler Enumeration for code object storage types (identical values to hsa_ven_amd_loader_code_ob...
rocprofiler_status_t rocprofiler_iterate_callback_tracing_kind_operations(rocprofiler_callback_tracing_kind_t kind, rocprofiler_callback_tracing_kind_operation_cb_t callback, void *data)
Iterates over all the mappings of the operations for a given rocprofiler_callback_tracing_kind_t and ...
rocprofiler_status_t rocprofiler_iterate_callback_tracing_kinds(rocprofiler_callback_tracing_kind_cb_t callback, void *data)
Iterate over all the mappings of the callback tracing kinds and get a callback for each kind.
void(* rocprofiler_callback_tracing_cb_t)(rocprofiler_callback_tracing_record_t record, rocprofiler_user_data_t *user_data, void *callback_data)
API Tracing callback function. This function is invoked twice per API function: once before the funct...
ROCProfiler Code Object Kernel Symbol Tracer Callback Record.
ROCProfiler Code Object Load Tracer Callback Record.
ROCProfiler HIP runtime and compiler API Tracer Callback Data.
ROCProfiler Stream Handle Callback Data.
ROCProfiler HSA API Callback Data.
ROCProfiler Kernel Dispatch Callback Tracer Record.
ROCProfiler Marker Tracer Callback Data.
ROCProfiler Memory Allocation Tracer Record.
ROCProfiler Memory Copy Callback Tracer Record.
ROCProfiler OMPT Callback Data.
ROCProfiler RCCL API Callback Data.
ROCProfiler rocDecode API Callback Data.
ROCProfiler rocJPEG API Callback Data.
ROCProfiler Scratch Memory Callback Data.