Skip to content

Commit

Permalink
Remove Ze calls for subDevice
Browse files Browse the repository at this point in the history
  • Loading branch information
Solomon Bekele committed Oct 23, 2024
1 parent 320a81e commit 39b4cab
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 69 deletions.
11 changes: 0 additions & 11 deletions ze/btx_zeinterval_callbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<data_t *>(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,
Expand Down Expand Up @@ -1167,8 +1158,6 @@ void btx_register_usr_callbacks(void *btx_handle) {
// Properties
btx_register_callbacks_lttng_ust_ze_sampling_deviceProperties(
btx_handle, &lttng_ust_ze_sampling_deviceProperties_callback);
btx_register_callbacks_lttng_ust_ze_sampling_subDeviceProperties(
btx_handle, &lttng_ust_ze_sampling_subDeviceProperties_callback);
btx_register_callbacks_lttng_ust_ze_sampling_fabricPortProperties(
btx_handle, &lttng_ust_ze_sampling_fabricPortProperties_callback);
btx_register_callbacks_lttng_ust_ze_sampling_powerProperties(
Expand Down
1 change: 0 additions & 1 deletion ze/btx_zeinterval_callbacks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ struct data_s {
std::unordered_map<hp_device_t, clock_lttng_device_t> device_timestamps_pair_ref;
/* Sampling */
std::unordered_map<hpd_t, deviceProperty_id_t> sampling_device_property;
std::unordered_map<hpd_t, ze_device_properties_t> sampling_sub_device_property;
std::unordered_map<hpdf_t, zes_fabric_port_properties_t> fabricPort_property;
std::unordered_map<hpdm_t, zes_mem_properties_t> memModule_property;
std::unordered_map<hpdpwr_t, zes_power_properties_t> power_property;
Expand Down
48 changes: 0 additions & 48 deletions ze/tracer_ze_helpers.include.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,15 +797,13 @@ 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;
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;
Expand Down Expand Up @@ -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);
Expand All @@ -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};
Expand All @@ -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();
Expand Down
9 changes: 0 additions & 9 deletions ze/ze_events.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down

0 comments on commit 39b4cab

Please sign in to comment.