rocprofiler-sdk/buffer_tracing.h Source File

rocprofiler-sdk/buffer_tracing.h Source File#

ROCprofiler-SDK developer API: rocprofiler-sdk/buffer_tracing.h Source File
ROCprofiler-SDK developer API 1.3.5
ROCm Profiling API and tools
buffer_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/agent.h>
26#include <rocprofiler-sdk/defines.h>
27#include <rocprofiler-sdk/fwd.h>
28#include <rocprofiler-sdk/hip/api_args.h>
29#include <rocprofiler-sdk/hipfile/api_args.h>
30#include <rocprofiler-sdk/hipfile/api_id.h>
31#include <rocprofiler-sdk/kfd/kfd_id.h>
32#include <rocprofiler-sdk/rocdecode/api_args.h>
33#include <rocprofiler-sdk/rocdecode/api_id.h>
34#include <rocprofiler-sdk/rocshmem/api_args.h>
35
36#include <stdint.h>
37
38ROCPROFILER_EXTERN_C_INIT
39
40/**
41 * @defgroup BUFFER_TRACING_SERVICE Asynchronous Tracing Service
42 * @brief Receive callbacks for batches of records from an internal (background) thread
43 *
44 * @{
45 */
46
47/**
48 * @brief ROCProfiler Buffer HSA API Tracer Record.
49 */
51{
52 uint64_t size; ///< size of this struct
55 rocprofiler_correlation_id_t correlation_id; ///< correlation ids for record
56 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
57 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
58 rocprofiler_thread_id_t thread_id; ///< id for thread generating this record
59
60 /// @var kind
61 /// @brief ::ROCPROFILER_CALLBACK_TRACING_HSA_CORE_API,
62 /// ::ROCPROFILER_CALLBACK_TRACING_HSA_AMD_EXT_API,
63 /// ::ROCPROFILER_CALLBACK_TRACING_HSA_IMAGE_EXT_API, or
64 /// ::ROCPROFILER_CALLBACK_TRACING_HSA_FINALIZE_EXT_API
65 /// @var operation
66 /// @brief Specification of the API function, e.g., ::rocprofiler_hsa_core_api_id_t,
67 /// ::rocprofiler_hsa_amd_ext_api_id_t, ::rocprofiler_hsa_image_ext_api_id_t, or
68 /// ::rocprofiler_hsa_finalize_ext_api_id_t
70
71/**
72 * @brief ROCProfiler Buffer HIP API Tracer Record.
73 */
75{
76 uint64_t size; ///< size of this struct
79 rocprofiler_correlation_id_t correlation_id; ///< correlation ids for record
80 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
81 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
82 rocprofiler_thread_id_t thread_id; ///< id for thread generating this record
83
84 /// @var kind
85 /// @brief ::ROCPROFILER_CALLBACK_TRACING_HIP_RUNTIME_API or
86 /// ::ROCPROFILER_CALLBACK_TRACING_HIP_COMPILER_API
87 /// @var operation
88 /// @brief Specification of the API function, e.g., ::rocprofiler_hip_runtime_api_id_t or
89 /// ::rocprofiler_hip_compiler_api_id_t
91
92/**
93 * @brief ROCProfiler Buffer HIP API Tracer Record.
94 */
96{
97 uint64_t size; ///< size of this struct
100 rocprofiler_correlation_id_t correlation_id; ///< correlation ids for record
101 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
102 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
103 rocprofiler_thread_id_t thread_id; ///< id for thread generating this record
104 rocprofiler_hip_api_args_t args; ///< arguments of function call
105 rocprofiler_hip_api_retval_t retval; ///< return value of function call
106
107 /// @var kind
108 /// @brief ::ROCPROFILER_CALLBACK_TRACING_HIP_RUNTIME_API or
109 /// ::ROCPROFILER_CALLBACK_TRACING_HIP_COMPILER_API
110 /// @var operation
111 /// @brief Specification of the API function, e.g., ::rocprofiler_hip_runtime_api_id_t or
112 /// ::rocprofiler_hip_compiler_api_id_t
114
115/**
116 * @brief Additional trace data for OpenMP target routines
117 */
118
120{
121 int32_t kind; // ompt_target_t target region kind
122 int32_t device_num; // ompt device number for the region
123 uint64_t task_id; // Task ID from the task_data argument to the OMPT callback
124 uint64_t target_id; // Target identifier from the target_data argument to the callback
125 const void* codeptr_ra; // pointer to the callsite of the target region
127
128typedef struct rocprofiler_buffer_tracing_ompt_target_data_op_t
129{
130 uint64_t host_op_id; // from the host_op_id argument to the OMPT callback
131 int32_t optype; // ompt_target_data_op_t kind of operation
132 int32_t src_device_num; // ompt device number for data source
133 int32_t dst_device_num; // ompt device number for data destination
134 int32_t reserved; // for padding
135 uint64_t bytes; // size in bytes of the operation
136 const void* codeptr_ra; // pointer to the callsite of the target_data_op
137} rocprofiler_buffer_tracing_ompt_target_data_op_t;
138
139typedef struct rocprofiler_buffer_tracing_ompt_target_kernel_t
140{
141 uint64_t host_op_id; // from the host_op_id argument to the OMPT callback
142 int32_t device_num; // strangely missing from the OpenMP spec,
143 uint32_t requested_num_teams; // from the compiler
144} rocprofiler_buffer_tracing_ompt_target_kernel_t;
145
146/**
147 * @brief ROCProfiler Buffer OMPT Tracer Record.
148 */
150{
151 uint64_t size; ///< size of this struct
154 rocprofiler_correlation_id_t correlation_id; ///< correlation ids for record
155 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
156 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
157 rocprofiler_thread_id_t thread_id; ///< id for thread generating this record
158 union
159 {
161 rocprofiler_buffer_tracing_ompt_target_data_op_t target_data_op;
162 rocprofiler_buffer_tracing_ompt_target_kernel_t target_kernel;
163 uint64_t reserved[5];
164 };
165
166 /// @var kind
167 /// @brief ::ROCPROFILER_BUFFER_TRACING_OMPT
168 /// @var operation
169 /// @brief Specification of the ::rocprofiler_ompt_operation_t
171
172/**
173 * @brief ROCProfiler Buffer Marker Tracer Record.
174 */
176{
177 uint64_t size; ///< size of this struct
180 rocprofiler_correlation_id_t correlation_id; ///< correlation ids for record
181 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
182 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
183 rocprofiler_thread_id_t thread_id; ///< id for thread generating this record
184
185 /// @var kind
186 /// @brief ::ROCPROFILER_CALLBACK_TRACING_MARKER_CORE_API,
187 /// ::ROCPROFILER_CALLBACK_TRACING_MARKER_CONTROL_API, or
188 /// ::ROCPROFILER_CALLBACK_TRACING_MARKER_NAME_API
189 /// @var operation
190 /// @brief Specification of the API function, e.g., ::rocprofiler_marker_core_api_id_t,
191 /// ::rocprofiler_marker_control_api_id_t, or
192 /// ::rocprofiler_marker_name_api_id_t
194
195/**
196 * @brief ROCProfiler Buffer RCCL API Record.
197 */
199{
200 uint64_t size; ///< size of this struct
203 rocprofiler_correlation_id_t correlation_id; ///< correlation ids for record
204 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
205 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
206 rocprofiler_thread_id_t thread_id; ///< id for thread generating this record
207
208 /// @var kind
209 /// @brief ::ROCPROFILER_CALLBACK_TRACING_RCCL_API
210 /// @var operation
211 /// @brief Specification of the API function, e.g., ::rocprofiler_rccl_api_id_t
213
214/**
215 * @brief ROCProfiler Buffer rocSHMEM API Record.
216 */
218{
219 uint64_t size; ///< size of this struct
222 rocprofiler_correlation_id_t correlation_id; ///< correlation ids for record
223 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
224 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
225 rocprofiler_thread_id_t thread_id; ///< id for thread generating this record
226
227 /// @var kind
228 /// @brief ::ROCPROFILER_BUFFER_TRACING_ROCSHMEM_API
229 /// @var operation
230 /// @brief Specification of the API function, e.g., ::rocprofiler_rocshmem_api_id_t
232
233/**
234 * @brief An extended ROCProfiler rocSHMEM API Tracer Record which includes function arguments.
235 * Pointers are not dereferenced.
236 */
238{
239 uint64_t size; ///< size of this struct
242 rocprofiler_correlation_id_t correlation_id; ///< correlation ids for record
243 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
244 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
245 rocprofiler_thread_id_t thread_id; ///< id for thread generating this record
246 rocprofiler_rocshmem_api_args_t args; ///< arguments of function call
247 rocprofiler_rocshmem_api_retval_t retval; ///< return value of function call
248
249 /// @var kind
250 /// @brief ::ROCPROFILER_BUFFER_TRACING_ROCSHMEM_API_EXT
251 /// @var operation
252 /// @brief Specification of the API function (@see
253 /// ::rocprofiler_rocshmem_api_id_t)
255
256/**
257 * @brief ROCProfiler Buffer rocDecode API Record.
258 */
260{
261 uint64_t size; ///< size of this struct
263 rocprofiler_rocdecode_api_id_t operation;
264 rocprofiler_correlation_id_t correlation_id; ///< correlation ids for record
265 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
266 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
267 rocprofiler_thread_id_t thread_id; ///< id for thread generating this record
268
269 /// @var kind
270 /// @brief ::ROCPROFILER_CALLBACK_TRACING_ROCDECODE_API
271 /// @var operation
272 /// @brief Specification of the API function, e.g., ::rocprofiler_rocdecode_api_id_t
274
275/**
276 * @brief An extended ROCProfiler rocDecode API Tracer Record which includes function arguments.
277 * Pointers are not dereferenced.
278 */
280{
281 uint64_t size; ///< size of this struct
283 rocprofiler_rocdecode_api_id_t operation;
284 rocprofiler_correlation_id_t correlation_id; ///< correlation ids for record
285 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
286 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
287 rocprofiler_thread_id_t thread_id; ///< id for thread generating this record
288 rocprofiler_rocdecode_api_args_t args; ///< arguments of function call
289 rocprofiler_rocdecode_api_retval_t retval; ///< return value of function call
290
291 /// @var kind
292 /// @brief ::ROCPROFILER_BUFFER_TRACING_ROCDECODE_API_EXT
293 /// @var operation
294 /// @brief Specification of the API function (@see
295 /// ::rocprofiler_rocdecode_api_id_t)
297
298/**
299 * @brief ROCProfiler Buffer rocJPEG API Record.
300 */
302{
303 uint64_t size; ///< size of this struct
306 rocprofiler_correlation_id_t correlation_id; ///< correlation ids for record
307 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
308 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
309 rocprofiler_thread_id_t thread_id; ///< id for thread generating this record
310
311 /// @var kind
312 /// @brief ::ROCPROFILER_CALLBACK_TRACING_ROCJPEG_API
313 /// @var operation
314 /// @brief Specification of the API function (@see
315 /// ::rocprofiler_rocjpeg_api_id_t)
317
318/**
319 * @brief ROCProfiler Buffer hipFILE API Record.
320 */
322{
323 uint64_t size; ///< size of this struct
325 rocprofiler_hipfile_api_id_t operation;
326 rocprofiler_correlation_id_t correlation_id; ///< correlation ids for record
327 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
328 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
329 rocprofiler_thread_id_t thread_id; ///< id for thread generating this record
330
331 /// @var kind
332 /// @brief ::ROCPROFILER_BUFFER_TRACING_HIPFILE_API
333 /// @var operation
334 /// @brief Specification of the API function (@see
335 /// ::rocprofiler_hipfile_api_id_t)
337
338/**
339 * @brief An extended ROCProfiler hipFILE API Tracer Record which includes function
340 * arguments and return values. Pointers are not dereferenced.
341 */
343{
344 uint64_t size; ///< size of this struct
346 rocprofiler_hipfile_api_id_t operation;
347 rocprofiler_correlation_id_t correlation_id; ///< correlation ids for record
348 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
349 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
350 rocprofiler_thread_id_t thread_id; ///< id for thread generating this record
351 rocprofiler_hipfile_api_args_t args; ///< arguments of function call
352 rocprofiler_hipfile_api_retval_t retval; ///< return value of function call
353
354 /// @var kind
355 /// @brief ::ROCPROFILER_BUFFER_TRACING_HIPFILE_API_EXT
356 /// @var operation
357 /// @brief Specification of the API function (@see
358 /// ::rocprofiler_hipfile_api_id_t)
360
361/**
362 * @brief ROCProfiler Buffer Memory Copy Tracer Record.
363 */
365{
366 uint64_t size; ///< size of this struct
369 rocprofiler_async_correlation_id_t correlation_id; ///< correlation ids for record
370 rocprofiler_thread_id_t thread_id; ///< id for thread that triggered copy
371 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
372 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
373 rocprofiler_agent_id_t dst_agent_id; ///< destination agent of copy
374 rocprofiler_agent_id_t src_agent_id; ///< source agent of copy
375 uint64_t bytes; ///< bytes copied
376 rocprofiler_address_t dst_address; ///< destination address
378
379 /// @var kind
380 /// @brief ::ROCPROFILER_BUFFER_TRACING_MEMORY_COPY
381 /// @var operation
382 /// @brief Specification of the memory copy direction (@see
383 /// ::rocprofiler_memory_copy_operation_t)
385
386/**
387 * @brief ROCProfiler Buffer Memory Allocation Tracer Record.
388 */
390{
391 uint64_t size; ///< size of this struct
394 rocprofiler_correlation_id_t correlation_id; ///< correlation ids for record
395 rocprofiler_thread_id_t thread_id; ///< id for thread that triggered copy
396 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
397 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
398 rocprofiler_agent_id_t agent_id; ///< agent information for memory allocation
399 rocprofiler_address_t address; ///< starting address for memory allocation
400 uint64_t allocation_size; ///< size for memory allocation
401
402 /// @var kind
403 /// @brief ::ROCPROFILER_BUFFER_TRACING_MEMORY_ALLOCATION
404 /// @var operation
405 /// @brief Specification of the memory allocation function (@see
406 /// ::rocprofiler_memory_allocation_operation_t
408
409/**
410 * @brief ROCProfiler Buffer Kernel Dispatch Tracer Record.
411 */
413{
414 uint64_t size; ///< size of this struct
415 rocprofiler_buffer_tracing_kind_t kind; ///< ::ROCPROFILER_BUFFER_TRACING_KERNEL_DISPATCH
417 rocprofiler_async_correlation_id_t correlation_id; ///< correlation ids for record
418 rocprofiler_thread_id_t thread_id; ///< id for thread that launched kernel
419 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
420 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
422
423 /// @var operation
424 /// @brief Kernel dispatch buffer records only report the ::ROCPROFILER_KERNEL_DISPATCH_COMPLETE
425 /// operation because there are no "real" wrapper around the enqueuing of an individual kernel
426 /// dispatch
428
429/**
430 * @brief Summary record emitted once per successful hipGraphLaunch invocation.
431 *
432 * graph_exec_id is the process-monotonic ID delivered with EXEC_CREATE
433 * callbacks via the ROCPROFILER_CALLBACK_TRACING_HIP_GRAPH domain.
434 */
436{
437 uint64_t size;
439 uint32_t operation;
440 rocprofiler_correlation_id_t correlation_id;
441 rocprofiler_thread_id_t thread_id;
442 rocprofiler_timestamp_t start_timestamp;
443 rocprofiler_timestamp_t end_timestamp;
444 rocprofiler_agent_id_t agent_id;
445 rocprofiler_queue_id_t queue_id;
446 rocprofiler_graph_exec_id_t graph_exec_id;
447 uint64_t kernel_dispatch_count;
449
450/**
451 * @brief ROCProfiler Buffer Page Migration event record from KFD.
452 */
454{
455 uint64_t size; ///< Size of this struct
457 rocprofiler_kfd_event_page_migrate_operation_t operation;
458 rocprofiler_timestamp_t timestamp; ///< Timestamp of the event as reported by KFD
459 uint32_t pid; ///< PID of the process as reported by KFD
460 rocprofiler_address_t start_address; ///< Start address of the memory range being migrated
461 rocprofiler_address_t end_address; ///< End address of the memory range being migrated
462 rocprofiler_agent_id_t src_agent; ///< Source agent from which pages were migrated
463 rocprofiler_agent_id_t dst_agent; ///< Destination agent to which pages were migrated
466 int32_t error_code; ///< Non-zero if there was an error at migrate-end
467
468 ///< @var kind
469 ///< @brief ::ROCPROFILER_BUFFER_TRACING_KFD_EVENT_PAGE_MIGRATE
470 ///< @var operation
471 ///< @brief @see rocprofiler_kfd_page_migrate_operation_t
472 ///< @var prefetch_agent
473 ///< @brief Agent to which memory is to be prefetched.
474 /// This field should be ignored on a migrate-end event
475 ///< @var preferred_agent
476 ///< @brief Preferred location for this memory
477 /// This field should be ignored on a migrate-end event
479
480/**
481 * @brief ROCProfiler Buffer Page Fault event record from KFD.
482 */
484{
485 uint64_t size; ///< Size of this struct
486 rocprofiler_buffer_tracing_kind_t kind; ///< ::ROCPROFILER_BUFFER_TRACING_KFD_EVENT_PAGE_FAULT
487 rocprofiler_kfd_event_page_fault_operation_t operation;
488 rocprofiler_timestamp_t timestamp; ///< Timestamp of the event as reported by KFD
489 uint32_t pid; ///< PID of the process as reported by KFD
490 rocprofiler_agent_id_t agent_id; ///< Agent ID which generated the fault
491 rocprofiler_address_t address; ///< Memory access that generated the fault event
492
493 ///< @var operation
494 ///< @brief @see rocprofiler_kfd_page_fault_operation_t
496
497/**
498 * @brief ROCProfiler Buffer Queue event record from KFD.
499 */
501{
502 uint64_t size; ///< Size of this struct
503 rocprofiler_buffer_tracing_kind_t kind; ///< ::ROCPROFILER_BUFFER_TRACING_KFD_EVENT_QUEUE
504 rocprofiler_kfd_event_queue_operation_t operation; ///< @see rocprofiler_kfd_queue_operation_t
505 rocprofiler_timestamp_t timestamp; ///< Timestamp of the event as reported by KFD
506 uint32_t pid; ///< PID of the process as reported by KFD
507 rocprofiler_agent_id_t agent_id; ///< Agent ID on which this event occurred
509
510/**
511 * @brief ROCProfiler Buffer Unmap of memory from GPU event record from KFD.
512 */
514{
515 uint64_t size; ///< Size of this struct
517 rocprofiler_kfd_event_unmap_from_gpu_operation_t operation;
518 rocprofiler_timestamp_t timestamp; ///< Timestamp of the event as reported by KFD
519 uint32_t pid; ///< PID of the process as reported by KFD
520 rocprofiler_agent_id_t agent_id; ///< Agent ID on which memory ranges were unmapped
521 rocprofiler_address_t start_address; ///< Start address of the memory range being unmapped
522 rocprofiler_address_t end_address; ///< End address of the memory range being unmapped
523
524 ///< @var kind
525 ///< @brief ::ROCPROFILER_BUFFER_TRACING_KFD_EVENT_UNMAP_FROM_GPU
526 ///< @var operation
527 ///< @brief @see rocprofiler_kfd_unmap_from_gpu_operation_t
529
530/**
531 * @brief ROCProfiler Buffer Dropped events event record, for when KFD reports
532 * that it has dropped some events.
533 */
535{
536 uint64_t size; ///< Size of this struct
538 rocprofiler_kfd_event_dropped_events_operation_t operation;
539 rocprofiler_timestamp_t timestamp; ///< Timestamp of the event as reported by KFD
540 uint32_t pid; ///< PID of the process as reported by KFD
541 uint32_t count; ///< Number of records that KFD dropped
542
543 ///< @var kind
544 ///< @brief ::ROCPROFILER_BUFFER_TRACING_KFD_EVENT_DROPPED_EVENTS
545 ///< @var operation
546 ///< @brief @see rocprofiler_kfd_event_dropped_events_operation_t
548
549/**
550 * @brief ROCProfiler Buffer Page Migration (paired) record from KFD.
551 */
553{
554 uint64_t size; ///< Size of this struct
555 rocprofiler_buffer_tracing_kind_t kind; ///< ::ROCPROFILER_BUFFER_TRACING_KFD_PAGE_MIGRATE
556 rocprofiler_kfd_page_migrate_operation_t operation;
557 rocprofiler_timestamp_t start_timestamp; ///< Start timestamp as reported by KFD
558 rocprofiler_timestamp_t end_timestamp; ///< End timestamp as reported by KFD
559 uint32_t pid; ///< PID of the process as reported by KFD
560 rocprofiler_address_t start_address; ///< Start address of the memory range being migrated
561 rocprofiler_address_t end_address; ///< End address of the memory range being migrated
562 rocprofiler_agent_id_t src_agent; ///< Source agent from which pages were migrated
563 rocprofiler_agent_id_t dst_agent; ///< Destination agent to which pages were migrated
566 int32_t error_code; ///< Non-zero codes are errors, as reported by KFD
567 ///< @var operation
568 ///< @brief @see rocprofiler_kfd_page_migrate_operation_t
569 ///< @var prefetch_agent
570 ///< @brief Agent to which memory is to be prefetched.
571 ///< @var preferred_agent
572 ///< @brief Preferred location for this memory
574
575/**
576 * @brief ROCProfiler Buffer Page Fault (paired) record from KFD.
577 */
579{
580 uint64_t size; ///< Size of this struct
581 rocprofiler_buffer_tracing_kind_t kind; ///< ::ROCPROFILER_BUFFER_TRACING_KFD_PAGE_FAULT
582 rocprofiler_kfd_page_fault_operation_t operation;
583 rocprofiler_timestamp_t start_timestamp; ///< Start timestamp as reported by KFD
584 rocprofiler_timestamp_t end_timestamp; ///< End timestamp as reported by KFD
585 uint32_t pid; ///< PID of the process as reported by KFD
586 rocprofiler_agent_id_t agent_id; ///< Agent ID which generated the fault
587 rocprofiler_address_t address; ///< Memory access that generated the page fault
588 ///< @var operation
589 ///< @brief @see rocprofiler_kfd_page_fault_operation_t
591
592/**
593 * @brief ROCProfiler Buffer Queue suspend (paired) record from KFD.
594 */
596{
597 uint64_t size; ///< Size of this struct
598 rocprofiler_buffer_tracing_kind_t kind; ///< ::ROCPROFILER_BUFFER_TRACING_KFD_QUEUE
599 rocprofiler_kfd_queue_operation_t operation; ///< @see rocprofiler_kfd_queue_operation_t
600 rocprofiler_timestamp_t start_timestamp; ///< Start timestamp as reported by KFD
601 rocprofiler_timestamp_t end_timestamp; ///< End timestamp as reported by KFD
602 uint32_t pid; ///< PID of the process as reported by KFD
603 rocprofiler_agent_id_t agent_id; ///< Agent ID on which this event occurred
605
606/**
607 * @brief ROCProfiler Buffer Scratch Memory Tracer Record
608 */
610{
611 uint64_t size; ///< size of this struct
612 rocprofiler_buffer_tracing_kind_t kind; ///< ::ROCPROFILER_BUFFER_TRACING_SCRATCH_MEMORY
613 rocprofiler_scratch_memory_operation_t operation; ///< specification of the kind
614 rocprofiler_correlation_id_t correlation_id; ///< correlation ids for record
615 rocprofiler_agent_id_t agent_id; ///< agent kernel was dispatched on
616 rocprofiler_queue_id_t queue_id; ///< queue kernel was dispatched on
617 rocprofiler_thread_id_t thread_id; ///< id for thread generating this record
618 rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
619 rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
620 rocprofiler_scratch_alloc_flag_t flags;
621 uint64_t allocation_size; ///< size of scratch memory allocation in bytes
623
624/**
625 * @brief ROCProfiler Buffer Correlation ID Retirement Tracer Record.
626 */
628{
629 uint64_t size; ///< size of this struct
633
634 /// @var kind
635 /// @brief ::ROCPROFILER_BUFFER_TRACING_CORRELATION_ID_RETIREMENT
636 /// @var timestamp
637 /// @brief Timestamp (in nanosec) of when rocprofiler detected the correlation ID could be
638 /// retired. Due to clock skew between the CPU and GPU, this may at times, *appear* to be before
639 /// the kernel or memory copy completed but the reality is that if this ever occurred, the API
640 /// would report a FATAL error
641 /// @var internal_correlation_id
642 /// @brief Only internal correlation ID is provided
644
645/**
646 * @brief ROCProfiler Buffer Runtime Initialization Tracer Record.
647 */
649{
650 uint64_t size; ///< size of this struct
656 uint64_t version;
657 uint64_t instance;
658
659 /// @var kind
660 /// @brief ::ROCPROFILER_BUFFER_TRACING_RUNTIME_INITIALIZATION
661 /// @var operation
662 /// @brief Indicates which runtime was initialized/loaded
663 /// @var correlation_id
664 /// @brief Correlation ID for these records are always zero
665 /// @var thread_id
666 /// @brief ID for thread which loaded this runtime
667 /// @var timestamp
668 /// @brief Timestamp (in nanosec) of when runtime was initialized/loaded
669 /// @var version
670 /// @brief The version number of the runtime
671 ///
672 /// Version number is encoded as: (10000 * MAJOR) + (100 * MINOR) + PATCH
673 /// @var instance
674 /// @brief Number of times this runtime had been loaded previously
676
677/**
678 * @brief Callback function for mapping ::rocprofiler_buffer_tracing_kind_t ids to
679 * string names. @see rocprofiler_iterate_buffer_trace_kind_names.
680 */
682 void* data);
683
684/**
685 * @brief Callback function for mapping the operations of a given @ref
686 * rocprofiler_buffer_tracing_kind_t to string names. @see
687 * rocprofiler_iterate_buffer_trace_kind_operation_names.
688 */
692 void* data);
693
694/**
695 * @brief Configure Buffer Tracing Service.
696 *
697 * @param [in] context_id Associated context to control activation of service
698 * @param [in] kind Buffer tracing category
699 * @param [in] operations Array of specific operations (if desired)
700 * @param [in] operations_count Number of specific operations (if non-null set of operations)
701 * @param [in] buffer_id Buffer to store the records in
702 * @return ::rocprofiler_status_t
703 * @retval ::ROCPROFILER_STATUS_ERROR_CONFIGURATION_LOCKED ::rocprofiler_configure initialization
704 * phase has passed
705 * @retval ::ROCPROFILER_STATUS_ERROR_CONTEXT_NOT_FOUND context is not valid
706 * @retval ::ROCPROFILER_STATUS_ERROR_SERVICE_ALREADY_CONFIGURED Context has already been configured
707 * for the ::rocprofiler_buffer_tracing_kind_t kind
708 * @retval ::ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUND Invalid ::rocprofiler_buffer_tracing_kind_t
709 * @retval ::ROCPROFILER_STATUS_ERROR_OPERATION_NOT_FOUND Invalid operation id for
710 * ::rocprofiler_buffer_tracing_kind_t kind was found
711 *
712 */
716 const rocprofiler_tracing_operation_t* operations,
717 size_t operations_count,
718 rocprofiler_buffer_id_t buffer_id) ROCPROFILER_API;
719
720/**
721 * @brief Query the name of the buffer tracing kind. The name retrieved from this function is a
722 * string literal that is encoded in the read-only section of the binary (i.e. it is always
723 * "allocated" and never "deallocated").
724 *
725 * @param [in] kind Buffer tracing domain
726 * @param [out] name If non-null and the name is a constant string that does not require dynamic
727 * allocation, this parameter will be set to the address of the string literal, otherwise it will
728 * be set to nullptr
729 * @param [out] name_len If non-null, this will be assigned the length of the name (regardless of
730 * the name is a constant string or requires dynamic allocation)
731 * @return ::rocprofiler_status_t
732 * @retval ::ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUND Returned if the domain id is not valid
733 * @retval ::ROCPROFILER_STATUS_SUCCESS Returned if a valid domain, regardless if there is a
734 * constant string or not.
735 */
738 const char** name,
739 uint64_t* name_len) ROCPROFILER_API;
740
741/**
742 * @brief Query the name of the buffer tracing kind. The name retrieved from this function is a
743 * string literal that is encoded in the read-only section of the binary (i.e. it is always
744 * "allocated" and never "deallocated").
745 *
746 * @param [in] kind Buffer tracing domain
747 * @param [in] operation Enumeration id value which maps to a specific API function or event type
748 * @param [out] name If non-null and the name is a constant string that does not require dynamic
749 * allocation, this parameter will be set to the address of the string literal, otherwise it will
750 * be set to nullptr
751 * @param [out] name_len If non-null, this will be assigned the length of the name (regardless of
752 * the name is a constant string or requires dynamic allocation)
753 * @return ::rocprofiler_status_t
754 * @retval ::ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUND An invalid domain id
755 * @retval ::ROCPROFILER_STATUS_ERROR_OPERATION_NOT_FOUND The operation number is not recognized for
756 * the given domain
757 * @retval ::ROCPROFILER_STATUS_ERROR_NOT_IMPLEMENTED Rocprofiler does not support providing the
758 * operation name within this domain
759 * @retval ::ROCPROFILER_STATUS_SUCCESS Valid domain and operation, regardless of whether there is a
760 * constant string or not.
761 */
765 const char** name,
766 uint64_t* name_len) ROCPROFILER_API;
767
768/**
769 * @brief Iterate over all the buffer tracing kinds and invokes the callback for each buffer tracing
770 * kind.
771 *
772 * This is typically used to invoke ::rocprofiler_iterate_buffer_tracing_kind_operations for each
773 * buffer tracing kind.
774 *
775 * @param [in] callback Callback function invoked for each enumeration value in @ref
776 * rocprofiler_buffer_tracing_kind_t with the exception of the `NONE` and `LAST` values.
777 * @param [in] data User data passed back into the callback
778 * @return ::rocprofiler_status_t
779 */
782 void* data) ROCPROFILER_API ROCPROFILER_NONNULL(1);
783
784/**
785 * @brief Iterates over all the operations for a given @ref
786 * rocprofiler_buffer_tracing_kind_t and invokes the callback with the kind and operation
787 * id. This is useful to build a map of the operation names during tool initialization instead of
788 * querying rocprofiler every time in the callback hotpath.
789 *
790 * @param [in] kind which buffer tracing kind operations to iterate over
791 * @param [in] callback Callback function invoked for each operation associated with @ref
792 * rocprofiler_buffer_tracing_kind_t with the exception of the `NONE` and `LAST` values.
793 * @param [in] data User data passed back into the callback
794 * @return ::rocprofiler_status_t
795 */
800 void* data) ROCPROFILER_API ROCPROFILER_NONNULL(2);
801
802/**
803 * @brief Callback function for iterating over the function arguments to a traced function.
804 * This function will be invoked for each argument.
805 * @see rocprofiler_iterate_buffer_tracing_record_args
806 *
807 * @param [in] kind domain
808 * @param [in] operation associated domain operation
809 * @param [in] arg_number the argument number, starting at zero
810 * @param [in] arg_value_addr the address of the argument stored by rocprofiler.
811 * @param [in] arg_indirection_count the total number of indirection levels for the argument, e.g.
812 * int == 0, int* == 1, int** == 2
813 * @param [in] arg_type the typeid name of the argument (not demangled)
814 * @param [in] arg_name the name of the argument in the prototype (or rocprofiler union)
815 * @param [in] arg_value_str conversion of the argument to a string, e.g. operator<< overload
816 * @param [in] data user data
817 */
821 uint32_t arg_number,
822 const void* const arg_value_addr,
823 int32_t arg_indirection_count,
824 const char* arg_type,
825 const char* arg_name,
826 const char* arg_value_str,
827 void* data);
828
829/**
830 * @brief Iterates over all the arguments for the traced function (when available). This is
831 * particularly useful when tools want to annotate traces with the function arguments. See
832 * @example samples/api_buffered_tracing/client.cpp for a usage example.
833 *
834 * In contrast to ::rocprofiler_iterate_callback_tracing_kind_operation_args, this function
835 * cannot dereference pointer arguments since there is a high probability that the pointer
836 * address references the stack and the buffer tracing record is delivered after the
837 * stack variables of the corresponding function have been destroyed.
838 *
839 * @param [in] record Buffer record
840 * @param [in] callback The callback function which will be invoked for each argument
841 * @param [in] user_data Data to be passed to each invocation of the callback
842 * @return ::rocprofiler_status_t
843 */
845rocprofiler_iterate_buffer_tracing_record_args(
848 void* user_data) ROCPROFILER_API ROCPROFILER_NONNULL(2);
849
850/** @} */
851
852ROCPROFILER_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:564
rocprofiler_scratch_memory_operation_t
Scratch event kind.
Definition fwd.h:424
rocprofiler_memory_copy_operation_t
Memory Copy Operations.
Definition fwd.h:318
rocprofiler_runtime_initialization_operation_t
ROCProfiler Runtime Initialization Tracer Operations.
Definition fwd.h:475
rocprofiler_memory_allocation_operation_t
Memory Allocation Operation.
Definition fwd.h:331
rocprofiler_status_t
Status codes.
Definition fwd.h:49
uint64_t rocprofiler_thread_id_t
Thread ID. Value will be equivalent to syscall(__NR_gettid)
Definition fwd.h:555
rocprofiler_buffer_tracing_kind_t
Service Buffer Tracing Kind.
Definition fwd.h:196
rocprofiler_kernel_dispatch_operation_t
ROCProfiler Kernel Dispatch Tracing Operation Types.
Definition fwd.h:344
uint64_t rocprofiler_timestamp_t
ROCProfiler Timestamp.
Definition fwd.h:550
Agent Identifier.
Definition fwd.h:743
ROCProfiler Correlation ID record for async activity.
Definition fwd.h:709
Context ID.
Definition fwd.h:648
ROCProfiler Record Correlation ID.
Definition fwd.h:690
HIP graph executable instance ID. Process-monotonic identifier assigned by rocprofiler-sdk for each s...
Definition fwd.h:673
ROCProfiler kernel dispatch information.
Definition fwd.h:859
Generic record with type identifier(s) and a pointer to data. This data type is used with buffered da...
Definition fwd.h:819
Stores memory address for profiling.
Definition fwd.h:613
rocprofiler_tracing_operation_t operation
Specification of the API function, e.g., rocprofiler_rccl_api_id_t.
rocprofiler_thread_id_t thread_id
id for thread that launched kernel
rocprofiler_correlation_id_t correlation_id
correlation ids for record
uint64_t allocation_size
size of scratch memory allocation in bytes
rocprofiler_thread_id_t thread_id
id for thread generating this record
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_BUFFER_TRACING_MEMORY_ALLOCATION
rocprofiler_thread_id_t thread_id
id for thread generating this record
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_CALLBACK_TRACING_MARKER_CORE_API, ROCPROFILER_CALLBACK_TRACING_MARKER_CONTROL_API,...
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_BUFFER_TRACING_KFD_PAGE_FAULT
rocprofiler_thread_id_t thread_id
ID for thread which loaded this runtime.
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_BUFFER_TRACING_ROCSHMEM_API_EXT
rocprofiler_timestamp_t start_timestamp
Start timestamp as reported by KFD.
rocprofiler_thread_id_t thread_id
id for thread generating this record
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_CALLBACK_TRACING_ROCJPEG_API
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
rocprofiler_tracing_operation_t operation
Specification of the API function, e.g., rocprofiler_hip_runtime_api_id_t or rocprofiler_hip_compiler...
rocprofiler_correlation_id_t correlation_id
correlation ids for record
rocprofiler_agent_id_t agent_id
Agent ID on which memory ranges were unmapped.
rocprofiler_agent_id_t preferred_agent
Preferred location for this memory This field should be ignored on a migrate-end event.
rocprofiler_tracing_operation_t operation
Specification of the rocprofiler_ompt_operation_t.
rocprofiler_agent_id_t preferred_agent
Preferred location for this memory.
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
uint32_t pid
PID of the process as reported by KFD.
rocprofiler_rocdecode_api_retval_t retval
return value of function call
rocprofiler_hipfile_api_id_t operation
Specification of the API function (.
rocprofiler_agent_id_t prefetch_agent
Agent to which memory is to be prefetched.
rocprofiler_agent_id_t agent_id
Agent ID which generated the fault.
rocprofiler_timestamp_t timestamp
Timestamp (in nanosec) of when rocprofiler detected the correlation ID could be retired....
uint64_t instance
Number of times this runtime had been loaded previously.
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_BUFFER_TRACING_KFD_QUEUE
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_BUFFER_TRACING_ROCSHMEM_API
rocprofiler_memory_allocation_operation_t operation
Specification of the memory allocation function (.
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_timestamp_t start_timestamp
Start timestamp as reported by KFD.
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
rocprofiler_rocdecode_api_args_t args
arguments of function call
rocprofiler_kfd_event_dropped_events_operation_t operation
rocprofiler_agent_id_t dst_agent_id
destination agent of copy
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_BUFFER_TRACING_SCRATCH_MEMORY
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
rocprofiler_correlation_id_t correlation_id
correlation ids for record
rocprofiler_tracing_operation_t operation
Specification of the API function, e.g., rocprofiler_rocshmem_api_id_t.
rocprofiler_correlation_id_t correlation_id
correlation ids for record
rocprofiler_correlation_id_t correlation_id
correlation ids for record
uint32_t pid
PID of the process as reported by KFD.
rocprofiler_thread_id_t thread_id
id for thread that triggered copy
rocprofiler_kfd_event_unmap_from_gpu_operation_t operation
uint32_t pid
PID of the process as reported by KFD.
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
rocprofiler_address_t end_address
End address of the memory range being migrated.
rocprofiler_timestamp_t timestamp
Timestamp of the event as reported by KFD.
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_thread_id_t thread_id
id for thread that triggered copy
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
rocprofiler_correlation_id_t correlation_id
correlation ids for record
uint32_t pid
PID of the process as reported by KFD.
rocprofiler_agent_id_t agent_id
agent information for memory allocation
uint64_t allocation_size
size for memory allocation
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_rocdecode_api_id_t operation
Specification of the API function, e.g., rocprofiler_rocdecode_api_id_t.
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_BUFFER_TRACING_KFD_EVENT_QUEUE
rocprofiler_correlation_id_t correlation_id
correlation ids for record
rocprofiler_agent_id_t agent_id
agent kernel was dispatched on
rocprofiler_agent_id_t src_agent_id
source agent of copy
rocprofiler_timestamp_t timestamp
Timestamp of the event as reported by KFD.
rocprofiler_thread_id_t thread_id
id for thread generating this record
rocprofiler_address_t dst_address
destination address
rocprofiler_correlation_id_t correlation_id
correlation ids for record
rocprofiler_correlation_id_t correlation_id
correlation ids for record
rocprofiler_hip_api_retval_t retval
return value of function call
uint64_t version
The version number of the runtime.
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_address_t start_address
Start address of the memory range being migrated.
rocprofiler_agent_id_t src_agent
Source agent from which pages were migrated.
rocprofiler_address_t start_address
Start address of the memory range being unmapped.
rocprofiler_timestamp_t timestamp
Timestamp of the event as reported by KFD.
rocprofiler_hipfile_api_id_t operation
Specification of the API function (.
rocprofiler_correlation_id_t correlation_id
correlation ids for record
rocprofiler_thread_id_t thread_id
id for thread generating this record
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_BUFFER_TRACING_RUNTIME_INITIALIZATION
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
rocprofiler_hipfile_api_retval_t retval
return value of function call
rocprofiler_correlation_id_t correlation_id
correlation ids for record
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
rocprofiler_timestamp_t end_timestamp
End timestamp as reported by KFD.
rocprofiler_hip_api_args_t args
arguments of function call
rocprofiler_thread_id_t thread_id
id for thread generating this record
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_BUFFER_TRACING_KFD_PAGE_MIGRATE
rocprofiler_agent_id_t prefetch_agent
Agent to which memory is to be prefetched. This field should be ignored on a migrate-end event.
rocprofiler_kfd_event_page_migrate_operation_t operation
rocprofiler_address_t address
starting address for memory allocation
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_CALLBACK_TRACING_HSA_CORE_API, ROCPROFILER_CALLBACK_TRACING_HSA_AMD_EXT_API,...
rocprofiler_timestamp_t timestamp
Timestamp (in nanosec) of when runtime was initialized/loaded.
rocprofiler_thread_id_t thread_id
id for thread generating this record
uint32_t pid
PID of the process as reported by KFD.
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_BUFFER_TRACING_CORRELATION_ID_RETIREMENT
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_BUFFER_TRACING_KFD_EVENT_PAGE_FAULT
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_BUFFER_TRACING_HIPFILE_API
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_CALLBACK_TRACING_RCCL_API
rocprofiler_tracing_operation_t operation
Specification of the API function, e.g., rocprofiler_hsa_core_api_id_t, rocprofiler_hsa_amd_ext_api_i...
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
uint32_t pid
PID of the process as reported by KFD.
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_timestamp_t start_timestamp
Start timestamp as reported by KFD.
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_BUFFER_TRACING_HIPFILE_API_EXT
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_BUFFER_TRACING_KERNEL_DISPATCH
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_CALLBACK_TRACING_ROCDECODE_API
rocprofiler_address_t src_address
source address
rocprofiler_correlation_id_t correlation_id
Correlation ID for these records are always zero.
rocprofiler_timestamp_t end_timestamp
End timestamp as reported by KFD.
rocprofiler_runtime_initialization_operation_t operation
Indicates which runtime was initialized/loaded.
rocprofiler_agent_id_t agent_id
Agent ID which generated the fault.
rocprofiler_kernel_dispatch_operation_t operation
Kernel dispatch buffer records only report the ROCPROFILER_KERNEL_DISPATCH_COMPLETE operation because...
rocprofiler_scratch_memory_operation_t operation
specification of the kind
rocprofiler_thread_id_t thread_id
id for thread generating this record
rocprofiler_memory_copy_operation_t operation
Specification of the memory copy direction (.
uint32_t pid
PID of the process as reported by KFD.
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_BUFFER_TRACING_ROCDECODE_API_EXT
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_thread_id_t thread_id
id for thread generating this record
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_CALLBACK_TRACING_HIP_RUNTIME_API or ROCPROFILER_CALLBACK_TRACING_HIP_COMPILER_API
rocprofiler_timestamp_t timestamp
Timestamp of the event as reported by KFD.
rocprofiler_address_t start_address
Start address of the memory range being migrated.
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
rocprofiler_rocshmem_api_args_t args
arguments of function call
rocprofiler_rocdecode_api_id_t operation
Specification of the API function (.
rocprofiler_address_t end_address
End address of the memory range being migrated.
rocprofiler_tracing_operation_t operation
Specification of the API function, e.g., rocprofiler_marker_core_api_id_t, rocprofiler_marker_control...
rocprofiler_correlation_id_t correlation_id
correlation ids for record
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
rocprofiler_agent_id_t dst_agent
Destination agent to which pages were migrated.
rocprofiler_thread_id_t thread_id
id for thread generating this record
rocprofiler_timestamp_t end_timestamp
End timestamp as reported by KFD.
rocprofiler_correlation_id_t correlation_id
correlation ids for record
rocprofiler_thread_id_t thread_id
id for thread generating this record
rocprofiler_thread_id_t thread_id
id for thread generating this record
rocprofiler_correlation_id_t correlation_id
correlation ids for record
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_agent_id_t agent_id
Agent ID on which this event occurred.
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_agent_id_t src_agent
Source agent from which pages were migrated.
rocprofiler_kernel_dispatch_info_t dispatch_info
Dispatch info.
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_tracing_operation_t operation
Specification of the API function (.
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_correlation_id_t correlation_id
correlation ids for record
rocprofiler_rocshmem_api_retval_t retval
return value of function call
rocprofiler_kfd_queue_operation_t operation
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_BUFFER_TRACING_MEMORY_COPY
rocprofiler_async_correlation_id_t correlation_id
correlation ids for record
rocprofiler_queue_id_t queue_id
queue kernel was dispatched on
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_BUFFER_TRACING_OMPT
rocprofiler_hipfile_api_args_t args
arguments of function call
uint32_t pid
PID of the process as reported by KFD.
rocprofiler_timestamp_t timestamp
Timestamp of the event as reported by KFD.
rocprofiler_timestamp_t end_timestamp
end time in nanoseconds
rocprofiler_thread_id_t thread_id
id for thread generating this record
rocprofiler_tracing_operation_t operation
Specification of the API function, e.g., rocprofiler_hip_runtime_api_id_t or rocprofiler_hip_compiler...
rocprofiler_thread_id_t thread_id
id for thread generating this record
rocprofiler_agent_id_t dst_agent
Destination agent to which pages were migrated.
rocprofiler_timestamp_t start_timestamp
start time in nanoseconds
rocprofiler_kfd_event_queue_operation_t operation
rocprofiler_agent_id_t agent_id
Agent ID on which this event occurred.
rocprofiler_buffer_tracing_kind_t kind
ROCPROFILER_CALLBACK_TRACING_HIP_RUNTIME_API or ROCPROFILER_CALLBACK_TRACING_HIP_COMPILER_API
uint64_t internal_correlation_id
Only internal correlation ID is provided.
rocprofiler_tracing_operation_t operation
Specification of the API function (.
rocprofiler_async_correlation_id_t correlation_id
correlation ids for record
int(* rocprofiler_buffer_tracing_kind_operation_cb_t)(rocprofiler_buffer_tracing_kind_t kind, rocprofiler_tracing_operation_t operation, void *data)
Callback function for mapping the operations of a given rocprofiler_buffer_tracing_kind_t to string n...
rocprofiler_status_t rocprofiler_iterate_buffer_tracing_kinds(rocprofiler_buffer_tracing_kind_cb_t callback, void *data)
Iterate over all the buffer tracing kinds and invokes the callback for each buffer tracing kind.
int(* rocprofiler_buffer_tracing_operation_args_cb_t)(rocprofiler_buffer_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, void *data)
Callback function for iterating over the function arguments to a traced function. This function will ...
int(* rocprofiler_buffer_tracing_kind_cb_t)(rocprofiler_buffer_tracing_kind_t kind, void *data)
Callback function for mapping rocprofiler_buffer_tracing_kind_t ids to string names.
rocprofiler_status_t rocprofiler_configure_buffer_tracing_service(rocprofiler_context_id_t context_id, rocprofiler_buffer_tracing_kind_t kind, const rocprofiler_tracing_operation_t *operations, unsigned long operations_count, rocprofiler_buffer_id_t buffer_id)
Configure Buffer Tracing Service.
rocprofiler_status_t rocprofiler_query_buffer_tracing_kind_name(rocprofiler_buffer_tracing_kind_t kind, const char **name, uint64_t *name_len)
Query the name of the buffer tracing kind. The name retrieved from this function is a string literal ...
rocprofiler_status_t rocprofiler_query_buffer_tracing_kind_operation_name(rocprofiler_buffer_tracing_kind_t kind, rocprofiler_tracing_operation_t operation, const char **name, uint64_t *name_len)
Query the name of the buffer tracing kind. The name retrieved from this function is a string literal ...
rocprofiler_status_t rocprofiler_iterate_buffer_tracing_kind_operations(rocprofiler_buffer_tracing_kind_t kind, rocprofiler_buffer_tracing_kind_operation_cb_t callback, void *data)
Iterates over all the operations for a given rocprofiler_buffer_tracing_kind_t and invokes the callba...
ROCProfiler Buffer Correlation ID Retirement Tracer Record.
ROCProfiler Buffer HIP API Tracer Record.
ROCProfiler Buffer HIP API Tracer Record.
Summary record emitted once per successful hipGraphLaunch invocation.
An extended ROCProfiler hipFILE API Tracer Record which includes function arguments and return values...
ROCProfiler Buffer hipFILE API Record.
ROCProfiler Buffer HSA API Tracer Record.
ROCProfiler Buffer Kernel Dispatch Tracer Record.
ROCProfiler Buffer Dropped events event record, for when KFD reports that it has dropped some events.
ROCProfiler Buffer Page Fault event record from KFD.
ROCProfiler Buffer Page Migration event record from KFD.
ROCProfiler Buffer Queue event record from KFD.
ROCProfiler Buffer Unmap of memory from GPU event record from KFD.
ROCProfiler Buffer Page Fault (paired) record from KFD.
ROCProfiler Buffer Page Migration (paired) record from KFD.
ROCProfiler Buffer Queue suspend (paired) record from KFD.
ROCProfiler Buffer Marker Tracer Record.
ROCProfiler Buffer Memory Allocation Tracer Record.
ROCProfiler Buffer Memory Copy Tracer Record.
ROCProfiler Buffer OMPT Tracer Record.
Additional trace data for OpenMP target routines.
ROCProfiler Buffer RCCL API Record.
An extended ROCProfiler rocDecode API Tracer Record which includes function arguments....
ROCProfiler Buffer rocDecode API Record.
ROCProfiler Buffer rocJPEG API Record.
An extended ROCProfiler rocSHMEM API Tracer Record which includes function arguments....
ROCProfiler Buffer rocSHMEM API Record.
ROCProfiler Buffer Runtime Initialization Tracer Record.
ROCProfiler Buffer Scratch Memory Tracer Record.