From 39b4cab28122a0f7f04c3f3ed73f1377490b093c Mon Sep 17 00:00:00 2001 From: Solomon Bekele Date: Wed, 23 Oct 2024 17:52:28 +0000 Subject: [PATCH] Remove Ze calls for subDevice --- ze/btx_zeinterval_callbacks.cpp | 11 -------- ze/btx_zeinterval_callbacks.hpp | 1 - ze/tracer_ze_helpers.include.c | 48 --------------------------------- ze/ze_events.yaml | 9 ------- 4 files changed, 69 deletions(-) diff --git a/ze/btx_zeinterval_callbacks.cpp b/ze/btx_zeinterval_callbacks.cpp index 21831d5e..2b655045 100644 --- a/ze/btx_zeinterval_callbacks.cpp +++ b/ze/btx_zeinterval_callbacks.cpp @@ -1019,15 +1019,6 @@ static void lttng_ust_ze_sampling_deviceProperties_callback( data->sampling_device_property[{hostname, vpid, hDevice}] = {*pDeviceProperties_val, deviceIdx}; } -static void lttng_ust_ze_sampling_subDeviceProperties_callback( - void *btx_handle, void *usr_data, int64_t ts, const char *hostname, int64_t vpid, uint64_t vtid, - zes_device_handle_t hDevice, ze_device_handle_t hSubDevice, - size_t _pSubDeviceProperties_val_length, ze_device_properties_t *pSubDeviceProperties_val) { - auto *data = static_cast(usr_data); - data->sampling_sub_device_property[{hostname, vpid, (ze_device_handle_t)hSubDevice}] = - *pSubDeviceProperties_val; -} - static void lttng_ust_ze_sampling_fabricPortProperties_callback( void *btx_handle, void *usr_data, int64_t ts, const char *hostname, int64_t vpid, uint64_t vtid, ze_device_handle_t hDevice, zes_fabric_port_handle_t hFabricPort, @@ -1167,8 +1158,6 @@ void btx_register_usr_callbacks(void *btx_handle) { // Properties btx_register_callbacks_lttng_ust_ze_sampling_deviceProperties( btx_handle, <tng_ust_ze_sampling_deviceProperties_callback); - btx_register_callbacks_lttng_ust_ze_sampling_subDeviceProperties( - btx_handle, <tng_ust_ze_sampling_subDeviceProperties_callback); btx_register_callbacks_lttng_ust_ze_sampling_fabricPortProperties( btx_handle, <tng_ust_ze_sampling_fabricPortProperties_callback); btx_register_callbacks_lttng_ust_ze_sampling_powerProperties( diff --git a/ze/btx_zeinterval_callbacks.hpp b/ze/btx_zeinterval_callbacks.hpp index 6a323b4e..b1c980e0 100644 --- a/ze/btx_zeinterval_callbacks.hpp +++ b/ze/btx_zeinterval_callbacks.hpp @@ -100,7 +100,6 @@ struct data_s { std::unordered_map device_timestamps_pair_ref; /* Sampling */ std::unordered_map sampling_device_property; - std::unordered_map sampling_sub_device_property; std::unordered_map fabricPort_property; std::unordered_map memModule_property; std::unordered_map power_property; diff --git a/ze/tracer_ze_helpers.include.c b/ze/tracer_ze_helpers.include.c index b6b6c113..8a18f161 100644 --- a/ze/tracer_ze_helpers.include.c +++ b/ze/tracer_ze_helpers.include.c @@ -797,7 +797,6 @@ static int _sampling_engines_initialized = 0; // Static handles to stay throughout the execution static zes_driver_handle_t *_sampling_hDrivers = NULL; static zes_device_handle_t **_sampling_hDevices = NULL; -static ze_device_handle_t ***_sampling_hSubDevices = NULL; static zes_freq_handle_t ***_sampling_hFrequencies = NULL; static zes_pwr_handle_t ***_sampling_hPowers = NULL; static zes_engine_handle_t ***_sampling_engineHandles = NULL; @@ -805,7 +804,6 @@ static zes_fabric_port_handle_t ***_sampling_hFabricPort = NULL; static zes_mem_handle_t ***_sampling_hMemModule = NULL; static uint32_t _sampling_driverCount = 0; static uint32_t *_sampling_deviceCount = NULL; -static uint32_t **_sampling_subDeviceCount = NULL; static uint32_t **_sampling_freqDomainCounts = NULL; static uint32_t **_sampling_fabricPortCount = NULL; static uint32_t **_sampling_memModuleCount = NULL; @@ -1084,11 +1082,8 @@ static int initializeHandles() { return -1; } _sampling_deviceCount = (uint32_t *)calloc(_sampling_driverCount, sizeof(uint32_t)); - _sampling_subDeviceCount = (uint32_t **)calloc(_sampling_driverCount, sizeof(uint32_t *)); _sampling_hDevices = (zes_device_handle_t **)calloc(_sampling_driverCount, sizeof(zes_device_handle_t *)); - _sampling_hSubDevices = - (ze_device_handle_t ***)calloc(_sampling_driverCount, sizeof(ze_device_handle_t **)); for (uint32_t driverIdx = 0; driverIdx < _sampling_driverCount; driverIdx++) { res = ZES_DEVICE_GET_PTR(_sampling_hDrivers[driverIdx], &_sampling_deviceCount[driverIdx], NULL); @@ -1106,11 +1101,6 @@ static int initializeHandles() { free(_sampling_hDevices[driverIdx]); return -1; } - // Get no sub-devices - _sampling_subDeviceCount[driverIdx] = - (uint32_t *)calloc(_sampling_deviceCount[driverIdx], sizeof(uint32_t)); - _sampling_hSubDevices[driverIdx] = (ze_device_handle_t **)calloc( - _sampling_deviceCount[driverIdx], sizeof(ze_device_handle_t *)); for (uint32_t deviceIdx = 0; deviceIdx < _sampling_deviceCount[driverIdx]; deviceIdx++) { zes_device_properties_t deviceProps = {0}; @@ -1123,44 +1113,6 @@ static int initializeHandles() { do_tracepoint(lttng_ust_ze_sampling, deviceProperties, (zes_device_handle_t)_sampling_hDevices[driverIdx][deviceIdx], deviceIdx, &deviceProps); - - res = ZE_DEVICE_GET_SUB_DEVICES_PTR( - (ze_device_handle_t)_sampling_hDevices[driverIdx][deviceIdx], - &_sampling_subDeviceCount[driverIdx][deviceIdx], NULL); - if (res != ZE_RESULT_SUCCESS) { - _ZE_ERROR_MSG("ZES_DEVICE_GET_PROPERTIES_PTR", res); - _sampling_subDeviceCount[driverIdx][deviceIdx] = 0; - } - if (_sampling_subDeviceCount[driverIdx][deviceIdx] > 0) { - _sampling_hSubDevices[driverIdx][deviceIdx] = (ze_device_handle_t *)calloc( - _sampling_subDeviceCount[driverIdx][deviceIdx], sizeof(ze_device_handle_t)); - res = ZE_DEVICE_GET_SUB_DEVICES_PTR( - (ze_device_handle_t)_sampling_hDevices[driverIdx][deviceIdx], - &_sampling_subDeviceCount[driverIdx][deviceIdx], - _sampling_hSubDevices[driverIdx][deviceIdx]); - if (res != ZE_RESULT_SUCCESS) { - _ZE_ERROR_MSG("ZE_DEVICE_GET_SUB_DEVICES_PTR", res); - free(_sampling_hSubDevices[driverIdx][deviceIdx]); - _sampling_hSubDevices[driverIdx][deviceIdx] = NULL; - _sampling_subDeviceCount[driverIdx][deviceIdx] = 0; - } - for (uint32_t subDeviceIdx = 0; - subDeviceIdx < _sampling_subDeviceCount[driverIdx][deviceIdx]; subDeviceIdx++) { - ze_device_properties_t subDeviceProps = {0}; - subDeviceProps.stype = ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES; - subDeviceProps.pNext = NULL; - res = ZE_DEVICE_GET_PROPERTIES_PTR( - _sampling_hSubDevices[driverIdx][deviceIdx][subDeviceIdx], &subDeviceProps); - if (res != ZE_RESULT_SUCCESS) { - _ZE_ERROR_MSG("ZES_DEVICE_GET_PROPERTIES_PTR", res); - } - do_tracepoint( - lttng_ust_ze_sampling, subDeviceProperties, - (ze_device_handle_t)_sampling_hDevices[driverIdx][deviceIdx], - (ze_device_handle_t)_sampling_hSubDevices[driverIdx][deviceIdx][subDeviceIdx], - &subDeviceProps); - } - } } } intializeFrequency(); diff --git a/ze/ze_events.yaml b/ze/ze_events.yaml index e69eb4d9..6158d79a 100644 --- a/ze/ze_events.yaml +++ b/ze/ze_events.yaml @@ -10,15 +10,6 @@ lttng_ust_ze_sampling: - [ ctf_integer_hex, uintptr_t, hDevice, "(uintptr_t)hDevice" ] - [ ctf_integer, uint32_t, deviceIdx, "deviceIdx" ] - [ ctf_sequence_text, uint8_t, pDeviceProperties_val, pDeviceProperties, size_t, "sizeof(ze_device_properties_t)" ] - - name: subDeviceProperties - args: - - [ zes_device_handle_t, hDevice ] - - [ ze_device_handle_t, hSubDevice ] - - [ ze_device_properties_t *, pSubDeviceProperties ] - fields: - - [ ctf_integer_hex, uintptr_t, hDevice, "(uintptr_t)hDevice" ] - - [ ctf_integer_hex, uintptr_t, hSubDevice, "(uintptr_t)hSubDevice" ] - - [ ctf_sequence_text, uint8_t, pSubDeviceProperties_val, pSubDeviceProperties, size_t, "sizeof(ze_device_properties_t)" ] - name: engineProperties args: - [ zes_device_handle_t, hDevice ]