/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocprofiler-docs/checkouts/docs-5.7.0/inc/rocprofiler.h Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocprofiler-docs/checkouts/docs-5.7.0/inc/rocprofiler.h Source File#

ROCProfilerV1 API: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocprofiler-docs/checkouts/docs-5.7.0/inc/rocprofiler.h Source File
rocprofiler.h
Go to the documentation of this file.
1 /******************************************************************************
2 Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved.
3 
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10 
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 THE SOFTWARE.
21 *******************************************************************************/
22 
24 //
25 // ROC Profiler API
26 //
27 // The goal of the implementation is to provide a HW specific low-level
28 // performance analysis interface for profiling of GPU compute applications.
29 // The profiling includes HW performance counters (PMC) with complex
30 // performance metrics and traces.
31 //
32 // The library can be used by a tool library loaded by HSA runtime or by
33 // higher level HW independent performance analysis API like PAPI.
34 //
35 // The library is written on C and will be based on AQLprofile AMD specific
36 // HSA extension. The library implementation requires HSA API intercepting and
37 // a profiling queue supporting a submit callback interface.
38 //
39 //
76 //
81 
83 #ifndef INC_ROCPROFILER_H_
84 #define INC_ROCPROFILER_H_
85 
86 /* Placeholder for calling convention and import/export macros */
87 #if !defined(ROCPROFILER_CALL)
88 #define ROCPROFILER_CALL
89 #endif /* !defined (ROCPROFILER_CALL) */
90 
91 #if !defined(ROCPROFILER_EXPORT_DECORATOR)
92 #if defined(__GNUC__)
93 #define ROCPROFILER_EXPORT_DECORATOR __attribute__((visibility("default")))
94 #elif defined(_MSC_VER)
95 #define ROCPROFILER_EXPORT_DECORATOR __declspec(dllexport)
96 #endif /* defined (_MSC_VER) */
97 #endif /* !defined (ROCPROFILER_EXPORT_DECORATOR) */
98 
99 #if !defined(ROCPROFILER_IMPORT_DECORATOR)
100 #if defined(__GNUC__)
101 #define ROCPROFILER_IMPORT_DECORATOR
102 #elif defined(_MSC_VER)
103 #define ROCPROFILER_IMPORT_DECORATOR __declspec(dllimport)
104 #endif /* defined (_MSC_VER) */
105 #endif /* !defined (ROCPROFILER_IMPORT_DECORATOR) */
106 
107 #define ROCPROFILER_EXPORT ROCPROFILER_EXPORT_DECORATOR ROCPROFILER_CALL
108 #define ROCPROFILER_IMPORT ROCPROFILER_IMPORT_DECORATOR ROCPROFILER_CALL
109 
110 #if !defined(ROCPROFILER)
111 #if defined(ROCPROFILER_EXPORTS)
112 #define ROCPROFILER_API ROCPROFILER_EXPORT
113 #else /* !defined (ROCPROFILER_EXPORTS) */
114 #define ROCPROFILER_API ROCPROFILER_IMPORT
115 #endif /* !defined (ROCPROFILER_EXPORTS) */
116 #endif /* !defined (ROCPROFILER) */
117 
118 #include <stddef.h>
119 #include <stdint.h>
120 
121 #ifdef __cplusplus
122 extern "C" {
123 #endif /* __cplusplus */
124 
144 #define ROCPROFILER_VERSION_9_0
145 
165 #define ROCPROFILER_VERSION_MAJOR 9
166 
171 #define ROCPROFILER_VERSION_MINOR 0
172 
181 
190 
193 #ifndef ROCPROFILER_V1
194 
195 // TODO(aelwazir): Fix them to use the new Error codes
206 typedef enum {
346 
356 
363 // TODO(aelwazir): More clear description, (think about nested!!??)
364 
374 
384 
394 typedef struct {
399  uint64_t handle;
401 
417 typedef struct {
418  uint64_t value;
420 
432 
437 typedef struct {
441 
451 typedef struct {
455  uint64_t handle;
457 
461 typedef enum {
484 
488 typedef struct {
498 
509 typedef struct {
514  uint64_t handle; // Topology folder serial number
516 
522 typedef enum {
532 
533 // TODO(aelwazir): check if we need to report the family name as well!!?? OR
534 // return the agent itself so that they can use HSA API
538 typedef enum {
548 
567  rocprofiler_agent_id_t agent_id,
568  size_t* data_size) ROCPROFILER_VERSION_9_0;
569 
588  rocprofiler_agent_id_t descriptor,
589  const char** name) ROCPROFILER_VERSION_9_0;
590 
603 typedef struct {
607  uint64_t handle;
609 
610 // TODO(aelwazir): Check if there is anymore Queue Information needed
614 typedef enum {
620 
640  rocprofiler_queue_id_t agent_id,
641  size_t* data_size) ROCPROFILER_VERSION_9_0;
642 
661  rocprofiler_queue_id_t descriptor,
662  const char** name) ROCPROFILER_VERSION_9_0;
663 
674 typedef struct {
678  uint64_t handle;
680 
684 typedef enum {
690 
711  rocprofiler_kernel_id_t kernel_id,
712  size_t* data_size) ROCPROFILER_VERSION_9_0;
713 
732  rocprofiler_kernel_id_t kernel_id,
733  const char** data) ROCPROFILER_VERSION_9_0;
734 
740 typedef struct {
744  uint32_t value;
746 
766 typedef struct {
767  const char* name;
768  const char* description;
769  const char* expression;
770  uint32_t instances_count;
771  const char* block_name;
772  uint32_t block_counters;
774 
776  const char* gpu_name, uint32_t gpu_index) ROCPROFILER_VERSION_9_0;
777 
780 
785 typedef struct {
789  uint64_t handle;
791 
795 typedef enum {
810 
832  rocprofiler_session_id_t session_id, rocprofiler_counter_info_kind_t counter_info_type,
833  rocprofiler_counter_id_t counter_id, size_t* data_size) ROCPROFILER_VERSION_9_0;
834 
855  rocprofiler_counter_id_t counter_id,
856  const char** data) ROCPROFILER_VERSION_9_0;
857 
858 typedef struct {
862  uint64_t value;
864 
865 // TODO(aelwazir): add more types to the values should we use unions??!!
869 typedef struct {
873  double value;
875 
881 typedef struct {
891 
897 typedef struct {
901  uint64_t value;
903 
909 typedef struct {
913  uint64_t grid_size;
917  uint64_t workgroup_size;
921  uint64_t lds_size;
925  uint64_t scratch_size;
929  uint64_t arch_vgpr_count;
937  uint64_t sgpr_count;
941  uint64_t wave_size;
945  uint64_t signal_handle;
946 
955 typedef struct {
1004 
1005 typedef struct {
1006  uint32_t value;
1007 
1009 
1010 typedef struct {
1011  uint16_t value; // Counter Value
1012 
1014 
1019 typedef struct {
1021 
1023 
1024 
1031 typedef struct {
1037 
1045  rocprofiler_record_se_spm_data_t shader_engine_data[4];
1046 
1048 
1052 typedef struct {
1053  void* buffer_ptr;
1054  uint32_t buffer_size;
1056 
1064 typedef struct {
1107 
1108 
1109 
1119 typedef enum {
1148  // TODO(aelwazir): Used in kernel Info, memcpy, ..etc, refer to hsa_support
1149  // TODO(aelwazir): Move HSA Events to hsa_support
1156 
1160 typedef struct {
1161  uint32_t id;
1163 
1167 typedef struct {
1171  uint64_t value;
1173 
1177 typedef struct {
1181  const void* handle;
1185  size_t size;
1187 
1196 typedef enum {
1206 
1235  size_t* data_size) ROCPROFILER_VERSION_9_0;
1236 
1263  char** data) ROCPROFILER_VERSION_9_0;
1264 
1275 typedef enum {
1295 
1324  size_t* data_size) ROCPROFILER_VERSION_9_0;
1325 
1352  char** data) ROCPROFILER_VERSION_9_0;
1353 
1364 typedef enum {
1365  // TODO(aelwazir): Get the data from hip_api_data_t
1409 
1437  size_t* data_size) ROCPROFILER_VERSION_9_0;
1438 
1464  char** data) ROCPROFILER_VERSION_9_0;
1465 
1471 typedef struct {
1472  uint64_t id;
1474 
1482 typedef struct {
1530 
1534 typedef struct {
1535  uint64_t value;
1537 
1541 typedef struct {
1547  union {
1555  uint64_t cycle;
1556  };
1560  uint64_t pc;
1564  uint32_t se;
1570 
1575 typedef struct {
1586 
1599 typedef enum {
1604  // Periodic Flush
1605  // Size
1606  // Think of using the kind as an end of the array!!??
1608 
1609 typedef struct {
1611  uint64_t value;
1613 
1614 typedef struct {
1615  uint64_t value;
1617 
1618 typedef struct {
1619  uint64_t value;
1621 
1638  const rocprofiler_record_header_t* end,
1639  rocprofiler_session_id_t session_id,
1640  rocprofiler_buffer_id_t buffer_id);
1641 
1658 
1679  const rocprofiler_record_header_t** next,
1680  rocprofiler_session_id_t session_id,
1682 
1689 // TODO(aelwazir): Replay mode naming !!?? (If changed, reflect on start&stop)
1693 typedef enum {
1712 
1745 
1762 
1768 typedef enum {
1794 
1799 typedef enum {
1812  // TODO(aelwazir): Add more clear description on how to use?
1822 
1823 // TODO(aelwazir): Another way to define this as needed
1826 
1827 // ATT tracing parameter names
1828 typedef enum {
1842 
1843 // att tracing parameters object
1844 typedef struct {
1846  union {
1847  uint32_t value;
1848  const char* counter_name;
1849  };
1851 
1857 typedef struct {
1862  // TODO(aelwazir): get HIP or HSA or counters as enums
1866  union {
1867  const char** name_regex;
1870  uint32_t range[2];
1871  };
1875  uint64_t data_count;
1877 
1878 typedef struct {
1882  const char** counters_names;
1890  uint32_t sampling_rate;
1895 
1897 
1901 typedef union {
1909  const char** counters_names;
1919 
1944  rocprofiler_filter_kind_t filter_kind,
1946  uint64_t data_count,
1947  rocprofiler_filter_id_t* filter_id,
1949 
1968  rocprofiler_filter_id_t filter_id,
1970 
1980  rocprofiler_session_id_t session_id);
1981 
2004  rocprofiler_session_id_t session_id, rocprofiler_filter_id_t filter_id,
2006 
2023 
2048  rocprofiler_session_id_t session_id, rocprofiler_buffer_callback_t buffer_callback,
2049  size_t buffer_size, rocprofiler_buffer_id_t* buffer_id) ROCPROFILER_VERSION_9_0;
2050 
2075  rocprofiler_session_id_t session_id, rocprofiler_buffer_id_t buffer_id,
2076  rocprofiler_buffer_property_t* buffer_properties, uint32_t buffer_properties_count) ROCPROFILER_VERSION_9_0;
2077 
2099 
2149  rocprofiler_replay_mode_t replay_mode, rocprofiler_filter_kind_t filter_kind,
2150  rocprofiler_filter_data_t data, uint64_t data_count, size_t buffer_size,
2151  rocprofiler_buffer_callback_t buffer_callback, rocprofiler_session_id_t* session_id,
2153 
2154 // TODO(aelwazir): Multiple sessions activate for different set of filters
2175 
2191 
2211 
2225 
2247 
2260 
2268 typedef struct {
2269  double value;
2271 
2272 typedef struct {
2273  char metric_name[64];
2276 
2295  const char** counter_names, uint64_t num_counters, rocprofiler_session_id_t* session_id,
2296  int cpu_index, int gpu_index) ROCPROFILER_VERSION_9_0;
2297 
2308 
2323 
2334 
2344 
2347 #endif
2348 
2351 // Old ROCProfiler
2354 
2355 #include <hsa/amd_hsa_kernel_code.h>
2356 #include <hsa/hsa.h>
2357 #include <hsa/hsa_ext_amd.h>
2358 #include <hsa/hsa_ven_amd_aqlprofile.h>
2359 #include <stdint.h>
2360 
2362 // Global properties structure
2363 
2364 typedef struct {
2365  uint32_t intercept_mode;
2368  uint32_t trace_size;
2369  uint32_t trace_local;
2370  uint64_t timeout;
2371  uint32_t timestamp_on;
2373  uint32_t k_concurrent;
2374  uint32_t opt_mode;
2375  uint32_t obj_dumping;
2377 
2379 // Returning the error string method
2380 
2382  const char** str); // [out] the API error string pointer returning
2383 
2385 // Profiling features and data
2386 //
2387 // Profiling features objects have profiling feature info, type, parameters and data
2388 // Also profiling data samplaes can be iterated using a callback
2389 
2390 // Profiling feature kind
2391 typedef enum {
2397 
2398 // Profiling feture parameter
2399 typedef hsa_ven_amd_aqlprofile_parameter_t rocprofiler_parameter_t;
2400 
2401 // Profiling data kind
2402 typedef enum {
2410 
2411 // Profiling data type
2412 typedef struct {
2414  union {
2415  uint32_t result_int32; // 32bit integer result
2416  uint64_t result_int64; // 64bit integer result
2417  float result_float; // float single-precision result
2418  double result_double; // float double-precision result
2419  struct {
2420  void* ptr;
2421  uint32_t size;
2422  uint32_t instance_count;
2423  bool copy;
2424  } result_bytes; // data by ptr and byte size
2425  };
2427 
2428 // Profiling feature type
2429 typedef struct {
2431  union {
2432  const char* name; // feature name
2433  struct {
2434  const char* block; // counter block name
2435  uint32_t event; // counter event id
2436  } counter;
2437  };
2438  const rocprofiler_parameter_t* parameters; // feature parameters array
2439  uint32_t parameter_count; // feature parameters count
2440  rocprofiler_data_t data; // profiling data
2442 
2443 // Profiling features set type
2445 
2447 // Profiling context
2448 //
2449 // Profiling context object accumuate all profiling information
2450 
2451 // Profiling context object
2452 typedef void rocprofiler_t;
2453 
2454 // Profiling group object
2455 typedef struct {
2456  unsigned index; // group index
2457  rocprofiler_feature_t** features; // profiling info array
2458  uint32_t feature_count; // profiling info count
2459  rocprofiler_t* context; // context object
2461 
2462 // Profiling mode mask
2463 typedef enum {
2464  ROCPROFILER_MODE_STANDALONE = 1, // standalone mode when ROC profiler supports a queue
2465  ROCPROFILER_MODE_CREATEQUEUE = 2, // ROC profiler creates queue in standalone mode
2466  ROCPROFILER_MODE_SINGLEGROUP = 4 // only one group is allowed, failed otherwise
2468 
2469 // Profiling handler, calling on profiling completion
2470 typedef bool (*rocprofiler_handler_t)(rocprofiler_group_t group, void* arg);
2471 
2472 // Profiling preperties
2473 typedef struct {
2474  hsa_queue_t* queue; // queue for STANDALONE mode
2475  // the queue is created and returned in CREATEQUEUE mode
2476  uint32_t queue_depth; // created queue depth
2477  rocprofiler_handler_t handler; // handler on completion
2478  void* handler_arg; // the handler arg
2480 
2481 // Create new profiling context
2482 hsa_status_t rocprofiler_open(hsa_agent_t agent, // GPU handle
2483  rocprofiler_feature_t* features, // [in] profiling features array
2484  uint32_t feature_count, // profiling info count
2485  rocprofiler_t** context, // [out] context object
2486  uint32_t mode, // profiling mode mask
2487  rocprofiler_properties_t* properties); // profiling properties
2488 
2489 // Add feature to a features set
2490 hsa_status_t rocprofiler_add_feature(const rocprofiler_feature_t* feature, // [in]
2491  rocprofiler_feature_set_t* features_set); // [in/out] profiling features set
2492 
2493 // Create new profiling context
2494 hsa_status_t rocprofiler_features_set_open(hsa_agent_t agent, // GPU handle
2495  rocprofiler_feature_set_t* features_set, // [in] profiling features set
2496  rocprofiler_t** context, // [out] context object
2497  uint32_t mode, // profiling mode mask
2498  rocprofiler_properties_t* properties); // profiling properties
2499 
2500 // Delete profiling info
2501 hsa_status_t rocprofiler_close(rocprofiler_t* context); // [in] profiling context
2502 
2503 // Context reset before reusing
2504 hsa_status_t rocprofiler_reset(rocprofiler_t* context, // [in] profiling context
2505  uint32_t group_index); // group index
2506 
2507 // Return context agent
2508 hsa_status_t rocprofiler_get_agent(rocprofiler_t* context, // [in] profiling context
2509  hsa_agent_t* agent); // [out] GPU handle
2510 
2511 // Supported time value ID
2512 typedef enum {
2513  ROCPROFILER_TIME_ID_CLOCK_REALTIME = 0, // Linux realtime clock time
2514  ROCPROFILER_TIME_ID_CLOCK_REALTIME_COARSE = 1, // Linux realtime-coarse clock time
2515  ROCPROFILER_TIME_ID_CLOCK_MONOTONIC = 2, // Linux monotonic clock time
2516  ROCPROFILER_TIME_ID_CLOCK_MONOTONIC_COARSE = 3, // Linux monotonic-coarse clock time
2517  ROCPROFILER_TIME_ID_CLOCK_MONOTONIC_RAW = 4, // Linux monotonic-raw clock time
2519 
2520 // Return time value for a given time ID and profiling timestamp
2522  rocprofiler_time_id_t time_id, // identifier of the particular time to convert the timesatmp
2523  uint64_t timestamp, // profiling timestamp
2524  uint64_t* value_ns, // [out] returned time 'ns' value, ignored if NULL
2525  uint64_t* error_ns); // [out] returned time error 'ns' value, ignored if NULL
2526 
2528 // Queue callbacks
2529 //
2530 // Queue callbacks for initiating profiling per kernel dispatch and to wait
2531 // the profiling data on the queue destroy.
2532 
2533 // Dispatch record
2534 typedef struct {
2535  uint64_t dispatch; // dispatch timestamp, ns
2536  uint64_t begin; // kernel begin timestamp, ns
2537  uint64_t end; // kernel end timestamp, ns
2538  uint64_t complete; // completion signal timestamp, ns
2540 
2541 // Profiling callback data
2542 typedef struct {
2543  hsa_agent_t agent; // GPU agent handle
2544  uint32_t agent_index; // GPU index (GPU Driver Node ID as reported in the sysfs topology)
2545  const hsa_queue_t* queue; // HSA queue
2546  uint64_t queue_index; // Index in the queue
2547  uint32_t queue_id; // Queue id
2548  hsa_signal_t completion_signal; // Completion signal
2549  const hsa_kernel_dispatch_packet_t* packet; // HSA dispatch packet
2550  const char* kernel_name; // Kernel name
2551  uint64_t kernel_object; // Kernel object address
2552  const amd_kernel_code_t* kernel_code; // Kernel code pointer
2553  uint32_t thread_id; // Thread id
2554  const rocprofiler_dispatch_record_t* record; // Dispatch record
2556 
2557 // Profiling callback type
2558 typedef hsa_status_t (*rocprofiler_callback_t)(
2559  const rocprofiler_callback_data_t* callback_data, // [in] callback data
2560  void* user_data, // [in/out] user data passed to the callback
2561  rocprofiler_group_t* group); // [out] returned profiling group
2562 
2563 // Queue callbacks
2564 typedef struct {
2565  rocprofiler_callback_t dispatch; // dispatch callback
2566  hsa_status_t (*create)(hsa_queue_t* queue, void* data); // create callback
2567  hsa_status_t (*destroy)(hsa_queue_t* queue, void* data); // destroy callback
2569 
2570 // Set queue callbacks
2572  rocprofiler_queue_callbacks_t callbacks, // callbacks
2573  void* data); // [in/out] passed callbacks data
2574 
2575 // Remove queue callbacks
2577 
2578 // Start/stop queue callbacks
2581 
2583 // Start/stop profiling
2584 //
2585 // Start/stop the context profiling invocation, have to be as many as
2586 // contect.invocations' to collect all profiling data
2587 
2588 // Start profiling
2589 hsa_status_t rocprofiler_start(rocprofiler_t* context, // [in/out] profiling context
2590  uint32_t group_index); // group index
2591 
2592 // Stop profiling
2593 hsa_status_t rocprofiler_stop(rocprofiler_t* context, // [in/out] profiling context
2594  uint32_t group_index); // group index
2595 
2596 // Read profiling
2597 hsa_status_t rocprofiler_read(rocprofiler_t* context, // [in/out] profiling context
2598  uint32_t group_index); // group index
2599 
2600 // Read profiling data
2601 hsa_status_t rocprofiler_get_data(rocprofiler_t* context, // [in/out] profiling context
2602  uint32_t group_index); // group index
2603 
2604 // Get profiling groups count
2605 hsa_status_t rocprofiler_group_count(const rocprofiler_t* context, // [in] profiling context
2606  uint32_t* group_count); // [out] profiling groups count
2607 
2608 // Get profiling group for a given index
2609 hsa_status_t rocprofiler_get_group(rocprofiler_t* context, // [in] profiling context
2610  uint32_t group_index, // profiling group index
2611  rocprofiler_group_t* group); // [out] profiling group
2612 
2613 // Start profiling
2614 hsa_status_t rocprofiler_group_start(rocprofiler_group_t* group); // [in/out] profiling group
2615 
2616 // Stop profiling
2617 hsa_status_t rocprofiler_group_stop(rocprofiler_group_t* group); // [in/out] profiling group
2618 
2619 // Read profiling
2620 hsa_status_t rocprofiler_group_read(rocprofiler_group_t* group); // [in/out] profiling group
2621 
2622 // Get profiling data
2623 hsa_status_t rocprofiler_group_get_data(rocprofiler_group_t* group); // [in/out] profiling group
2624 
2625 // Get metrics data
2626 hsa_status_t rocprofiler_get_metrics(const rocprofiler_t* context); // [in/out] profiling context
2627 
2628 // Definition of output data iterator callback
2629 typedef hsa_ven_amd_aqlprofile_data_callback_t rocprofiler_trace_data_callback_t;
2630 
2631 // Method for iterating the events output data
2633  rocprofiler_t* context, // [in] profiling context
2634  rocprofiler_trace_data_callback_t callback, // callback to iterate the output data
2635  void* data); // [in/out] callback data
2636 
2638 // Profiling features and data
2639 //
2640 // Profiling features objects have profiling feature info, type, parameters and data
2641 // Also profiling data samplaes can be iterated using a callback
2642 
2643 // Profiling info kind
2644 typedef enum {
2645  ROCPROFILER_INFO_KIND_METRIC = 0, // metric info
2646  ROCPROFILER_INFO_KIND_METRIC_COUNT = 1, // metric features count, int32
2647  ROCPROFILER_INFO_KIND_TRACE = 2, // trace info
2648  ROCPROFILER_INFO_KIND_TRACE_COUNT = 3, // trace features count, int32
2649  ROCPROFILER_INFO_KIND_TRACE_PARAMETER = 4, // trace parameter info
2650  ROCPROFILER_INFO_KIND_TRACE_PARAMETER_COUNT = 5 // trace parameter count, int32
2652 
2653 // Profiling info query
2654 typedef union {
2655  rocprofiler_info_kind_t info_kind; // queried profiling info kind
2656  struct {
2657  const char* trace_name; // queried info trace name
2658  } trace_parameter;
2660 
2661 // Profiling info data
2662 typedef struct {
2663  uint32_t agent_index; // GPU HSA agent index (GPU Driver Node ID as reported in the sysfs topology)
2664  rocprofiler_info_kind_t kind; // info data kind
2665  union {
2666  struct {
2667  const char* name; // metric name
2668  uint32_t instances; // instances number
2669  const char* expr; // metric expression, NULL for basic counters
2670  const char* description; // metric description
2671  const char* block_name; // block name
2672  uint32_t block_counters; // number of block counters
2673  } metric;
2674  struct {
2675  const char* name; // trace name
2676  const char* description; // trace description
2677  uint32_t parameter_count; // supported by the trace number parameters
2678  } trace;
2679  struct {
2680  uint32_t code; // parameter code
2681  const char* trace_name; // trace name
2682  const char* parameter_name; // parameter name
2683  const char* description; // trace parameter description
2684  } trace_parameter;
2685  };
2687 
2688 // Return the info for a given info kind
2690  const hsa_agent_t* agent, // [in] GFXIP handle
2691  rocprofiler_info_kind_t kind, // kind of iterated info
2692  void *data); // [in/out] returned data
2693 
2694 // Iterate over the info for a given info kind, and invoke an application-defined callback on every iteration
2696  const hsa_agent_t* agent, // [in] GFXIP handle
2697  rocprofiler_info_kind_t kind, // kind of iterated info
2698  hsa_status_t (*callback)(const rocprofiler_info_data_t info, void *data), // callback
2699  void *data); // [in/out] data passed to callback
2700 
2701 // Iterate over the info for a given info query, and invoke an application-defined callback on every iteration
2703  const hsa_agent_t *agent, // [in] GFXIP handle
2704  rocprofiler_info_query_t query, // iterated info query
2705  hsa_status_t (*callback)(const rocprofiler_info_data_t info, void *data), // callback
2706  void *data); // [in/out] data passed to callback
2707 
2708 // Create a profiled queue. All dispatches on this queue will be profiled
2710  hsa_agent_t agent_handle,uint32_t size, hsa_queue_type32_t type,
2711  void (*callback)(hsa_status_t status, hsa_queue_t* source, void* data),
2712  void* data, uint32_t private_segment_size, uint32_t group_segment_size,
2713  hsa_queue_t** queue);
2714 
2716 // Profiling pool
2717 //
2718 // Support for profiling contexts pool
2719 // The API provide capability to create a contexts pool for a given agent and a set of features,
2720 // to fetch/relase a context entry, to register a callback for the contexts completion.
2721 
2722 // Profiling pool handle
2723 typedef void rocprofiler_pool_t;
2724 
2725 // Profiling pool entry
2726 typedef struct {
2727  rocprofiler_t* context; // context object
2728  void* payload; // payload data object
2730 
2731 // Profiling handler, calling on profiling completion
2732 typedef bool (*rocprofiler_pool_handler_t)(const rocprofiler_pool_entry_t* entry, void* arg);
2733 
2734 // Profiling preperties
2735 typedef struct {
2736  uint32_t num_entries; // pool size entries
2737  uint32_t payload_bytes; // payload size bytes
2738  rocprofiler_pool_handler_t handler; // handler on context completion
2739  void* handler_arg; // the handler arg
2741 
2742 // Open profiling pool
2744  hsa_agent_t agent, // GPU handle
2745  rocprofiler_feature_t* features, // [in] profiling features array
2746  uint32_t feature_count, // profiling info count
2747  rocprofiler_pool_t** pool, // [out] context object
2748  uint32_t mode, // profiling mode mask
2749  rocprofiler_pool_properties_t*); // pool properties
2750 
2751 // Close profiling pool
2753  rocprofiler_pool_t* pool); // profiling pool handle
2754 
2755 // Fetch profiling pool entry
2757  rocprofiler_pool_t* pool, // profiling pool handle
2758  rocprofiler_pool_entry_t* entry); // [out] empty profiling pool entry
2759 
2760 // Release profiling pool entry
2762  rocprofiler_pool_entry_t* entry); // released profiling pool entry
2763 
2764 // Iterate fetched profiling pool entries
2766  rocprofiler_pool_t* pool, // profiling pool handle
2767  hsa_status_t (*callback)(rocprofiler_pool_entry_t* entry, void* data), // callback
2768  void *data); // [in/out] data passed to callback
2769 
2770 // Flush completed entries in profiling pool
2772  rocprofiler_pool_t* pool); // profiling pool handle
2773 
2775 // HSA intercepting API
2776 
2777 // HSA callbacks ID enumeration
2778 typedef enum {
2779  ROCPROFILER_HSA_CB_ID_ALLOCATE = 0, // Memory allocate callback
2780  ROCPROFILER_HSA_CB_ID_DEVICE = 1, // Device assign callback
2781  ROCPROFILER_HSA_CB_ID_MEMCOPY = 2, // Memcopy callback
2782  ROCPROFILER_HSA_CB_ID_SUBMIT = 3, // Packet submit callback
2783  ROCPROFILER_HSA_CB_ID_KSYMBOL = 4, // Loading/unloading of kernel symbol
2784  ROCPROFILER_HSA_CB_ID_CODEOBJ = 5 // Loading/unloading of kernel symbol
2786 
2787 // HSA callback data type
2788 typedef struct {
2789  union {
2790  struct {
2791  const void* ptr; // allocated area ptr
2792  size_t size; // allocated area size, zero size means 'free' callback
2793  hsa_amd_segment_t segment; // allocated area's memory segment type
2794  hsa_amd_memory_pool_global_flag_t global_flag; // allocated area's memory global flag
2795  int is_code; // equal to 1 if code is allocated
2796  } allocate;
2797  struct {
2798  hsa_device_type_t type; // type of assigned device
2799  uint32_t id; // id of assigned device
2800  hsa_agent_t agent; // device HSA agent handle
2801  const void* ptr; // ptr the device is assigned to
2802  } device;
2803  struct {
2804  const void* dst; // memcopy dst ptr
2805  const void* src; // memcopy src ptr
2806  size_t size; // memcopy size bytes
2807  } memcopy;
2808  struct {
2809  const void* packet; // submitted to GPU packet
2810  const char* kernel_name; // kernel name, not NULL if dispatch
2811  hsa_queue_t* queue; // HSA queue the kernel was submitted to
2812  uint32_t device_type; // type of device the packed is submitted to
2813  uint32_t device_id; // id of device the packed is submitted to
2814  } submit;
2815  struct {
2816  uint64_t object; // kernel symbol object
2817  const char* name; // kernel symbol name
2818  uint32_t name_length; // kernel symbol name length
2819  int unload; // symbol executable destroy
2820  } ksymbol;
2821  struct {
2822  uint32_t storage_type; // code object storage type
2823  int storage_file; // origin file descriptor
2824  uint64_t memory_base; // origin memory base
2825  uint64_t memory_size; // origin memory size
2826  uint64_t load_base; // codeobj load base
2827  uint64_t load_size; // codeobj load size
2828  uint64_t load_delta; // codeobj load size
2829  uint32_t uri_length; // URI string length
2830  char* uri; // URI string
2831  int unload; // unload flag
2832  } codeobj;
2833  };
2835 
2836 // HSA callback function type
2837 typedef hsa_status_t (*rocprofiler_hsa_callback_fun_t)(
2838  rocprofiler_hsa_cb_id_t id, // callback id
2839  const rocprofiler_hsa_callback_data_t* data, // [in] callback data
2840  void* arg); // [in/out] user passed data
2841 
2842 // HSA callbacks structure
2843 typedef struct {
2844  rocprofiler_hsa_callback_fun_t allocate; // memory allocate callback
2845  rocprofiler_hsa_callback_fun_t device; // agent assign callback
2846  rocprofiler_hsa_callback_fun_t memcopy; // memory copy callback
2847  rocprofiler_hsa_callback_fun_t submit; // packet submit callback
2848  rocprofiler_hsa_callback_fun_t ksymbol; // kernel symbol callback
2849  rocprofiler_hsa_callback_fun_t codeobj; // codeobject load/unload callback
2851 
2852 // Set callbacks. If the callback is NULL then it is disabled.
2853 // If callback returns a value that is not HSA_STATUS_SUCCESS the callback
2854 // will be unregistered.
2856  const rocprofiler_hsa_callbacks_t callbacks, // HSA callback function
2857  void* arg); // callback user data
2858 
2859 #ifdef __cplusplus
2860 } // extern "C" block
2861 #endif // __cplusplus
2862 
2863 #endif // INC_ROCPROFILER_H_
ROCPROFILER_API rocprofiler_status_t rocprofiler_device_profiling_session_destroy(rocprofiler_session_id_t session_id) ROCPROFILER_VERSION_9_0
Destroy the device profiling session that was created previously.
ROCPROFILER_API rocprofiler_status_t rocprofiler_device_profiling_session_stop(rocprofiler_session_id_t session_id) ROCPROFILER_VERSION_9_0
Stop the device profiling session that was created previously.
ROCPROFILER_API rocprofiler_status_t rocprofiler_device_profiling_session_create(const char **counter_names, uint64_t num_counters, rocprofiler_session_id_t *session_id, int cpu_index, int gpu_index) ROCPROFILER_VERSION_9_0
Create a device profiling session.
ROCPROFILER_API rocprofiler_status_t rocprofiler_device_profiling_session_poll(rocprofiler_session_id_t session_id, rocprofiler_device_profile_metric_t *data) ROCPROFILER_VERSION_9_0
Poll the device profiling session to read counters from the GPU device.
ROCPROFILER_API rocprofiler_status_t rocprofiler_device_profiling_session_start(rocprofiler_session_id_t session_id) ROCPROFILER_VERSION_9_0
Start the device profiling session that was created previously.
rocprofiler_record_kind_t
Record kind.
Definition: rocprofiler.h:461
@ ROCPROFILER_PC_SAMPLING_RECORD
Represents a PC sampling record.
Definition: rocprofiler.h:478
@ ROCPROFILER_TRACER_RECORD
Represents records that have tracing data (ex.
Definition: rocprofiler.h:470
@ ROCPROFILER_PROFILER_RECORD
Represents records that have profiling data (ex.
Definition: rocprofiler.h:466
@ ROCPROFILER_SPM_RECORD
Represents SPM records.
Definition: rocprofiler.h:482
@ ROCPROFILER_ATT_TRACER_RECORD
Represents a ATT tracing record (Not available yet)
Definition: rocprofiler.h:474
ROCPROFILER_API rocprofiler_status_t rocprofiler_query_hip_tracer_api_data_info(rocprofiler_session_id_t session_id, rocprofiler_tracer_hip_api_data_info_t kind, rocprofiler_tracer_api_data_handle_t api_data_id, rocprofiler_tracer_operation_id_t operation_id, char **data) ROCPROFILER_VERSION_9_0
Query API Data Information using an allocated data pointer by the user, user can get the size of the ...
ROCPROFILER_API rocprofiler_status_t rocprofiler_query_hip_tracer_api_data_info_size(rocprofiler_session_id_t session_id, rocprofiler_tracer_hip_api_data_info_t kind, rocprofiler_tracer_api_data_handle_t api_data_id, rocprofiler_tracer_operation_id_t operation_id, size_t *data_size) ROCPROFILER_VERSION_9_0
Query Tracer API Call Data Information size to allow the user to allocate the right size for the info...
rocprofiler_tracer_hip_api_data_info_t
hip Tracer Data Information Kinds
Definition: rocprofiler.h:1364
@ ROCPROFILER_HIP_STREAM_ID
Stream ID.
Definition: rocprofiler.h:1402
@ ROCPROFILER_HIP_API_DATA
HIP API Data User has to reinterpret_cast to hip_api_data_t*.
Definition: rocprofiler.h:1407
@ ROCPROFILER_HIP_MEM_COPY_SRC
Only available to hip calls that has memory copy operation with source available.
Definition: rocprofiler.h:1380
@ ROCPROFILER_HIP_MEM_COPY_SIZE
Only available to hip calls that has memory copy operation with data size available.
Definition: rocprofiler.h:1390
@ ROCPROFILER_HIP_KERNEL_NAME
Only available for HIP Functions that lead to kernel launch to get the kernel name.
Definition: rocprofiler.h:1375
@ ROCPROFILER_HIP_ACTIVITY_NAME
HIP Activity Name.
Definition: rocprofiler.h:1398
@ ROCPROFILER_HIP_API_DATA_STR
Reporting the whole API data as one string.
Definition: rocprofiler.h:1394
@ ROCPROFILER_HIP_FUNCTION_NAME
hip Tracer Data kind that can be used to return to a pointer to all the API Call Data
Definition: rocprofiler.h:1370
@ ROCPROFILER_HIP_MEM_COPY_DST
Only available to hip calls that has memory copy operation with destination available.
Definition: rocprofiler.h:1385
ROCPROFILER_API rocprofiler_status_t rocprofiler_query_hsa_tracer_api_data_info(rocprofiler_session_id_t session_id, rocprofiler_tracer_hsa_api_data_info_t kind, rocprofiler_tracer_api_data_handle_t api_data_id, rocprofiler_tracer_operation_id_t operation_id, char **data) ROCPROFILER_VERSION_9_0
Query API Data Information using an allocated data pointer by the user, user can get the size of the ...
ROCPROFILER_API rocprofiler_status_t rocprofiler_query_hsa_tracer_api_data_info_size(rocprofiler_session_id_t session_id, rocprofiler_tracer_hsa_api_data_info_t kind, rocprofiler_tracer_api_data_handle_t api_data_id, rocprofiler_tracer_operation_id_t operation_id, size_t *data_size) ROCPROFILER_VERSION_9_0
Query Tracer API Call Data Information size to allow the user to allocate the right size for the info...
rocprofiler_tracer_hsa_api_data_info_t
hsa Tracer Data Information Kinds
Definition: rocprofiler.h:1275
@ ROCPROFILER_HSA_FUNCTION_NAME
HSA Tracer Data kind that can be used to return to a pointer to all the API Call Data.
Definition: rocprofiler.h:1280
@ ROCPROFILER_HSA_API_DATA
HSA Data User has to reinterpret_cast to hsa_api_data_t*.
Definition: rocprofiler.h:1293
@ ROCPROFILER_HSA_ACTIVITY_NAME
HSA Activity Name.
Definition: rocprofiler.h:1288
@ ROCPROFILER_HSA_API_DATA_STR
HSA API Data in string format.
Definition: rocprofiler.h:1284
void(* rocprofiler_buffer_callback_t)(const rocprofiler_record_header_t *begin, const rocprofiler_record_header_t *end, rocprofiler_session_id_t session_id, rocprofiler_buffer_id_t buffer_id)
Memory pool buffer callback.
Definition: rocprofiler.h:1637
ROCPROFILER_API rocprofiler_status_t rocprofiler_next_record(const rocprofiler_record_header_t *record, const rocprofiler_record_header_t **next, rocprofiler_session_id_t session_id, rocprofiler_buffer_id_t buffer_id) ROCPROFILER_VERSION_9_0
Get a pointer to the next profiling record.
rocprofiler_buffer_property_kind_t
Buffer Property Options.
Definition: rocprofiler.h:1599
ROCPROFILER_API rocprofiler_status_t rocprofiler_flush_data(rocprofiler_session_id_t session_id, rocprofiler_buffer_id_t buffer_id) ROCPROFILER_VERSION_9_0
Flush specific Buffer.
@ ROCPROFILER_BUFFER_PROPERTY_KIND_INTERVAL_FLUSH
Flush interval.
Definition: rocprofiler.h:1603
ROCPROFILER_API rocprofiler_status_t rocprofiler_query_counter_info_size(rocprofiler_session_id_t session_id, rocprofiler_counter_info_kind_t counter_info_type, rocprofiler_counter_id_t counter_id, size_t *data_size) ROCPROFILER_VERSION_9_0
Query Counter Information Data size to allow the user to allocate the right size for the information ...
ROCPROFILER_API rocprofiler_status_t rocprofiler_query_counter_info(rocprofiler_session_id_t session_id, rocprofiler_counter_info_kind_t kind, rocprofiler_counter_id_t counter_id, const char **data) ROCPROFILER_VERSION_9_0
Query Counter Information Data using an allocated data pointer by the user, user can get the size of ...
rocprofiler_counter_info_kind_t
Counter Information Types, can be used by rocprofiler_query_counter_info.
Definition: rocprofiler.h:795
ROCPROFILER_API rocprofiler_status_t rocprofiler_iterate_counters(rocprofiler_counters_info_callback_t counters_info_callback) ROCPROFILER_VERSION_9_0
int(* rocprofiler_counters_info_callback_t)(rocprofiler_counter_info_t counter, const char *gpu_name, uint32_t gpu_index) ROCPROFILER_VERSION_9_0
Definition: rocprofiler.h:775
@ ROCPROFILER_COUNTER_NAME
Can be used to get the counter name.
Definition: rocprofiler.h:799
@ ROCPROFILER_COUNTER_BLOCK_ID
Can be used to get the block id of a counter.
Definition: rocprofiler.h:803
@ ROCPROFILER_COUNTER_HIERARCHY_LEVEL
This is the level of hierarchy from the GFX_IP where the counter value should be collected.
Definition: rocprofiler.h:808
const char * block_name
Definition: rocprofiler.h:2671
rocprofiler_data_kind_t kind
Definition: rocprofiler.h:2413
const char ** counters_names
Counters to profile.
Definition: rocprofiler.h:1882
hsa_agent_t agent
Definition: rocprofiler.h:2800
int counters_count
Counters count.
Definition: rocprofiler.h:1886
rocprofiler_filter_property_kind_t kind
Filter Property kind.
Definition: rocprofiler.h:1861
rocprofiler_data_kind_t
Definition: rocprofiler.h:2402
uint64_t workgroup_size
workgroup size
Definition: rocprofiler.h:917
uint64_t lds_size
lds_size
Definition: rocprofiler.h:921
uint32_t agent_index
Definition: rocprofiler.h:2663
hsa_status_t rocprofiler_get_metrics(const rocprofiler_t *context)
uint32_t payload_bytes
Definition: rocprofiler.h:2737
hsa_status_t rocprofiler_query_info(const hsa_agent_t *agent, rocprofiler_info_query_t query, hsa_status_t(*callback)(const rocprofiler_info_data_t info, void *data), void *data)
rocprofiler_timestamp_t timestamp
Host timestamp.
Definition: rocprofiler.h:1551
const char * description
Definition: rocprofiler.h:2670
const char * trace_name
Definition: rocprofiler.h:2657
uint64_t handle
Session Identifier to get the session or to be used to call any API that needs to deal with a specifi...
Definition: rocprofiler.h:399
rocprofiler_hsa_callback_fun_t allocate
Definition: rocprofiler.h:2844
uint32_t code
Definition: rocprofiler.h:2680
uint32_t se
Sampled shader element.
Definition: rocprofiler.h:1564
uint32_t feature_count
Definition: rocprofiler.h:2458
uint64_t value
Definition: rocprofiler.h:1619
hsa_status_t rocprofiler_iterate_trace_data(rocprofiler_t *context, rocprofiler_trace_data_callback_t callback, void *data)
rocprofiler_kernel_properties_t kernel_properties
kernel properties, including the grid size, work group size, registers count, wave size and completio...
Definition: rocprofiler.h:1089
uint32_t instance_count
Definition: rocprofiler.h:2422
uint32_t uri_length
Definition: rocprofiler.h:2829
uint64_t shader_engine_data_count
The count of the shader engine ATT data.
Definition: rocprofiler.h:1105
hsa_status_t rocprofiler_get_info(const hsa_agent_t *agent, rocprofiler_info_kind_t kind, void *data)
hsa_status_t rocprofiler_group_get_data(rocprofiler_group_t *group)
rocprofiler_thread_id_t thread_id
Thread id.
Definition: rocprofiler.h:1093
hsa_status_t(* rocprofiler_callback_t)(const rocprofiler_callback_data_t *callback_data, void *user_data, rocprofiler_group_t *group)
Definition: rocprofiler.h:2558
uint64_t handle
Kernel object identifier.
Definition: rocprofiler.h:678
hsa_status_t rocprofiler_pool_iterate(rocprofiler_pool_t *pool, hsa_status_t(*callback)(rocprofiler_pool_entry_t *entry, void *data), void *data)
uint64_t cycle
GPU clock counter (not currently used)
Definition: rocprofiler.h:1555
char * uri
Definition: rocprofiler.h:2830
rocprofiler_kernel_id_t kernel_id
Kernel Identifier to be used by the user to get the kernel info using rocprofiler_query_kernel_info.
Definition: rocprofiler.h:1074
rocprofiler_hsa_cb_id_t
Definition: rocprofiler.h:2778
hsa_amd_segment_t segment
Definition: rocprofiler.h:2793
rocprofiler_info_kind_t kind
Definition: rocprofiler.h:2664
rocprofiler_agent_id_t gpu_id
Agent Identifier to be used by the user to get the Agent Information using rocprofiler_query_agent_in...
Definition: rocprofiler.h:970
rocprofiler_kernel_properties_t kernel_properties
kernel properties, including the grid size, work group size, registers count, wave size and completio...
Definition: rocprofiler.h:990
hsa_queue_t * queue
Definition: rocprofiler.h:2811
const char * name
Definition: rocprofiler.h:2667
uint64_t value
Correlation ID Value.
Definition: rocprofiler.h:1171
uint32_t trace_size
Definition: rocprofiler.h:2368
uint32_t obj_dumping
Definition: rocprofiler.h:2375
uint32_t instances_count
Definition: rocprofiler.h:770
uint32_t k_concurrent
Definition: rocprofiler.h:2373
hsa_agent_t agent
Definition: rocprofiler.h:2543
rocprofiler_hsa_callback_fun_t device
Definition: rocprofiler.h:2845
rocprofiler_t * context
Definition: rocprofiler.h:2727
rocprofiler_feature_t ** features
Definition: rocprofiler.h:2457
uint32_t value
Definition: rocprofiler.h:1847
uint32_t device_id
Definition: rocprofiler.h:2813
rocprofiler_tracer_operation_id_t operation_id
Tracing Operation ID for HIP/HSA.
Definition: rocprofiler.h:1499
uint32_t hsa_intercepting
Definition: rocprofiler.h:2372
hsa_status_t rocprofiler_open(hsa_agent_t agent, rocprofiler_feature_t *features, uint32_t feature_count, rocprofiler_t **context, uint32_t mode, rocprofiler_properties_t *properties)
uint32_t sampling_rate
Sampling rate.
Definition: rocprofiler.h:1890
size_t size
Definition: rocprofiler.h:2806
uint64_t handle
Record ID handle.
Definition: rocprofiler.h:455
rocprofiler_counter_id_t counter_handler
Counter Instance Identifier.
Definition: rocprofiler.h:885
rocprofiler_queue_index_t queue_idx
Queue Index - packet index in the queue.
Definition: rocprofiler.h:1097
uint32_t result_int32
Definition: rocprofiler.h:2415
uint64_t value
Definition: rocprofiler.h:1615
double value
Counter value.
Definition: rocprofiler.h:873
uint64_t accum_vgpr_count
accum vgpr count
Definition: rocprofiler.h:933
const char * description
Definition: rocprofiler.h:768
rocprofiler_kernel_id_t kernel_id
Kernel Identifier to be used by the user to get the kernel info using rocprofiler_query_kernel_info.
Definition: rocprofiler.h:965
int unload
Definition: rocprofiler.h:2831
const void * packet
Definition: rocprofiler.h:2809
const char * expr
Definition: rocprofiler.h:2669
hsa_queue_t * queue
Definition: rocprofiler.h:2474
uint32_t queue_id
Definition: rocprofiler.h:2547
const void * src
Definition: rocprofiler.h:2805
const void * handle
Data Handler Identifier.
Definition: rocprofiler.h:1181
rocprofiler_record_kind_t kind
Represents the kind of the record using rocprofiler_record_kind_t.
Definition: rocprofiler.h:492
size_t size
API Data Size.
Definition: rocprofiler.h:1185
rocprofiler_hsa_callback_fun_t codeobj
Definition: rocprofiler.h:2849
hsa_status_t rocprofiler_start_queue_callbacks()
hsa_status_t rocprofiler_pool_flush(rocprofiler_pool_t *pool)
uint64_t signal_handle
Dispatch completion signal handle.
Definition: rocprofiler.h:945
uint64_t load_base
Definition: rocprofiler.h:2826
rocprofiler_info_kind_t info_kind
Definition: rocprofiler.h:2655
uint64_t end
Definition: rocprofiler.h:2537
rocprofiler_record_counter_instance_t * counters
Counters, including identifiers to get counter information and Counters values.
Definition: rocprofiler.h:985
hsa_status_t rocprofiler_add_feature(const rocprofiler_feature_t *feature, rocprofiler_feature_set_t *features_set)
rocprofiler_queue_id_t queue_id
Queue Identifier to be used by the user to get the Queue Information using rocprofiler_query_agent_in...
Definition: rocprofiler.h:975
rocprofiler_pc_sample_t pc_sample
PC sample data.
Definition: rocprofiler.h:1584
uint32_t code_obj_tracking
Definition: rocprofiler.h:2366
rocprofiler_info_kind_t
Definition: rocprofiler.h:2644
rocprofiler_thread_id_t thread_id
Thread id.
Definition: rocprofiler.h:994
hsa_status_t rocprofiler_group_stop(rocprofiler_group_t *group)
uint32_t timestamp_on
Definition: rocprofiler.h:2371
rocprofiler_timestamp_t begin
Definition: rocprofiler.h:438
uint32_t value
Thread ID.
Definition: rocprofiler.h:744
rocprofiler_hip_function_name_t * hip_functions_names
Definition: rocprofiler.h:1868
uint64_t value
queue index value
Definition: rocprofiler.h:862
uint64_t handle
a unique id to represent every agent on the system, this handle should be unique across all nodes in ...
Definition: rocprofiler.h:514
rocprofiler_record_header_t header
ROCProfiler General Record base header to identify the id and kind of every record.
Definition: rocprofiler.h:1069
uint32_t name_length
Definition: rocprofiler.h:2818
void * handler_arg
Definition: rocprofiler.h:2478
void * ptr
Definition: rocprofiler.h:2420
uint32_t opt_mode
Definition: rocprofiler.h:2374
rocprofiler_record_header_t header
ROCProfiler General Record base header to identify the id and kind of every record.
Definition: rocprofiler.h:1487
uint64_t pc
Sampled program counter.
Definition: rocprofiler.h:1560
int is_code
Definition: rocprofiler.h:2795
void * handler_arg
Definition: rocprofiler.h:2739
uint64_t sgpr_count
sgpr_count
Definition: rocprofiler.h:937
uint32_t intercept_mode
Definition: rocprofiler.h:2365
rocprofiler_tracer_activity_domain_t domain
Activity domain id, represents the type of the APIs that are being traced.
Definition: rocprofiler.h:1495
rocprofiler_record_header_t header
ROCProfiler General Record base header to identify the id and kind of every record.
Definition: rocprofiler.h:960
rocprofiler_record_header_t header
ROCProfiler General Record base header to identify the id and kind of every record.
Definition: rocprofiler.h:1580
const char ** name_regex
Definition: rocprofiler.h:1867
uint64_t value
Definition: rocprofiler.h:418
rocprofiler_record_counter_value_t value
Counter Instance Value.
Definition: rocprofiler.h:889
uint64_t scratch_size
scratch_size
Definition: rocprofiler.h:925
rocprofiler_record_header_timestamp_t timestamps
Timestamps, start and end timestamps of the record data (ex.
Definition: rocprofiler.h:980
uint32_t parameter_count
Definition: rocprofiler.h:2677
uint64_t kernel_object
Definition: rocprofiler.h:2551
uint32_t value
Definition: rocprofiler.h:1006
rocprofiler_timestamp_t end
Definition: rocprofiler.h:439
const char * trace_name
Definition: rocprofiler.h:2681
hsa_status_t rocprofiler_group_start(rocprofiler_group_t *group)
const void * ptr
Definition: rocprofiler.h:2801
uint64_t arch_vgpr_count
arch vgpr count
Definition: rocprofiler.h:929
uint32_t id
Definition: rocprofiler.h:1161
uint64_t load_size
Definition: rocprofiler.h:2827
int storage_file
Definition: rocprofiler.h:2823
hsa_status_t rocprofiler_pool_open(hsa_agent_t agent, rocprofiler_feature_t *features, uint32_t feature_count, rocprofiler_pool_t **pool, uint32_t mode, rocprofiler_pool_properties_t *)
uint32_t id
Definition: rocprofiler.h:2799
const char * counter_name
Definition: rocprofiler.h:1848
hsa_status_t rocprofiler_stop_queue_callbacks()
bool copy
Definition: rocprofiler.h:2423
rocprofiler_agent_id_t gpu_id
Sampled GPU agent.
Definition: rocprofiler.h:1568
rocprofiler_hsa_function_name_t * hsa_functions_names
Definition: rocprofiler.h:1869
const char * name
Definition: rocprofiler.h:2817
const rocprofiler_parameter_t * parameters
Definition: rocprofiler.h:2438
uint64_t load_delta
Definition: rocprofiler.h:2828
uint64_t value
Counters Instances Count for every record.
Definition: rocprofiler.h:901
rocprofiler_record_header_t header
ROCProfiler General Record base header to identify the id and kind of every record.
Definition: rocprofiler.h:1036
rocprofiler_record_counters_instances_count_t counters_count
The count of the counters that were collected by the profiler.
Definition: rocprofiler.h:1002
uint64_t handle
Unique Id for every queue for one agent for one system.
Definition: rocprofiler.h:607
rocprofiler_feature_kind_t kind
Definition: rocprofiler.h:2430
const char * name
Definition: rocprofiler.h:767
uint64_t id
Definition: rocprofiler.h:1472
rocprofiler_hsa_callback_fun_t submit
Definition: rocprofiler.h:2847
hsa_status_t rocprofiler_features_set_open(hsa_agent_t agent, rocprofiler_feature_set_t *features_set, rocprofiler_t **context, uint32_t mode, rocprofiler_properties_t *properties)
uint32_t parameter_count
Definition: rocprofiler.h:2439
uint64_t grid_size
Grid Size.
Definition: rocprofiler.h:913
void rocprofiler_t
Definition: rocprofiler.h:2452
rocprofiler_agent_id_t gpu_id
Agent Identifier to be used by the user to get the Agent Information using rocprofiler_query_agent_in...
Definition: rocprofiler.h:1079
rocprofiler_queue_id_t queue_id
Queue Identifier to be used by the user to get the Queue Information using rocprofiler_query_agent_in...
Definition: rocprofiler.h:1084
double value
Definition: rocprofiler.h:2269
rocprofiler_mode_t
Definition: rocprofiler.h:2463
uint64_t memory_size
Definition: rocprofiler.h:2825
size_t size
Definition: rocprofiler.h:2792
rocprofiler_tracer_api_data_handle_t api_data_handle
API Data Handler to be used by rocprofiler_query_roctx_tracer_api_data_info or rocprofiler_query_hsa_...
Definition: rocprofiler.h:1506
rocprofiler_queue_id_t queue_id
Queue identifier that can be used as a handler in rocprofiler_query_queue_info.
Definition: rocprofiler.h:1524
hsa_status_t rocprofiler_get_group(rocprofiler_t *context, uint32_t group_index, rocprofiler_group_t *group)
rocprofiler_tracer_external_id_t external_id
Tracing external ID.
Definition: rocprofiler.h:1491
hsa_device_type_t type
Definition: rocprofiler.h:2798
const char * block
Definition: rocprofiler.h:2434
void rocprofiler_feature_set_t
Definition: rocprofiler.h:2444
hsa_status_t rocprofiler_group_count(const rocprofiler_t *context, uint32_t *group_count)
hsa_status_t rocprofiler_reset(rocprofiler_t *context, uint32_t group_index)
uint64_t complete
Definition: rocprofiler.h:2538
const char * expression
Definition: rocprofiler.h:769
hsa_signal_t completion_signal
Definition: rocprofiler.h:2548
const char * name
Definition: rocprofiler.h:2432
const rocprofiler_dispatch_record_t * record
Definition: rocprofiler.h:2554
double result_double
Definition: rocprofiler.h:2418
uint32_t storage_type
Definition: rocprofiler.h:2822
rocprofiler_record_se_att_data_t * shader_engine_data
ATT data output from each shader engine.
Definition: rocprofiler.h:1101
hsa_ven_amd_aqlprofile_parameter_t rocprofiler_parameter_t
Definition: rocprofiler.h:2399
bool(* rocprofiler_handler_t)(rocprofiler_group_t group, void *arg)
Definition: rocprofiler.h:2470
const char * parameter_name
Definition: rocprofiler.h:2682
const char * description
Definition: rocprofiler.h:2683
uint32_t memcopy_tracking
Definition: rocprofiler.h:2367
uint64_t queue_index
Definition: rocprofiler.h:2546
uint16_t value
Definition: rocprofiler.h:1011
rocprofiler_att_parameter_name_t parameter_name
Definition: rocprofiler.h:1845
hsa_ven_amd_aqlprofile_data_callback_t rocprofiler_trace_data_callback_t
Definition: rocprofiler.h:2629
bool(* rocprofiler_pool_handler_t)(const rocprofiler_pool_entry_t *entry, void *arg)
Definition: rocprofiler.h:2732
uint64_t begin
Definition: rocprofiler.h:2536
rocprofiler_record_header_timestamp_t timestamps
Timestamps.
Definition: rocprofiler.h:1514
hsa_status_t rocprofiler_pool_fetch(rocprofiler_pool_t *pool, rocprofiler_pool_entry_t *entry)
uint64_t timeout
Definition: rocprofiler.h:2370
hsa_status_t rocprofiler_get_data(rocprofiler_t *context, uint32_t group_index)
const char * kernel_name
Definition: rocprofiler.h:2810
uint32_t queue_depth
Definition: rocprofiler.h:2476
const char * name
Definition: rocprofiler.h:2675
float result_float
Definition: rocprofiler.h:2417
hsa_status_t(* rocprofiler_hsa_callback_fun_t)(rocprofiler_hsa_cb_id_t id, const rocprofiler_hsa_callback_data_t *data, void *arg)
Definition: rocprofiler.h:2837
uint32_t trace_local
Definition: rocprofiler.h:2369
const amd_kernel_code_t * kernel_code
Definition: rocprofiler.h:2552
rocprofiler_agent_id_t agent_id
Agent identifier that can be used as a handler in rocprofiler_query_agent_info.
Definition: rocprofiler.h:1519
rocprofiler_t * context
Definition: rocprofiler.h:2459
uint32_t device_type
Definition: rocprofiler.h:2812
uint32_t buffer_size
Definition: rocprofiler.h:1054
hsa_status_t rocprofiler_iterate_info(const hsa_agent_t *agent, rocprofiler_info_kind_t kind, hsa_status_t(*callback)(const rocprofiler_info_data_t info, void *data), void *data)
const hsa_queue_t * queue
Definition: rocprofiler.h:2545
rocprofiler_record_id_t id
Represents the id of the record.
Definition: rocprofiler.h:496
uint64_t object
Definition: rocprofiler.h:2816
int unload
Definition: rocprofiler.h:2819
uint64_t value
Definition: rocprofiler.h:1535
const void * dst
Definition: rocprofiler.h:2804
uint32_t event
Definition: rocprofiler.h:2435
hsa_status_t rocprofiler_get_agent(rocprofiler_t *context, hsa_agent_t *agent)
uint32_t num_entries
Definition: rocprofiler.h:2736
hsa_status_t rocprofiler_queue_create_profiled(hsa_agent_t agent_handle, uint32_t size, hsa_queue_type32_t type, void(*callback)(hsa_status_t status, hsa_queue_t *source, void *data), void *data, uint32_t private_segment_size, uint32_t group_segment_size, hsa_queue_t **queue)
hsa_status_t rocprofiler_close(rocprofiler_t *context)
hsa_status_t rocprofiler_pool_release(rocprofiler_pool_entry_t *entry)
const char * block_name
Definition: rocprofiler.h:771
const void * ptr
Definition: rocprofiler.h:2791
uint32_t agent_index
Definition: rocprofiler.h:2544
rocprofiler_feature_kind_t
Definition: rocprofiler.h:2391
uint64_t memory_base
Definition: rocprofiler.h:2824
rocprofiler_kernel_dispatch_id_t dispatch_id
Kernel dispatch ID.
Definition: rocprofiler.h:1546
hsa_status_t rocprofiler_start(rocprofiler_t *context, uint32_t group_index)
const char ** counters_names
Counters to profile.
Definition: rocprofiler.h:1909
const hsa_kernel_dispatch_packet_t * packet
Definition: rocprofiler.h:2549
rocprofiler_record_header_timestamp_t timestamps
Timestamps at which the counters were sampled.
Definition: rocprofiler.h:1041
hsa_status_t rocprofiler_remove_queue_callbacks()
const char * kernel_name
Definition: rocprofiler.h:2550
hsa_status_t rocprofiler_error_string(const char **str)
uint64_t wave_size
wave size
Definition: rocprofiler.h:941
hsa_amd_memory_pool_global_flag_t global_flag
Definition: rocprofiler.h:2794
rocprofiler_buffer_property_kind_t kind
Definition: rocprofiler.h:1610
rocprofiler_time_id_t
Definition: rocprofiler.h:2512
hsa_status_t rocprofiler_get_time(rocprofiler_time_id_t time_id, uint64_t timestamp, uint64_t *value_ns, uint64_t *error_ns)
void * buffer_ptr
Definition: rocprofiler.h:1053
uint32_t block_counters
Definition: rocprofiler.h:2672
rocprofiler_att_parameter_t * att_parameters
att parameters
Definition: rocprofiler.h:1913
uint64_t data_count
Data array count.
Definition: rocprofiler.h:1875
uint64_t handle
A unique id generated for every counter requested by the user.
Definition: rocprofiler.h:789
hsa_status_t rocprofiler_read(rocprofiler_t *context, uint32_t group_index)
uint32_t thread_id
Definition: rocprofiler.h:2553
rocprofiler_counter_value_t value
Definition: rocprofiler.h:2274
rocprofiler_tracer_activity_correlation_id_t correlation_id
Activity correlation ID.
Definition: rocprofiler.h:1510
rocprofiler_hsa_callback_fun_t ksymbol
Definition: rocprofiler.h:2848
uint32_t block_counters
Definition: rocprofiler.h:772
void * payload
Definition: rocprofiler.h:2728
void rocprofiler_pool_t
Definition: rocprofiler.h:2723
unsigned index
Definition: rocprofiler.h:2456
rocprofiler_handler_t handler
Definition: rocprofiler.h:2477
hsa_status_t rocprofiler_stop(rocprofiler_t *context, uint32_t group_index)
hsa_status_t rocprofiler_pool_close(rocprofiler_pool_t *pool)
uint64_t dispatch
Definition: rocprofiler.h:2535
uint32_t size
Definition: rocprofiler.h:2421
hsa_status_t rocprofiler_set_hsa_callbacks(const rocprofiler_hsa_callbacks_t callbacks, void *arg)
hsa_status_t rocprofiler_group_read(rocprofiler_group_t *group)
rocprofiler_pool_handler_t handler
Definition: rocprofiler.h:2738
rocprofiler_spm_parameter_t * spm_parameters
spm counters parameters
Definition: rocprofiler.h:1917
rocprofiler_hsa_callback_fun_t memcopy
Definition: rocprofiler.h:2846
rocprofiler_tracer_activity_domain_t * trace_apis
APIs to trace.
Definition: rocprofiler.h:1905
rocprofiler_data_t data
Definition: rocprofiler.h:2440
rocprofiler_callback_t dispatch
Definition: rocprofiler.h:2565
rocprofiler_thread_id_t thread_id
Thread id.
Definition: rocprofiler.h:1528
hsa_status_t rocprofiler_set_queue_callbacks(rocprofiler_queue_callbacks_t callbacks, void *data)
uint32_t instances
Definition: rocprofiler.h:2668
rocprofiler_agent_id_t * gpu_agent_id
Preferred agents to collect SPM on.
Definition: rocprofiler.h:1894
uint64_t value
Definition: rocprofiler.h:1611
uint64_t result_int64
Definition: rocprofiler.h:2416
rocprofiler_queue_index_t queue_idx
Queue Index - packet index in the queue.
Definition: rocprofiler.h:998
const char * description
Definition: rocprofiler.h:2676
@ ROCPROFILER_DATA_KIND_DOUBLE
Definition: rocprofiler.h:2407
@ ROCPROFILER_DATA_KIND_BYTES
Definition: rocprofiler.h:2408
@ ROCPROFILER_DATA_KIND_INT32
Definition: rocprofiler.h:2404
@ ROCPROFILER_DATA_KIND_INT64
Definition: rocprofiler.h:2405
@ ROCPROFILER_DATA_KIND_FLOAT
Definition: rocprofiler.h:2406
@ ROCPROFILER_DATA_KIND_UNINIT
Definition: rocprofiler.h:2403
@ ROCPROFILER_HSA_CB_ID_ALLOCATE
Definition: rocprofiler.h:2779
@ ROCPROFILER_HSA_CB_ID_DEVICE
Definition: rocprofiler.h:2780
@ ROCPROFILER_HSA_CB_ID_KSYMBOL
Definition: rocprofiler.h:2783
@ ROCPROFILER_HSA_CB_ID_SUBMIT
Definition: rocprofiler.h:2782
@ ROCPROFILER_HSA_CB_ID_CODEOBJ
Definition: rocprofiler.h:2784
@ ROCPROFILER_HSA_CB_ID_MEMCOPY
Definition: rocprofiler.h:2781
@ ROCPROFILER_INFO_KIND_METRIC_COUNT
Definition: rocprofiler.h:2646
@ ROCPROFILER_INFO_KIND_METRIC
Definition: rocprofiler.h:2645
@ ROCPROFILER_INFO_KIND_TRACE_PARAMETER
Definition: rocprofiler.h:2649
@ ROCPROFILER_INFO_KIND_TRACE_COUNT
Definition: rocprofiler.h:2648
@ ROCPROFILER_INFO_KIND_TRACE
Definition: rocprofiler.h:2647
@ ROCPROFILER_INFO_KIND_TRACE_PARAMETER_COUNT
Definition: rocprofiler.h:2650
@ ROCPROFILER_MODE_CREATEQUEUE
Definition: rocprofiler.h:2465
@ ROCPROFILER_MODE_SINGLEGROUP
Definition: rocprofiler.h:2466
@ ROCPROFILER_MODE_STANDALONE
Definition: rocprofiler.h:2464
@ ROCPROFILER_FEATURE_KIND_METRIC
Definition: rocprofiler.h:2392
@ ROCPROFILER_FEATURE_KIND_PCSMP_MOD
Definition: rocprofiler.h:2395
@ ROCPROFILER_FEATURE_KIND_TRACE
Definition: rocprofiler.h:2393
@ ROCPROFILER_FEATURE_KIND_SPM_MOD
Definition: rocprofiler.h:2394
@ ROCPROFILER_TIME_ID_CLOCK_MONOTONIC_RAW
Definition: rocprofiler.h:2517
@ ROCPROFILER_TIME_ID_CLOCK_REALTIME_COARSE
Definition: rocprofiler.h:2514
@ ROCPROFILER_TIME_ID_CLOCK_REALTIME
Definition: rocprofiler.h:2513
@ ROCPROFILER_TIME_ID_CLOCK_MONOTONIC_COARSE
Definition: rocprofiler.h:2516
@ ROCPROFILER_TIME_ID_CLOCK_MONOTONIC
Definition: rocprofiler.h:2515
ROCPROFILER_API rocprofiler_status_t rocprofiler_query_agent_info(rocprofiler_agent_info_kind_t kind, rocprofiler_agent_id_t descriptor, const char **name) ROCPROFILER_VERSION_9_0
Query Agent Information Data using an allocated data pointer by the user, user can get the size of th...
ROCPROFILER_API rocprofiler_status_t rocprofiler_query_agent_info_size(rocprofiler_agent_info_kind_t kind, rocprofiler_agent_id_t agent_id, size_t *data_size) ROCPROFILER_VERSION_9_0
Query Agent Information size to allow the user to allocate the right size for the information data re...
rocprofiler_agent_info_kind_t
Types of information that can be requested about the Agents.
Definition: rocprofiler.h:538
rocprofiler_agent_type_t
Using rocprofiler_query_agent_info, user can determine the type of the agent the following struct wil...
Definition: rocprofiler.h:522
@ ROCPROFILER_AGENT_TYPE
GPU Agent Type.
Definition: rocprofiler.h:546
@ ROCPROFILER_AGENT_NAME
GPU Agent Name.
Definition: rocprofiler.h:542
@ ROCPROFILER_CPU_AGENT
CPU Agent.
Definition: rocprofiler.h:526
@ ROCPROFILER_GPU_AGENT
GPU Agent.
Definition: rocprofiler.h:530
rocprofiler_kernel_info_kind_t
Kernel Information Types, can be used by rocprofiler_query_kernel_info.
Definition: rocprofiler.h:684
ROCPROFILER_API rocprofiler_status_t rocprofiler_query_kernel_info(rocprofiler_kernel_info_kind_t kind, rocprofiler_kernel_id_t kernel_id, const char **data) ROCPROFILER_VERSION_9_0
Query Kernel Information Data using an allocated data pointer by the user, user can get the size of t...
ROCPROFILER_API rocprofiler_status_t rocprofiler_query_kernel_info_size(rocprofiler_kernel_info_kind_t kind, rocprofiler_kernel_id_t kernel_id, size_t *data_size) ROCPROFILER_VERSION_9_0
Query Kernel Information Data size to allow the user to allocate the right size for the information d...
@ ROCPROFILER_KERNEL_NAME
Kernel Name Information Type.
Definition: rocprofiler.h:688
rocprofiler_queue_info_kind_t
Types of information that can be requested about the Queues.
Definition: rocprofiler.h:614
ROCPROFILER_API rocprofiler_status_t rocprofiler_query_queue_info_size(rocprofiler_queue_info_kind_t kind, rocprofiler_queue_id_t agent_id, size_t *data_size) ROCPROFILER_VERSION_9_0
Query Queue Information size to allow the user to allocate the right size for the information data re...
ROCPROFILER_API rocprofiler_status_t rocprofiler_query_queue_info(rocprofiler_queue_info_kind_t kind, rocprofiler_queue_id_t descriptor, const char **name) ROCPROFILER_VERSION_9_0
Query Queue Information Data using an allocated data pointer by the user, user can get the size of th...
@ ROCPROFILER_QUEUE_SIZE
AMD HSA Queue Size.
Definition: rocprofiler.h:618
ROCPROFILER_API rocprofiler_status_t rocprofiler_finalize() ROCPROFILER_VERSION_9_0
Finalize the API Tools.
ROCPROFILER_API rocprofiler_status_t rocprofiler_initialize() ROCPROFILER_VERSION_9_0
Initialize the API Tools.
ROCPROFILER_API rocprofiler_status_t rocprofiler_query_roctx_tracer_api_data_info(rocprofiler_session_id_t session_id, rocprofiler_tracer_roctx_api_data_info_t kind, rocprofiler_tracer_api_data_handle_t api_data_id, rocprofiler_tracer_operation_id_t operation_id, char **data) ROCPROFILER_VERSION_9_0
Query API Data Information using an allocated data pointer by the user, user can get the size of the ...
ROCPROFILER_API rocprofiler_status_t rocprofiler_query_roctx_tracer_api_data_info_size(rocprofiler_session_id_t session_id, rocprofiler_tracer_roctx_api_data_info_t kind, rocprofiler_tracer_api_data_handle_t api_data_id, rocprofiler_tracer_operation_id_t operation_id, size_t *data_size) ROCPROFILER_VERSION_9_0
Query Tracer API Call Data Information size to allow the user to allocate the right size for the info...
rocprofiler_tracer_roctx_api_data_info_t
ROCTX Tracer Data Information Kinds.
Definition: rocprofiler.h:1196
@ ROCPROFILER_ROCTX_ID
ROCTX Tracer Data kind that can be used to return ROCTX id.
Definition: rocprofiler.h:1204
@ ROCPROFILER_ROCTX_MESSAGE
ROCTX Tracer Data kind that can be used to return ROCTX message.
Definition: rocprofiler.h:1200
rocprofiler_filter_kind_t
Definition: rocprofiler.h:1768
ROCPROFILER_API rocprofiler_status_t rocprofiler_set_filter_buffer(rocprofiler_session_id_t session_id, rocprofiler_filter_id_t filter_id, rocprofiler_buffer_id_t buffer_id) ROCPROFILER_VERSION_9_0
Set Session Filter Buffer This function will associate buffer to a specific filter.
ROCPROFILER_API rocprofiler_status_t rocprofiler_set_api_trace_sync_callback(rocprofiler_session_id_t session_id, rocprofiler_filter_id_t filter_id, rocprofiler_sync_callback_t callback) ROCPROFILER_VERSION_9_0
Set Session API Tracing Filter Synchronous Callback This function will associate buffer to a specific...
const char * rocprofiler_hip_function_name_t
Definition: rocprofiler.h:1824
const char * rocprofiler_hsa_function_name_t
Definition: rocprofiler.h:1825
ROCPROFILER_API rocprofiler_status_t rocprofiler_destroy_filter(rocprofiler_session_id_t session_id, rocprofiler_filter_id_t filter_id) ROCPROFILER_VERSION_9_0
Destroy Session Filter This function will destroy a specific filter.
ROCPROFILER_API rocprofiler_status_t rocprofiler_set_buffer_properties(rocprofiler_session_id_t session_id, rocprofiler_buffer_id_t buffer_id, rocprofiler_buffer_property_t *buffer_properties, uint32_t buffer_properties_count) ROCPROFILER_VERSION_9_0
Setting Buffer Properties This function will set buffer properties.
void(* rocprofiler_sync_callback_t)(rocprofiler_record_tracer_t record, rocprofiler_session_id_t session_id)
Synchronous Callback To be only used by rocprofiler_set_api_trace_sync_callback, please refer to rocp...
Definition: rocprofiler.h:1979
ROCPROFILER_API rocprofiler_status_t rocprofiler_create_filter(rocprofiler_session_id_t session_id, rocprofiler_filter_kind_t filter_kind, rocprofiler_filter_data_t data, uint64_t data_count, rocprofiler_filter_id_t *filter_id, rocprofiler_filter_property_t property) ROCPROFILER_VERSION_9_0
Create Session Filter This function will create filter and associate it with a specific session For e...
ROCPROFILER_API rocprofiler_status_t rocprofiler_create_buffer(rocprofiler_session_id_t session_id, rocprofiler_buffer_callback_t buffer_callback, size_t buffer_size, rocprofiler_buffer_id_t *buffer_id) ROCPROFILER_VERSION_9_0
Create Buffer This function will create a buffer that can be associated with a filter.
ROCPROFILER_API rocprofiler_status_t rocprofiler_destroy_buffer(rocprofiler_session_id_t session_id, rocprofiler_buffer_id_t buffer_id) ROCPROFILER_VERSION_9_0
Destroy Buffer This function will destroy a buffer given its id and session id.
rocprofiler_att_parameter_name_t
Definition: rocprofiler.h:1828
rocprofiler_filter_property_kind_t
Data Filter Types to be used by ::rocprofiler_session_set_filter to add filters to a specific session...
Definition: rocprofiler.h:1799
@ ROCPROFILER_DISPATCH_TIMESTAMPS_COLLECTION
Kernel Dispatch Timestamp collection.
Definition: rocprofiler.h:1772
@ ROCPROFILER_ATT_TRACE_COLLECTION
ATT Tracing.
Definition: rocprofiler.h:1784
@ ROCPROFILER_COUNTERS_COLLECTION
GPU Application counter collection.
Definition: rocprofiler.h:1776
@ ROCPROFILER_SPM_COLLECTION
SPM collection.
Definition: rocprofiler.h:1788
@ ROCPROFILER_API_TRACE
HIP/HSA/ROCTX/SYS Trace.
Definition: rocprofiler.h:1792
@ ROCPROFILER_PC_SAMPLING_COLLECTION
PC Sampling collection.
Definition: rocprofiler.h:1780
@ ROCPROFILER_ATT_VM_ID_MASK
Definition: rocprofiler.h:1830
@ ROCPROFILER_ATT_TOKEN_MASK
Definition: rocprofiler.h:1832
@ ROCPROFILER_ATT_PERF_CTRL
Definition: rocprofiler.h:1837
@ ROCPROFILER_ATT_MAXVALUE
Definition: rocprofiler.h:1840
@ ROCPROFILER_ATT_COMPUTE_UNIT_TARGET
Definition: rocprofiler.h:1829
@ ROCPROFILER_ATT_TOKEN_MASK2
Definition: rocprofiler.h:1833
@ ROCPROFILER_ATT_PERFCOUNTER_NAME
Definition: rocprofiler.h:1839
@ ROCPROFILER_ATT_PERFCOUNTER
Definition: rocprofiler.h:1838
@ ROCPROFILER_ATT_MASK
Definition: rocprofiler.h:1831
@ ROCPROFILER_ATT_SAMPLE_RATE
Definition: rocprofiler.h:1835
@ ROCPROFILER_ATT_SE_MASK
Definition: rocprofiler.h:1834
@ ROCPROFILER_ATT_PERF_MASK
Definition: rocprofiler.h:1836
@ ROCPROFILER_FILTER_RANGE
Add Range of calls to be traced or kernels to be profiled.
Definition: rocprofiler.h:1816
@ ROCPROFILER_FILTER_HIP_TRACER_API_FUNCTIONS
Add HIP API calls that will be only traced (ex.
Definition: rocprofiler.h:1807
@ ROCPROFILER_FILTER_HSA_TRACER_API_FUNCTIONS
Add HSA API calls that will be only traced (ex.
Definition: rocprofiler.h:1803
@ ROCPROFILER_FILTER_KERNEL_NAMES
Add Kernel names that will be only profiled or traced.
Definition: rocprofiler.h:1820
@ ROCPROFILER_FILTER_GPU_NAME
Add GPU names that will be only profiled or traced.
Definition: rocprofiler.h:1811
ROCPROFILER_API rocprofiler_status_t rocprofiler_pop_range() ROCPROFILER_VERSION_9_0
Setting an endpoint for a range This function can be used to set an endpoint to range labeled by rocp...
ROCPROFILER_API rocprofiler_status_t rocprofiler_push_range(const char *label) ROCPROFILER_VERSION_9_0
Setting a label to a block range This can be used to label a range of code that is having active prof...
ROCPROFILER_API rocprofiler_status_t rocprofiler_end_replay_pass() ROCPROFILER_VERSION_9_0
End a pass End a pass created and started by ::rocprofiler_start_pass.
ROCPROFILER_API rocprofiler_status_t rocprofiler_start_replay_pass() ROCPROFILER_VERSION_9_0
Create and Start a pass A Pass is a block of code that can be replayed if required by the profiling/t...
ROCPROFILER_API rocprofiler_status_t rocprofiler_destroy_session(rocprofiler_session_id_t session_id) ROCPROFILER_VERSION_9_0
Destroy Session Destroy session created by rocprofiler_create_session, please refer to the samples fo...
ROCPROFILER_API rocprofiler_status_t rocprofiler_terminate_session(rocprofiler_session_id_t session_id) ROCPROFILER_VERSION_9_0
Deactivate Session Deactivate session created by rocprofiler_create_session, please refer to the samp...
ROCPROFILER_API rocprofiler_status_t rocprofiler_create_ready_session(rocprofiler_replay_mode_t replay_mode, rocprofiler_filter_kind_t filter_kind, rocprofiler_filter_data_t data, uint64_t data_count, size_t buffer_size, rocprofiler_buffer_callback_t buffer_callback, rocprofiler_session_id_t *session_id, rocprofiler_filter_property_t property, rocprofiler_sync_callback_t callback) ROCPROFILER_VERSION_9_0
Create Ready Session A one call to create a ready profiling or tracing session, so that the session w...
ROCPROFILER_API rocprofiler_status_t rocprofiler_create_session(rocprofiler_replay_mode_t replay_mode, rocprofiler_session_id_t *session_id) ROCPROFILER_VERSION_9_0
Create Session A ROCProfiler Session is having enough information about what needs to be collected or...
rocprofiler_replay_mode_t
Replay Profiling Modes.
Definition: rocprofiler.h:1693
ROCPROFILER_API rocprofiler_status_t rocprofiler_start_session(rocprofiler_session_id_t session_id) ROCPROFILER_VERSION_9_0
Activate Session Activating session created by rocprofiler_create_session, please refer to the sample...
@ ROCPROFILER_KERNEL_REPLAY_MODE
Replaying every kernel dispatch to get multi passes.
Definition: rocprofiler.h:1706
@ ROCPROFILER_APPLICATION_REPLAY_MODE
Replaying the whole application to get multi passes (Not Yet Supported)
Definition: rocprofiler.h:1702
@ ROCPROFILER_NONE_REPLAY_MODE
No Replay to be done, Mostly for tracing tool or if the user wants to make sure that no replays will ...
Definition: rocprofiler.h:1698
@ ROCPROFILER_USER_REPLAY_MODE
Replaying an user-specified range to get multi passes (Not Yet Supported)
Definition: rocprofiler.h:1710
ROCPROFILER_API const char * rocprofiler_error_str(rocprofiler_status_t status) ROCPROFILER_VERSION_9_0
Query the textual description of the given error for the current thread.
rocprofiler_status_t
ROCProfiler API status codes.
Definition: rocprofiler.h:206
@ ROCPROFILER_STATUS_ERROR_CORRUPTED_SESSION_BUFFER
The requested Session Buffer given the session identifier is corrupted or deleted.
Definition: rocprofiler.h:283
@ ROCPROFILER_STATUS_ERROR_TRACER_API_DATA_INFORMATION_MISSING
The requested information for the tracing API Data is missing.
Definition: rocprofiler.h:270
@ ROCPROFILER_STATUS_ERROR_QUEUE_INFORMATION_MISSING
The requested information about the queue is not found.
Definition: rocprofiler.h:246
@ ROCPROFILER_STATUS_ERROR_COUNTER_INFORMATION_MISSING
The requested Counter information for the given kernel is missing.
Definition: rocprofiler.h:262
@ ROCPROFILER_STATUS_ERROR_SESSION_MISSING_FILTER
Missing Filter for a session.
Definition: rocprofiler.h:295
@ ROCPROFILER_STATUS_ERROR_SESSION_MISSING_BUFFER
Missing Buffer for a session.
Definition: rocprofiler.h:226
@ ROCPROFILER_STATUS_ERROR_HAS_ACTIVE_SESSION
There is already Active session, Can't activate two session at the same time.
Definition: rocprofiler.h:328
@ ROCPROFILER_STATUS_ERROR_KERNEL_NOT_FOUND
Kernel is not found with given identifier.
Definition: rocprofiler.h:250
@ ROCPROFILER_STATUS_ERROR_FILTER_DATA_CORRUPTED
The given filter data is corrupted.
Definition: rocprofiler.h:311
@ ROCPROFILER_STATUS_ERROR_BUFFER_NOT_FOUND
The required buffer is not found for the given session.
Definition: rocprofiler.h:340
@ ROCPROFILER_STATUS_ERROR_COUNTER_NOT_FOUND
Counter is not found with the given identifier.
Definition: rocprofiler.h:258
@ ROCPROFILER_STATUS_ERROR_CORRUPTED_LABEL_DATA
The given label is corrupted.
Definition: rocprofiler.h:315
@ ROCPROFILER_STATUS_ERROR_INCORRECT_REPLAY_MODE
Incorrect Replay mode.
Definition: rocprofiler.h:291
@ ROCPROFILER_STATUS_ERROR_QUEUE_NOT_FOUND
Queue is not found for the given identifier.
Definition: rocprofiler.h:242
@ ROCPROFILER_STATUS_ERROR_INCORRECT_FLUSH_INTERVAL
Incorrect Flush interval.
Definition: rocprofiler.h:303
@ ROCPROFILER_STATUS_ERROR_TRACER_API_DATA_NOT_FOUND
The requested Tracing API Data for the given data identifier is missing.
Definition: rocprofiler.h:266
@ ROCPROFILER_STATUS_ERROR_SESSION_NOT_FOUND
The requested Session given the session identifier is not found.
Definition: rocprofiler.h:278
@ ROCPROFILER_STATUS_ERROR_SESSION_FILTER_DATA_MISMATCH
The session filter can't accept the given data.
Definition: rocprofiler.h:307
@ ROCPROFILER_STATUS_ERROR_INCORRECT_DOMAIN
The given Domain is incorrect.
Definition: rocprofiler.h:274
@ ROCPROFILER_STATUS_ERROR_AGENT_NOT_FOUND
Agent is not found with given identifier.
Definition: rocprofiler.h:234
@ ROCPROFILER_STATUS_ERROR_SESSION_NOT_ACTIVE
Can't terminate a non active session.
Definition: rocprofiler.h:332
@ ROCPROFILER_STATUS_ERROR
A generic error has occurred.
Definition: rocprofiler.h:214
@ ROCPROFILER_STATUS_ERROR_KERNEL_INFORMATION_MISSING
The requested information about the kernel is not found.
Definition: rocprofiler.h:254
@ ROCPROFILER_STATUS_ERROR_RANGE_STACK_IS_EMPTY
There is no label in the labels stack to be popped.
Definition: rocprofiler.h:319
@ ROCPROFILER_STATUS_ERROR_TIMESTAMP_NOT_APPLICABLE
Timestamps can't be collected.
Definition: rocprofiler.h:230
@ ROCPROFILER_STATUS_ERROR_FILTER_NOT_FOUND
The required filter is not found for the given session.
Definition: rocprofiler.h:336
@ ROCPROFILER_STATUS_ERROR_INCORRECT_SIZE
The size given for the buffer is not applicable.
Definition: rocprofiler.h:299
@ ROCPROFILER_STATUS_ERROR_RECORD_CORRUPTED
The requested record given the record identifier is corrupted or deleted.
Definition: rocprofiler.h:287
@ ROCPROFILER_STATUS_ERROR_ALREADY_INITIALIZED
ROCProfiler is already initialized.
Definition: rocprofiler.h:218
@ ROCPROFILER_STATUS_SUCCESS
The function has executed successfully.
Definition: rocprofiler.h:210
@ ROCPROFILER_STATUS_ERROR_PASS_NOT_STARTED
There is no pass that started.
Definition: rocprofiler.h:323
@ ROCPROFILER_STATUS_ERROR_FILTER_NOT_SUPPORTED
The required Filter is not supported.
Definition: rocprofiler.h:344
@ ROCPROFILER_STATUS_ERROR_AGENT_INFORMATION_MISSING
Agent information is missing for the given identifier.
Definition: rocprofiler.h:238
@ ROCPROFILER_STATUS_ERROR_NOT_INITIALIZED
ROCProfiler is not initialized.
Definition: rocprofiler.h:222
#define ROCPROFILER_VERSION_9_0
The function was introduced in version 9.0 of the interface and has the symbol version string of "ROC...
Definition: rocprofiler.h:144
ROCPROFILER_API rocprofiler_status_t rocprofiler_get_timestamp(rocprofiler_timestamp_t *timestamp) ROCPROFILER_VERSION_9_0
Get the system clock timestamp.
rocprofiler_tracer_activity_domain_t
Traced API domains.
Definition: rocprofiler.h:1119
@ ACTIVITY_DOMAIN_ROCTX
ROCTX domain.
Definition: rocprofiler.h:1147
@ ACTIVITY_DOMAIN_EXT_API
External ID domain.
Definition: rocprofiler.h:1143
@ ACTIVITY_DOMAIN_HSA_EVT
HSA events (Device Activity)
Definition: rocprofiler.h:1153
@ ACTIVITY_DOMAIN_HSA_OPS
HSA async activity domain.
Definition: rocprofiler.h:1127
@ ACTIVITY_DOMAIN_HIP_API
HIP API domain.
Definition: rocprofiler.h:1135
@ ACTIVITY_DOMAIN_NUMBER
Definition: rocprofiler.h:1154
@ ACTIVITY_DOMAIN_HSA_API
HSA API domain.
Definition: rocprofiler.h:1123
@ ACTIVITY_DOMAIN_HIP_OPS
HIP async activity domain.
Definition: rocprofiler.h:1131
@ ACTIVITY_DOMAIN_KFD_API
KFD API domain.
Definition: rocprofiler.h:1139
ROCPROFILER_API uint32_t rocprofiler_version_major()
Query the major version of the installed library.
ROCPROFILER_API uint32_t rocprofiler_version_minor()
Query the minor version of the installed library.
#define ROCPROFILER_API
Definition: rocprofiler.h:114
Agent ID handle, which represents a unique id to the agent reported as it can be used to retrieve Age...
Definition: rocprofiler.h:509
Definition: rocprofiler.h:1844
Definition: rocprofiler.h:1614
Definition: rocprofiler.h:1609
Definition: rocprofiler.h:2542
Counter ID to be used to query counter information using rocprofiler_query_counter_info.
Definition: rocprofiler.h:785
Definition: rocprofiler.h:766
Definition: rocprofiler.h:2268
Definition: rocprofiler.h:2412
Definition: rocprofiler.h:2272
Definition: rocprofiler.h:2534
Definition: rocprofiler.h:1005
Definition: rocprofiler.h:2429
Definition: rocprofiler.h:1618
Filter Data Type filter data will be used to report required and optional filters for the sessions us...
Definition: rocprofiler.h:1857
Definition: rocprofiler.h:2455
Definition: rocprofiler.h:2788
Definition: rocprofiler.h:2843
Definition: rocprofiler.h:2662
Kernel dispatch correlation ID, unique across all dispatches.
Definition: rocprofiler.h:1534
Kernel identifier that represent a unique id for every kernel.
Definition: rocprofiler.h:674
Kernel properties, this will represent the kernel properties such as its grid size,...
Definition: rocprofiler.h:909
An individual PC sample.
Definition: rocprofiler.h:1541
Definition: rocprofiler.h:2726
Definition: rocprofiler.h:2735
Definition: rocprofiler.h:2473
Definition: rocprofiler.h:2564
Unique ID handle to represent an HSA Queue of type hsa_queue_t, this id can be used by the user to ge...
Definition: rocprofiler.h:603
Definition: rocprofiler.h:858
ATT tracing record structure.
Definition: rocprofiler.h:1064
Counter Instance Structure, it will represent every counter reported in the array of counters reporte...
Definition: rocprofiler.h:881
Counter Value Structure.
Definition: rocprofiler.h:869
Counters Instances Count Structure, every profiling record has this structure included to report the ...
Definition: rocprofiler.h:897
Generic ROCProfiler record header.
Definition: rocprofiler.h:488
Timestamps (start & end), it will be used for kernel dispatch tracing as well as API Tracing.
Definition: rocprofiler.h:437
A unique identifier for every record.
Definition: rocprofiler.h:451
PC sample record: contains the program counter/instruction pointer observed during periodic sampling ...
Definition: rocprofiler.h:1575
Profiling record, this will represent all the information reported by the profiler regarding kernel d...
Definition: rocprofiler.h:955
struct to store the trace data from a shader engine.
Definition: rocprofiler.h:1052
Counters, including identifiers to get counter information and Counters values.
Definition: rocprofiler.h:1019
SPM record, this will represent all the information reported by the SPM regarding counters and their ...
Definition: rocprofiler.h:1031
Tracing record, this will represent all the information reported by the tracer regarding APIs and the...
Definition: rocprofiler.h:1482
Session Identifier.
Definition: rocprofiler.h:394
Definition: rocprofiler.h:2364
Definition: rocprofiler.h:1878
Holds the thread id.
Definition: rocprofiler.h:740
ROCProfiling Timestamp Type.
Definition: rocprofiler.h:417
Correlation identifier.
Definition: rocprofiler.h:1167
Tracer API Calls Data Handler.
Definition: rocprofiler.h:1177
Tracing external ID.
Definition: rocprofiler.h:1471
Tracing Operation ID for HIP/HSA.
Definition: rocprofiler.h:1160
Filter Kind Data.
Definition: rocprofiler.h:1901
Definition: rocprofiler.h:2654