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 0.6.0
ROCm Profiling API and tools
callback_tracing.h
Go to the documentation of this file.
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
26#include <rocprofiler-sdk/fwd.h>
27#include <rocprofiler-sdk/hip.h>
28#include <rocprofiler-sdk/hsa.h>
33
34#include <hsa/hsa.h>
35#include <hsa/hsa_amd_tool.h>
36#include <hsa/hsa_ext_amd.h>
37#include <hsa/hsa_ven_amd_loader.h>
38
39#include <stdint.h>
40
41ROCPROFILER_EXTERN_C_INIT
42
43/**
44 * @defgroup CALLBACK_TRACING_SERVICE Synchronous Tracing Services
45 * @brief Receive immediate callbacks on the calling thread
46 *
47 * @{
48 */
49
50/**
51 * @brief ROCProfiler Enumeration for code object storage types (identical values to
52 * `hsa_ven_amd_loader_code_object_storage_type_t` enumeration)
53 */
54typedef enum
55{
56 ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_NONE = HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_NONE,
57 ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_FILE = HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_FILE,
59 HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_MEMORY,
62
63/**
64 * @brief ROCProfiler HSA API Callback Data.
65 */
72
73/**
74 * @brief ROCProfiler HIP runtime and compiler API Tracer Callback Data.
75 */
82
83/**
84 * @brief ROCProfiler OMPT Callback Data
85 */
86typedef struct
87{
88 uint64_t size; ///< size of this struct
91
92/**
93 * @brief ROCProfiler Marker Tracer Callback Data.
94 */
101
102/**
103 * @brief ROCProfiler RCCL API Callback Data.
104 */
111
112/**
113 * @brief ROCProfiler ROCDecode API Callback Data.
114 */
121
122/**
123 * @brief ROCProfiler Code Object Load Tracer Callback Record.
124 */
125typedef struct
126{
127 uint64_t size; ///< size of this struct
128 uint64_t code_object_id; ///< unique code object identifier
129 union
130 {
131 rocprofiler_agent_id_t rocp_agent; ///< Deprecated. Renamed to agent_id
132 rocprofiler_agent_id_t agent_id; ///< The agent on which this loaded code object is loaded
133 };
134 hsa_agent_t hsa_agent; ///< Deprecated. The agent on which this loaded code object is loaded
135 const char* uri; ///< The URI name from which the code object was loaded
136 uint64_t load_base;
137 uint64_t load_size;
138 int64_t load_delta;
140
141 /// @var load_base
142 /// @brief The base memory address at which the code object is loaded. This is the base address
143 /// of the allocation for the lowest addressed segment of the code object that is loaded. Note
144 /// that any non-loaded segments before the first loaded segment are ignored.
145 ///
146 /// @var load_size
147 /// @brief The byte size of the loaded code objects contiguous memory allocation.
148 ///
149 /// @var load_delta
150 /// @brief The signed byte address difference of the memory address at which the code object is
151 /// loaded minus the virtual address specified in the code object that is loaded.
152 ///
153 /// @var storage_type
154 /// @brief storage type of the code object reader used to load the loaded code object
155 ///
156
157 union
158 {
159 struct
160 {
161 int storage_file; ///< file descriptor of the code object that was loaded. Access this
162 ///< field if @ref rocprofiler_code_object_storage_type_t is
163 ///< @ref ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_FILE
164 };
165 struct
166 {
167 uint64_t memory_base; ///< The memory address of the first byte of the code object that
168 ///< was loaded. Access this
169 ///< field if @ref rocprofiler_code_object_storage_type_t is
170 ///< @ref ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_MEMORY
171 uint64_t memory_size; ///< The memory size in bytes of the code object that was loaded.
172 ///< Access this field if @ref
173 ///< rocprofiler_code_object_storage_type_t is
174 ///< @ref ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_MEMORY
175 };
176 };
178
179/**
180 * @brief The NULL value of a code object id. Used when code object is unknown.
181 */
182#define ROCPROFILER_CODE_OBJECT_ID_NONE ROCPROFILER_UINT64_C(0)
183
184/**
185 * @brief ROCProfiler Code Object Kernel Symbol Tracer Callback Record.
186 *
187 */
189{
190 uint64_t size; ///< size of this struct
191 uint64_t kernel_id; ///< unique symbol identifier value
192 uint64_t code_object_id; ///< parent unique code object identifier
193 const char* kernel_name; ///< name of the kernel
199 uint32_t sgpr_count; ///< Scalar general purpose register count
200 uint32_t arch_vgpr_count; ///< Architecture vector general purpose register count
201 uint32_t accum_vgpr_count; ///< Accum vector general purpose register count
204
205 /// @var kernel_object
206 /// @brief kernel object handle, used in the kernel dispatch packet
207 ///
208 /// @var kernarg_segment_size
209 /// @brief size of memory (in bytes) allocated for kernel arguments. Will be multiple of 16
210 ///
211 /// @var kernarg_segment_alignment
212 /// @brief Alignment (in bytes) of the buffer used to pass arguments to the kernel
213 ///
214 /// @var group_segment_size
215 /// @brief Size of static group segment memory required by the kernel (per work-group), in
216 /// bytes. AKA: LDS size
217 ///
218 /// @var private_segment_size
219 /// @brief Size of static private, spill, and arg segment memory required by this kernel (per
220 /// work-item), in bytes. AKA: scratch size
221 ///
222 /// @var kernel_code_entry_byte_offset
223 /// @brief Relative offset from kernel_object address to calculate the first address of a
224 /// kernel.
225 ///
226 /// @var kernel_address
227 /// @brief The first address of a kernel. Useful for PC sampling.
228 ///
230// rename struct
231
232typedef struct
233{
234 uint64_t size; ///< size of this struct
235 uint64_t host_function_id; ///< unique host function identifier value
236 uint64_t kernel_id; ///< unique symbol identifier value
237 uint64_t code_object_id; ///< parent unique code object identifier
238 rocprofiler_address_t host_function; ///< kernel host function pointer
239 rocprofiler_address_t modules; ///< reference address where modules will be loaded
240 const char* device_function;
241 uint32_t thread_limit; ///< thread limit
242 rocprofiler_dim3_t thread_ids; ///< thread ids address
243 rocprofiler_dim3_t block_ids; ///< block ids address
244 rocprofiler_dim3_t block_dims; ///< block dimensions address
245 rocprofiler_dim3_t grid_dims; ///< grid dimensions address
246 uint64_t workgroup_size; ///< workgroup size address
247
248 /// @var device_function
249 /// @brief device function name used to map the metadata during kernel launch
251
252/**
253 * @brief ROCProfiler Kernel Dispatch Callback Tracer Record.
254 *
255 */
263
264/**
265 * @brief ROCProfiler Memory Copy Callback Tracer Record.
266 *
267 * The timestamps in this record will only be non-zero in the ::ROCPROFILER_CALLBACK_PHASE_EXIT
268 * callback
269 */
270typedef struct
271{
272 uint64_t size; ///< size of this struct
273 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
274 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
275 rocprofiler_agent_id_t dst_agent_id; ///< destination agent of copy
276 rocprofiler_agent_id_t src_agent_id; ///< source agent of copy
277 uint64_t bytes; ///< bytes copied
279
280/**
281 * @brief ROCProfiler Memory Allocation Tracer Record.
282 */
283typedef struct
284{
285 uint64_t size; ///< size of this struct
286 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
287 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
288 rocprofiler_agent_id_t agent_id; ///< agent id for memory allocation
289 rocprofiler_address_t address; ///< starting address for memory allocation
290 uint64_t allocation_size; ///< size of memory allocation
292
293/**
294 * @brief ROCProfiler Scratch Memory Callback Data.
295 */
305
306/**
307 * @brief ROCProfiler Runtime Initialization Data.
308 */
310{
311 uint64_t size; ///< size of this struct
312 uint64_t version;
313 uint64_t instance; ///< Number of times this runtime had been loaded previously
314
315 /// @var version
316 /// @brief The version number of the library
317 ///
318 /// Version number is encoded as: (10000 * MAJOR) + (100 * MINOR) + PATCH
320
321/**
322 * @brief API Tracing callback function. This function is invoked twice per API function: once
323 * before the function is invoked and once after the function is invoked. The external correlation
324 * id value within the record is assigned the value at the top of the external correlation id stack.
325 * It is permissible to invoke @ref rocprofiler_push_external_correlation_id within the enter phase;
326 * when a new external correlation id is pushed during the enter phase, rocprofiler will use that
327 * external correlation id for any async events and provide the new external correlation id during
328 * the exit callback... In other words, pushing a new external correlation id within the enter
329 * callback will result in that external correlation id value in the exit callback (which may or may
330 * not be different from the external correlation id value in the enter callback). If a tool pushes
331 * new external correlation ids in the enter phase, it is recommended to pop the external
332 * correlation id in the exit callback.
333 *
334 * @param [in] record Callback record data
335 * @param [in,out] user_data This paramter can be used to retain information in between the enter
336 * and exit phases.
337 * @param [in] callback_data User data provided when configuring the callback tracing service
338 */
340 rocprofiler_user_data_t* user_data,
341 void* callback_data) ROCPROFILER_NONNULL(2);
342
343/**
344 * @brief Callback function for mapping @ref rocprofiler_callback_tracing_kind_t ids to
345 * string names. @see rocprofiler_iterate_callback_tracing_kind_names.
346 */
348 void* data);
349
350/**
351 * @brief Callback function for mapping the operations of a given @ref
352 * rocprofiler_callback_tracing_kind_t to string names. @see
353 * rocprofiler_iterate_callback_tracing_kind_operation_names.
354 */
358 void* data);
359
360/**
361 * @brief Callback function for iterating over the function arguments to a traced function.
362 * This function will be invoked for each argument.
363 * @see rocprofiler_iterate_callback_tracing_operation_args
364 *
365 * @param [in] kind domain
366 * @param [in] operation associated domain operation
367 * @param [in] arg_number the argument number, starting at zero
368 * @param [in] arg_value_addr the address of the argument stored by rocprofiler.
369 * @param [in] arg_indirection_count the total number of indirection levels for the argument, e.g.
370 * int == 0, int* == 1, int** == 2
371 * @param [in] arg_type the typeid name of the argument
372 * @param [in] arg_name the name of the argument in the prototype (or rocprofiler union)
373 * @param [in] arg_value_str conversion of the argument to a string, e.g. operator<< overload
374 * @param [in] arg_dereference_count the number of times the argument was dereferenced when it was
375 * converted to a string
376 * @param [in] data user data
377 */
381 uint32_t arg_number,
382 const void* const arg_value_addr,
383 int32_t arg_indirection_count,
384 const char* arg_type,
385 const char* arg_name,
386 const char* arg_value_str,
387 int32_t arg_dereference_count,
388 void* data);
389
390/**
391 * @brief Configure Callback Tracing Service. The callback tracing service provides two synchronous
392 * callbacks around an API function on the same thread as the application which is invoking the API
393 * function. This function can only be invoked once per @ref
394 * rocprofiler_callback_tracing_kind_t value, i.e. it can be invoked once for the HSA API,
395 * once for the HIP API, and so on but it will fail if it is invoked for the HSA API twice. Please
396 * note, the callback API does have the potentially non-trivial overhead of copying the function
397 * arguments into the record. If you are willing to let rocprofiler record the timestamps, do not
398 * require synchronous notifications of the API calls, and want to lowest possible overhead, use the
399 * @see BUFFER_TRACING_SERVICE.
400 *
401 * @param [in] context_id Context to associate the service with
402 * @param [in] kind The domain of the callback tracing service
403 * @param [in] operations Array of operations in the domain (i.e. enum values which identify
404 * specific API functions). If this is null, all API functions in the domain will be traced
405 * @param [in] operations_count If the operations array is non-null, set this to the size of the
406 * array.
407 * @param [in] callback The function to invoke before and after an API function
408 * @param [in] callback_args Data provided to every invocation of the callback function
409 * @return ::rocprofiler_status_t
410 * @retval ::ROCPROFILER_STATUS_ERROR_CONFIGURATION_LOCKED Invoked outside of the initialization
411 * function in @ref rocprofiler_tool_configure_result_t provided to rocprofiler via @ref
412 * rocprofiler_configure function
413 * @retval ::ROCPROFILER_STATUS_ERROR_CONTEXT_NOT_FOUND The provided context is not valid/registered
414 * @retval ::ROCPROFILER_STATUS_ERROR_SERVICE_ALREADY_CONFIGURED if the same @ref
415 * rocprofiler_callback_tracing_kind_t value is provided more than once (per context) -- in
416 * other words, we do not support overriding or combining the operations in separate function calls.
417 *
418 */
422 const rocprofiler_tracing_operation_t* operations,
423 size_t operations_count,
425 void* callback_args) ROCPROFILER_API;
426
427/**
428 * @brief Query the name of the callback tracing kind. The name retrieved from this function is a
429 * string literal that is encoded in the read-only section of the binary (i.e. it is always
430 * "allocated" and never "deallocated").
431 *
432 * @param [in] kind Callback tracing domain
433 * @param [out] name If non-null and the name is a constant string that does not require dynamic
434 * allocation, this paramter will be set to the address of the string literal, otherwise it will
435 * be set to nullptr
436 * @param [out] name_len If non-null, this will be assigned the length of the name (regardless of
437 * the name is a constant string or requires dynamic allocation)
438 * @return ::rocprofiler_status_t
439 */
442 const char** name,
443 uint64_t* name_len) ROCPROFILER_API;
444
445/**
446 * @brief Query the name of the callback tracing kind. The name retrieved from this function is a
447 * string literal that is encoded in the read-only section of the binary (i.e. it is always
448 * "allocated" and never "deallocated").
449 *
450 * @param [in] kind Callback tracing domain
451 * @param [in] operation Enumeration id value which maps to a specific API function or event type
452 * @param [out] name If non-null and the name is a constant string that does not require dynamic
453 * allocation, this paramter will be set to the address of the string literal, otherwise it will
454 * be set to nullptr
455 * @param [out] name_len If non-null, this will be assigned the length of the name (regardless of
456 * the name is a constant string or requires dynamic allocation)
457 * @return ::rocprofiler_status_t
458 * @retval ::ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUND Domain id is not valid
459 * @retval ::ROCPROFILER_STATUS_SUCCESS Valid domain provided, regardless if there is a constant
460 * string or not.
461 */
465 const char** name,
466 uint64_t* name_len) ROCPROFILER_API;
467
468/**
469 * @brief Iterate over all the mappings of the callback tracing kinds and get a callback for each
470 * kind.
471 *
472 * @param [in] callback Callback function invoked for each enumeration value in @ref
473 * rocprofiler_callback_tracing_kind_t with the exception of the `NONE` and `LAST` values.
474 * @param [in] data User data passed back into the callback
475 * @return ::rocprofiler_status_t
476 */
479 void* data) ROCPROFILER_API ROCPROFILER_NONNULL(1);
480
481/**
482 * @brief Iterates over all the mappings of the operations for a given @ref
483 * rocprofiler_callback_tracing_kind_t and invokes the callback with the kind id, operation
484 * id, and user-provided data.
485 *
486 * @param [in] kind which tracing callback kind operations to iterate over
487 * @param [in] callback Callback function invoked for each operation associated with @ref
488 * rocprofiler_callback_tracing_kind_t with the exception of the `NONE` and `LAST` values.
489 * @param [in] data User data passed back into the callback
490 * @return ::rocprofiler_status_t
491 * @retval ::ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUND Invalid domain id
492 * @retval ::ROCPROFILER_STATUS_SUCCESS Valid domain
493 */
498 void* data) ROCPROFILER_API ROCPROFILER_NONNULL(2);
499
500/**
501 * @brief Iterates over all the arguments for the traced function (when available). This is
502 * particularly useful when tools want to annotate traces with the function arguments. See
503 * @example samples/api_callback_tracing/client.cpp for a usage example.
504 *
505 * It is recommended to use this function when the record phase is ::ROCPROFILER_CALLBACK_PHASE_EXIT
506 * or ::ROCPROFILER_CALLBACK_PHASE_NONE. When the phase is ::ROCPROFILER_CALLBACK_PHASE_ENTER, the
507 * function may have output parameters which have not set. In the case of an output parameter with
508 * one level of indirection, e.g. `int* output_len`, this is considered safe since the output
509 * parameter is either null or, in the worst case scenario, pointing to an uninitialized value which
510 * will result in garbage values to be stringified. However, if the output parameter has more than
511 * one level of indirection, e.g. `const char** output_name`, this can result in a segmentation
512 * fault because the dereferenced output parameter may be uninitialized and point to an invalid
513 address. E.g.:
514 *
515 * @code{.cpp}
516 * struct dim3
517 * {
518 * int x;
519 * int y;
520 * int z;
521 * };
522 *
523 * static dim3 default_dims = {.x = 1, .y = 1, .z = 1};
524 *
525 * void set_dim_x(int val, dim3* output_dims) { output_dims->x = val; }
526 *
527 * void get_default_dims(dim3** output_dims) { *output_dims = default_dims; }
528 *
529 * int main()
530 * {
531 * dim3 my_dims; // uninitialized value. x, y, and z may be set to random values
532 * dim3* current_dims; // uninitialized pointer. May be set to invalid address
533 *
534 * set_dim_x(3, &my_dims); // if rocprofiler-sdk wrapped this function and tried to stringify
535 * // in the enter phase, dereferencing my_dims is not problematic
536 * // since there is an actual dim3 allocation
537 *
538 * get_default_dims(&current_dims); // if rocprofiler-sdk wrapped this function,
539 * // and tried to stringify in the enter phase,
540 * // current_dims may point to an address outside
541 * // of the address space of this process and
542 * // cause a segfault
543 * }
544 * @endcode
545 *
546 *
547 * @param[in] record Record provided by service callback
548 * @param[in] callback The callback function which will be invoked for each argument
549 * @param[in] max_dereference_count In the callback enter phase, certain arguments may be output
550 * parameters which have not been set. When the output parameter has multiple levels of indirection,
551 * it may be invalid to dereference the output parameter more than once and doing so may result in a
552 * segmentation fault. Thus, it is recommended to set this parameter to a maximum value of 1 when
553 * the phase is ::ROCPROFILER_CALLBACK_PHASE_ENTER to ensure that output parameters which point to
554 * uninitialized pointers do not cause segmentation faults.
555 * @param[in] user_data Data to be passed to each invocation of the callback
556 */
561 int32_t max_dereference_count,
562 void* user_data) ROCPROFILER_API ROCPROFILER_NONNULL(2);
563
564/** @} */
565
566ROCPROFILER_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:481
rocprofiler_status_t
Status codes.
Definition fwd.h:53
uint64_t rocprofiler_timestamp_t
ROCProfiler Timestamp.
Definition fwd.h:467
rocprofiler_callback_tracing_kind_t
Service Callback Tracing Kind.
Definition fwd.h:156
Agent Identifier.
Definition fwd.h:594
Context ID.
Definition fwd.h:555
Multi-dimensional struct of data used to describe GPU workgroup and grid sizes.
Definition fwd.h:619
ROCProfiler kernel dispatch information.
Definition fwd.h:706
Stores memory address for profiling.
Definition fwd.h:530
User-assignable data type.
Definition fwd.h:520
const char * device_function
device function name used to map the metadata during kernel launch
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_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_address_t modules
reference address where modules will be loaded
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.
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.
int64_t load_delta
The signed byte address difference of the memory address at which the code object is loaded minus the...
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_timestamp_t end_timestamp
end time in nanoseconds
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...
rocprofiler_status_t rocprofiler_iterate_callback_tracing_kind_operation_args(rocprofiler_callback_tracing_record_t record, rocprofiler_callback_tracing_operation_args_cb_t callback, int32_t max_dereference_count, void *user_data)
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_STORAGE_TYPE_NONE
@ ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_MEMORY
@ ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_FILE
@ ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_LAST
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 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 Scratch Memory Callback Data.
rocprofiler_scratch_alloc_flag_t
Allocation flags for.