[SWDEV-516561][1/2] Add MARKER_RANGE_EXTENT to capture ROCTX ranges (#363)
* [SWDEV-516561][1/2] Add MARKER_RANGE_EXTENT to capture ROCTX ranges
Range extent to capture all work between roctxpush/pop operations. Entry callback takes place during roxtxpush and exit callback takes place in roctxpop. This is primarily to allow us to keep an ancestor id on the ancestor stack such that all operations that take place within the push/pop context can be annotated as being apart of this range. With the current setup (where push and pop are two separate operations that need to be combined externally), we cannot keep an ancestor id on the stack and thus cannot tie tracing events to particular ranges.
Correlation id information is inherited from the push operation. Ancestor id needs to be added in a future commit that also outputs this ancestor to CSV.
Output:
```
[ctest] {'size': 64, 'kind': 7, 'operation': 1, 'correlation_id': {'internal': 1525, 'external': 0, 'ancestor': 1524}, 'start_timestamp': 2932551479402642, 'end_timestamp': 2932551491178449, 'thread_id': 3254861}
[ctest] {'size': 64, 'kind': 8, 'operation': 2, 'correlation_id': {'internal': 1525, 'external': 0, 'ancestor': 1524}, 'start_timestamp': 2932551479405878, 'end_timestamp': 2932551491181214, 'thread_id': 3254861}
```
Note: Kind 8 = range extent op.
* Merge fix
Revert several changes
source/lib/rocprofiler-sdk/marker/range_marker.*
- separate out range marker implementation for standard marker implementation
Update public API with marker core range
Support marker core range in sdk (source/lib/rocprofiler-sdk)
Transition rocprofiler-sdk-tool and output lib to use marker core range
Misc fixes for tests
Fix logic in lib/output/generate{CSV,Stats}.cpp
Update tests/rocprofv3/tracing-hip-in-libraries (marker validation)
Fix test_otf2_data
* Test fixes
---------
Co-authored-by: Benjamin Welton <bewelton@amd.com>
This commit is contained in:
committato da
GitHub
parent
2fa98c4d14
commit
2c4e20b951
@@ -1020,6 +1020,16 @@ ROCPROFILER_ENUM_LABEL(ROCPROFILER_MARKER_NAME_API_ID_roctxNameHipDevice);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_MARKER_NAME_API_ID_roctxNameHipStream);
|
||||
static_assert(ROCPROFILER_MARKER_NAME_API_ID_LAST == 4);
|
||||
|
||||
ROCPROFILER_ENUM_INFO(rocprofiler_marker_core_range_api_id_t,
|
||||
0,
|
||||
ROCPROFILER_MARKER_CORE_RANGE_API_ID_LAST,
|
||||
false)
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_MARKER_CORE_RANGE_API_ID_roctxMarkA);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_MARKER_CORE_RANGE_API_ID_roctxThreadRangeA);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_MARKER_CORE_RANGE_API_ID_roctxProcessRangeA);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_MARKER_CORE_RANGE_API_ID_roctxGetThreadId);
|
||||
static_assert(ROCPROFILER_MARKER_CORE_RANGE_API_ID_LAST == 4);
|
||||
|
||||
// rocprofiler_ompt_operation_t
|
||||
ROCPROFILER_ENUM_INFO(rocprofiler_ompt_operation_t, 0, ROCPROFILER_OMPT_ID_LAST, false);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_OMPT_ID_thread_begin);
|
||||
@@ -1307,7 +1317,8 @@ static_assert(ROCPROFILER_HIP_TABLE_ID_LAST == 2);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_MARKER_TABLE_ID_RoctxCore);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_MARKER_TABLE_ID_RoctxControl);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_MARKER_TABLE_ID_RoctxName);
|
||||
static_assert(ROCPROFILER_MARKER_TABLE_ID_LAST == 3);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_MARKER_TABLE_ID_RoctxCoreRange);
|
||||
static_assert(ROCPROFILER_MARKER_TABLE_ID_LAST == 4);
|
||||
|
||||
// rocprofiler_rccl_table_id_t
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_RCCL_TABLE_ID);
|
||||
@@ -1393,6 +1404,7 @@ ROCPROFILER_ENUM_LABEL(ROCPROFILER_CALLBACK_TRACING_HSA_FINALIZE_EXT_API);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_CALLBACK_TRACING_HIP_RUNTIME_API);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_CALLBACK_TRACING_HIP_COMPILER_API);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_CALLBACK_TRACING_MARKER_CORE_API);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_CALLBACK_TRACING_MARKER_CORE_RANGE_API);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_CALLBACK_TRACING_MARKER_CONTROL_API);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_CALLBACK_TRACING_MARKER_NAME_API);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_CALLBACK_TRACING_CODE_OBJECT);
|
||||
@@ -1406,7 +1418,7 @@ ROCPROFILER_ENUM_LABEL(ROCPROFILER_CALLBACK_TRACING_RUNTIME_INITIALIZATION);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_CALLBACK_TRACING_ROCDECODE_API);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_CALLBACK_TRACING_ROCJPEG_API);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_CALLBACK_TRACING_HIP_STREAM);
|
||||
static_assert(ROCPROFILER_CALLBACK_TRACING_LAST == 21);
|
||||
static_assert(ROCPROFILER_CALLBACK_TRACING_LAST == 22);
|
||||
|
||||
// rocprofiler_buffer_tracing_kind_t
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_NONE);
|
||||
@@ -1417,6 +1429,7 @@ ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_HSA_FINALIZE_EXT_API);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_HIP_RUNTIME_API);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_HIP_COMPILER_API);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_MARKER_CORE_API);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_MARKER_CORE_RANGE_API);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_MARKER_CONTROL_API);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_MARKER_NAME_API);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_MEMORY_COPY);
|
||||
@@ -1441,7 +1454,7 @@ ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_KFD_EVENT_DROPPED_EVENTS);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_KFD_PAGE_MIGRATE);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_KFD_PAGE_FAULT);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_KFD_QUEUE);
|
||||
static_assert(ROCPROFILER_BUFFER_TRACING_LAST == 32);
|
||||
static_assert(ROCPROFILER_BUFFER_TRACING_LAST == 33);
|
||||
|
||||
// rocprofiler_code_object_operation_t
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_CODE_OBJECT_NONE);
|
||||
@@ -1637,7 +1650,8 @@ ROCPROFILER_ENUM_LABEL(ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_OMPT);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_MEMORY_ALLOCATION);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_ROCDECODE_API);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_ROCJPEG_API);
|
||||
static_assert(ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_LAST == 18);
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_MARKER_CORE_RANGE_API);
|
||||
static_assert(ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_LAST == 19);
|
||||
|
||||
// rocprofiler_thread_trace_parameter_type_t
|
||||
ROCPROFILER_ENUM_LABEL(ROCPROFILER_THREAD_TRACE_PARAMETER_TARGET_CU);
|
||||
|
||||
@@ -211,6 +211,7 @@ ROCPROFILER_PERFETTO_BUFFER_TRACING_CATEGORY(HSA_FINALIZE_EXT_API, hsa_api)
|
||||
ROCPROFILER_PERFETTO_BUFFER_TRACING_CATEGORY(HIP_RUNTIME_API, hip_api)
|
||||
ROCPROFILER_PERFETTO_BUFFER_TRACING_CATEGORY(HIP_COMPILER_API, hip_api)
|
||||
ROCPROFILER_PERFETTO_BUFFER_TRACING_CATEGORY(MARKER_CORE_API, marker_api)
|
||||
ROCPROFILER_PERFETTO_BUFFER_TRACING_CATEGORY(MARKER_CORE_RANGE_API, marker_api)
|
||||
ROCPROFILER_PERFETTO_BUFFER_TRACING_CATEGORY(MARKER_CONTROL_API, marker_api)
|
||||
ROCPROFILER_PERFETTO_BUFFER_TRACING_CATEGORY(MARKER_NAME_API, marker_api)
|
||||
ROCPROFILER_PERFETTO_BUFFER_TRACING_CATEGORY(MEMORY_COPY, memory_copy)
|
||||
@@ -244,6 +245,7 @@ ROCPROFILER_PERFETTO_CALLBACK_TRACING_CATEGORY(HSA_FINALIZE_EXT_API, hsa_api)
|
||||
ROCPROFILER_PERFETTO_CALLBACK_TRACING_CATEGORY(HIP_RUNTIME_API, hip_api)
|
||||
ROCPROFILER_PERFETTO_CALLBACK_TRACING_CATEGORY(HIP_COMPILER_API, hip_api)
|
||||
ROCPROFILER_PERFETTO_CALLBACK_TRACING_CATEGORY(MARKER_CORE_API, marker_api)
|
||||
ROCPROFILER_PERFETTO_CALLBACK_TRACING_CATEGORY(MARKER_CORE_RANGE_API, marker_api)
|
||||
ROCPROFILER_PERFETTO_CALLBACK_TRACING_CATEGORY(MARKER_CONTROL_API, marker_api)
|
||||
ROCPROFILER_PERFETTO_CALLBACK_TRACING_CATEGORY(MARKER_NAME_API, marker_api)
|
||||
ROCPROFILER_PERFETTO_CALLBACK_TRACING_CATEGORY(CODE_OBJECT, none)
|
||||
|
||||
@@ -54,24 +54,25 @@ ROCPROFILER_EXTERN_C_INIT
|
||||
// NOLINTNEXTLINE(performance-enum-size)
|
||||
typedef enum ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_external_correlation_id_request_kind_t
|
||||
{
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_NONE = 0, ///< Unknown kind
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_HSA_CORE_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_HSA_AMD_EXT_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_HSA_IMAGE_EXT_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_HSA_FINALIZE_EXT_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_HIP_RUNTIME_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_HIP_COMPILER_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_MARKER_CORE_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_MARKER_CONTROL_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_MARKER_NAME_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_MEMORY_COPY, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_KERNEL_DISPATCH, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_SCRATCH_MEMORY, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_RCCL_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_OMPT, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_MEMORY_ALLOCATION, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_ROCDECODE_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_ROCJPEG_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_NONE = 0, ///< Unknown kind
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_HSA_CORE_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_HSA_AMD_EXT_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_HSA_IMAGE_EXT_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_HSA_FINALIZE_EXT_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_HIP_RUNTIME_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_HIP_COMPILER_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_MARKER_CORE_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_MARKER_CONTROL_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_MARKER_NAME_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_MEMORY_COPY, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_KERNEL_DISPATCH, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_SCRATCH_MEMORY, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_RCCL_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_OMPT, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_MEMORY_ALLOCATION, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_ROCDECODE_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_ROCJPEG_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_MARKER_CORE_RANGE_API, ///<
|
||||
ROCPROFILER_EXTERNAL_CORRELATION_REQUEST_LAST,
|
||||
} rocprofiler_external_correlation_id_request_kind_t;
|
||||
|
||||
|
||||
@@ -175,6 +175,8 @@ typedef enum rocprofiler_callback_tracing_kind_t // NOLINT(performance-enum-siz
|
||||
ROCPROFILER_CALLBACK_TRACING_ROCDECODE_API, ///< rocDecode API Tracing
|
||||
ROCPROFILER_CALLBACK_TRACING_ROCJPEG_API, ///< rocJPEG API Tracing
|
||||
ROCPROFILER_CALLBACK_TRACING_HIP_STREAM, ///< @see ::rocprofiler_hip_stream_operation_t
|
||||
ROCPROFILER_CALLBACK_TRACING_MARKER_CORE_RANGE_API, ///< @see
|
||||
///< ::rocprofiler_marker_core_range_api_id_t
|
||||
ROCPROFILER_CALLBACK_TRACING_LAST,
|
||||
} rocprofiler_callback_tracing_kind_t;
|
||||
|
||||
@@ -224,7 +226,8 @@ typedef enum rocprofiler_buffer_tracing_kind_t // NOLINT(performance-enum-size)
|
||||
ROCPROFILER_BUFFER_TRACING_KFD_PAGE_MIGRATE, ///< @see rocprofiler_kfd_page_migrate_operation_t
|
||||
ROCPROFILER_BUFFER_TRACING_KFD_PAGE_FAULT, ///< @see rocprofiler_kfd_page_fault_operation_t
|
||||
ROCPROFILER_BUFFER_TRACING_KFD_QUEUE, ///< @see rocprofiler_kfd_queue_operation_t
|
||||
|
||||
ROCPROFILER_BUFFER_TRACING_MARKER_CORE_RANGE_API, ///< @see
|
||||
///< ::rocprofiler_marker_core_range_api_id_t
|
||||
ROCPROFILER_BUFFER_TRACING_LAST,
|
||||
|
||||
/// @var ROCPROFILER_BUFFER_TRACING_HIP_RUNTIME_API_EXT
|
||||
|
||||
@@ -101,6 +101,15 @@ typedef union rocprofiler_marker_api_args_t
|
||||
const char* name;
|
||||
const struct ihipStream_t* stream;
|
||||
} roctxNameHipStream;
|
||||
struct
|
||||
{
|
||||
const char* message;
|
||||
} roctxThreadRangeA;
|
||||
struct
|
||||
{
|
||||
const char* message;
|
||||
// roctx_range_id_t id; // only set when range ends in callback tracing
|
||||
} roctxProcessRangeA;
|
||||
} rocprofiler_marker_api_args_t;
|
||||
|
||||
ROCPROFILER_EXTERN_C_FINI
|
||||
|
||||
@@ -54,3 +54,13 @@ typedef enum rocprofiler_marker_name_api_id_t // NOLINT(performance-enum-size)
|
||||
ROCPROFILER_MARKER_NAME_API_ID_roctxNameHipStream,
|
||||
ROCPROFILER_MARKER_NAME_API_ID_LAST,
|
||||
} rocprofiler_marker_name_api_id_t;
|
||||
|
||||
typedef enum rocprofiler_marker_core_range_api_id_t // NOLINT(performance-enum-size)
|
||||
{
|
||||
ROCPROFILER_MARKER_CORE_RANGE_API_ID_NONE = -1,
|
||||
ROCPROFILER_MARKER_CORE_RANGE_API_ID_roctxMarkA = 0,
|
||||
ROCPROFILER_MARKER_CORE_RANGE_API_ID_roctxThreadRangeA,
|
||||
ROCPROFILER_MARKER_CORE_RANGE_API_ID_roctxProcessRangeA,
|
||||
ROCPROFILER_MARKER_CORE_RANGE_API_ID_roctxGetThreadId,
|
||||
ROCPROFILER_MARKER_CORE_RANGE_API_ID_LAST,
|
||||
} rocprofiler_marker_core_range_api_id_t;
|
||||
|
||||
@@ -29,5 +29,6 @@ typedef enum rocprofiler_marker_table_id_t
|
||||
ROCPROFILER_MARKER_TABLE_ID_RoctxCore = 0,
|
||||
ROCPROFILER_MARKER_TABLE_ID_RoctxControl,
|
||||
ROCPROFILER_MARKER_TABLE_ID_RoctxName,
|
||||
ROCPROFILER_MARKER_TABLE_ID_RoctxCoreRange,
|
||||
ROCPROFILER_MARKER_TABLE_ID_LAST,
|
||||
} rocprofiler_marker_table_id_t;
|
||||
|
||||
Fai riferimento in un nuovo problema
Block a user