diff --git a/conformance_tests/tools/metrics/src/test_metric_tracer.cpp b/conformance_tests/tools/metrics/src/test_metric_tracer.cpp index 2fedc533..bf284e32 100644 --- a/conformance_tests/tools/metrics/src/test_metric_tracer.cpp +++ b/conformance_tests/tools/metrics/src/test_metric_tracer.cpp @@ -236,8 +236,10 @@ LZT_TEST_F( LOG_DEBUG << "synchronize on the tracer notification event"; lzt::event_host_synchronize(notification_event, std::numeric_limits::max()); - size_t raw_data_size{}; - raw_data_size = lzt::metric_tracer_read_data_size(metric_tracer_handle); + size_t raw_data_size = 1024 * 1024; /* 1MB buffer */ + std::vector raw_data(raw_data_size, 0); + ASSERT_ZE_RESULT_SUCCESS(zetMetricTracerReadDataExp( + metric_tracer_handle, &raw_data_size, raw_data.data())); EXPECT_GE(raw_data_size, tracer_descriptor.notifyEveryNBytes) << "raw data available should be greater than equal to " "notifyEveryNBytes"; @@ -315,15 +317,15 @@ LZT_TEST_F( LOG_DEBUG << "synchronize with completion of workload"; lzt::synchronize(command_queue, std::numeric_limits::max()); - size_t raw_data_size{}; + size_t raw_data_size = 1024 * 1024; /* 1MB buffer */ + std::vector raw_data(raw_data_size, 0); EXPECT_EQ(ZE_RESULT_NOT_READY, zetMetricTracerReadDataExp(metric_tracer_handle, &raw_data_size, - nullptr)) + raw_data.data())) << "tracer is not enabled, zetMetricTracerReadDataExp should return " "ZE_RESULT_NOT_READY"; - EXPECT_EQ(0, raw_data_size) - << "zetMetricTracerReadDataExp is not expected to read any useful " - "data, raw data size should be 0"; + EXPECT_EQ(0u, raw_data_size) + << "raw_data_size should be 0 when tracer is not enabled"; lzt::metric_tracer_destroy(metric_tracer_handle); lzt::deactivate_metric_groups(device); lzt::free_memory(a_buffer); @@ -334,6 +336,40 @@ LZT_TEST_F( } } +LZT_TEST_F( + zetMetricTracerTest, + GivenTracerIsEnabledWhenQueryingForDataSizeThenExpectInvalidArgumentError) { + /* Tracer read data does not allow querying for available size */ + for (auto &device_with_metric_group_handles : + tracer_supporting_devices_list) { + device = device_with_metric_group_handles.device; + lzt::display_device_properties(device); + + auto &grp_handles = + device_with_metric_group_handles.activatable_metric_group_handle_list; + uint32_t num_grp_handles = to_u32(grp_handles.size()); + ASSERT_GT(num_grp_handles, 0u); + lzt::activate_metric_groups(device, num_grp_handles, grp_handles.data()); + + zet_metric_tracer_exp_handle_t metric_tracer_handle; + lzt::metric_tracer_create( + lzt::get_default_context(), device, num_grp_handles, grp_handles.data(), + &tracer_descriptor, nullptr, &metric_tracer_handle); + lzt::metric_tracer_enable(metric_tracer_handle, true); + + size_t raw_data_size = 0; + EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, + zetMetricTracerReadDataExp(metric_tracer_handle, &raw_data_size, + nullptr)) + << "zetMetricTracerReadDataExp with raw_data_size = 0 should return " + "ZE_RESULT_ERROR_INVALID_ARGUMENT"; + + lzt::metric_tracer_disable(metric_tracer_handle, true); + lzt::metric_tracer_destroy(metric_tracer_handle); + lzt::deactivate_metric_groups(device); + } +} + LZT_TEST_F( zetMetricTracerTest, GivenTracerIsCreatedWhenTracerIsAsynchronouslyEnabledThenExpectValidRawDataToBeAvailableOnceTracerIsEnabled) { @@ -382,11 +418,13 @@ LZT_TEST_F( std::min(max_wait_time_in_milliseconds, 100u); } - size_t raw_data_size{}; + size_t raw_data_size = 1024 * 1024; /* 1MB buffer */ + std::vector raw_data(raw_data_size, 0); /* wait for the tracer to get enabled */ do { + raw_data_size = raw_data.size(); result = zetMetricTracerReadDataExp(metric_tracer_handle, &raw_data_size, - nullptr); + raw_data.data()); if (result == ZE_RESULT_NOT_READY) { LOG_INFO << "Waiting for tracer to be enabled. zetMetricTracerReadDataExp " @@ -403,17 +441,11 @@ LZT_TEST_F( EXPECT_ZE_RESULT_SUCCESS(result); EXPECT_NE(0, raw_data_size) << "zetMetricTracerReadDataExp reports that " "there are no metrics available to read"; - if (raw_data_size != 0) { - std::vector raw_data(raw_data_size, 0); - result = zetMetricTracerReadDataExp(metric_tracer_handle, &raw_data_size, - raw_data.data()); - EXPECT_ZE_RESULT_SUCCESS(result); - uint64_t raw_data_accumulate = - std::accumulate(raw_data.begin(), raw_data.end(), 0ULL); - EXPECT_NE(0, raw_data_accumulate) - << "all raw data entries are zero, zetMetricTracerReadDataExp is " - "expected to read useful data"; - } + uint64_t raw_data_accumulate = std::accumulate( + raw_data.begin(), raw_data.begin() + raw_data_size, 0ULL); + EXPECT_NE(0, raw_data_accumulate) + << "all raw data entries are zero, zetMetricTracerReadDataExp is " + "expected to read useful data"; lzt::metric_tracer_disable(metric_tracer_handle, true); lzt::metric_tracer_destroy(metric_tracer_handle); lzt::deactivate_metric_groups(device); @@ -464,19 +496,16 @@ LZT_TEST_F( LOG_DEBUG << "synchronize with completion of workload"; lzt::synchronize(command_queue, std::numeric_limits::max()); - size_t raw_data_size{}; - std::vector raw_data; + size_t raw_data_size = 1024 * 1024; /* 1MB buffer */ + std::vector raw_data(raw_data_size, 0); uint64_t raw_data_accumulate{}; ASSERT_ZE_RESULT_SUCCESS(zetMetricTracerReadDataExp( - metric_tracer_handle, &raw_data_size, nullptr)); + metric_tracer_handle, &raw_data_size, raw_data.data())); ASSERT_NE(0, raw_data_size) << "zetMetricTracerReadDataExp reports that " "there are no metrics available to read"; - raw_data.resize(raw_data_size, 0); - ASSERT_ZE_RESULT_SUCCESS(zetMetricTracerReadDataExp( - metric_tracer_handle, &raw_data_size, raw_data.data())); - raw_data_accumulate = - std::accumulate(raw_data.begin(), raw_data.end(), 0ULL); + raw_data_accumulate = std::accumulate( + raw_data.begin(), raw_data.begin() + raw_data_size, 0ULL); ASSERT_NE(0, raw_data_accumulate) << "all raw data entries are zero, zetMetricTracerReadDataExp is " "expected to read useful data"; @@ -501,24 +530,15 @@ LZT_TEST_F( /* read raw data while API returns ZE_RESULT_SUCCESS and * ZE_RESULT_NOT_READY(for the last piece of data) */ do { - raw_data_size = 0; + raw_data_size = raw_data.size(); result = zetMetricTracerReadDataExp(metric_tracer_handle, &raw_data_size, - nullptr); + raw_data.data()); EXPECT_TRUE(ZE_RESULT_SUCCESS == result || ZE_RESULT_NOT_READY == result) - << "zetMetricTracerReadDataExp failed while retrieving the raw data " - "size"; - - if (raw_data_size != 0) { - raw_data.resize(raw_data_size, 0); - result = zetMetricTracerReadDataExp(metric_tracer_handle, - &raw_data_size, raw_data.data()); - EXPECT_TRUE(ZE_RESULT_SUCCESS == result || - ZE_RESULT_NOT_READY == result) - << "zetMetricTracerReadDataExp failed while retrieving the raw " - "data"; - - raw_data_accumulate = - std::accumulate(raw_data.begin(), raw_data.end(), 0ULL); + << "zetMetricTracerReadDataExp failed while retrieving the raw data"; + + if (result == ZE_RESULT_SUCCESS && raw_data_size != 0) { + raw_data_accumulate = std::accumulate( + raw_data.begin(), raw_data.begin() + raw_data_size, 0ULL); EXPECT_NE(0, raw_data_accumulate) << "all raw data entries are zero, zetMetricTracerReadDataExp is " "expected to read useful data"; @@ -536,11 +556,10 @@ LZT_TEST_F( << max_wait_time_in_milliseconds << " ms"; } } while (result == ZE_RESULT_SUCCESS); - raw_data_size = 0; + raw_data_size = raw_data.size(); result = zetMetricTracerReadDataExp(metric_tracer_handle, &raw_data_size, - nullptr); + raw_data.data()); EXPECT_EQ(ZE_RESULT_NOT_READY, result); - EXPECT_EQ(0, raw_data_size); lzt::metric_tracer_destroy(metric_tracer_handle); lzt::deactivate_metric_groups(device); @@ -554,9 +573,8 @@ LZT_TEST_F( LZT_TEST_F( zetMetricTracerTest, - GivenTracerIsEnabledWhenRequestingMoreRawDataThanAvailableThenReturnOnlyWhatIsAvailable) { - /* When allocating a larger buffer than needed, ensure that writes happen only - * for the size of the raw data available */ + GivenTracerIsEnabledWhenReadingWithSmallBufferThenMultipleReadsSucceed) { + /* When using a small buffer, read multiple times to retrieve all data */ for (auto &device_with_metric_group_handles : tracer_supporting_devices_list) { device = device_with_metric_group_handles.device; @@ -588,28 +606,32 @@ LZT_TEST_F( lzt::synchronize(command_queue, std::numeric_limits::max()); lzt::metric_tracer_disable(metric_tracer_handle, true); - size_t raw_data_size{}; - EXPECT_ZE_RESULT_SUCCESS(zetMetricTracerReadDataExp( - metric_tracer_handle, &raw_data_size, nullptr)); - EXPECT_NE(0, raw_data_size) - << "zetMetricTracerReadDataExp reports that there are no " - "metrics available to read"; - if (raw_data_size != 0) { - const size_t extra_buffer_size = 24; - const uint8_t raw_data_init_val = 0xBE; - raw_data_size += extra_buffer_size; - - std::vector raw_data(raw_data_size, raw_data_init_val); - EXPECT_ZE_RESULT_SUCCESS(zetMetricTracerReadDataExp( - metric_tracer_handle, &raw_data_size, raw_data.data())); + /* Read data in multiple small chunks and concatenate */ + const size_t small_buffer_size = 1024; /* 1KB buffer */ + std::vector concatenated_data; + size_t total_bytes_read = 0; + + do { + size_t chunk_size = small_buffer_size; + std::vector chunk_buffer(chunk_size, 0); + result = zetMetricTracerReadDataExp(metric_tracer_handle, &chunk_size, + chunk_buffer.data()); + if (result == ZE_RESULT_SUCCESS && chunk_size > 0) { + concatenated_data.insert(concatenated_data.end(), chunk_buffer.begin(), + chunk_buffer.begin() + chunk_size); + total_bytes_read += chunk_size; + LOG_DEBUG << "Read " << chunk_size + << " bytes, total: " << total_bytes_read; + } + } while (result == ZE_RESULT_SUCCESS); + + EXPECT_EQ(ZE_RESULT_NOT_READY, result) + << "Expected ZE_RESULT_NOT_READY when all data has been read"; + EXPECT_GT(total_bytes_read, 0u) + << "No metric data was read from the tracer"; + EXPECT_EQ(concatenated_data.size(), total_bytes_read) + << "Concatenated data size should match total bytes read"; - uint64_t excess_buffer_raw_data_sum = std::accumulate( - raw_data.end() - extra_buffer_size, raw_data.end(), 0ULL); - EXPECT_EQ((raw_data_init_val * extra_buffer_size), - excess_buffer_raw_data_sum) - << "zetMetricTracerReadDataExp should not return more raw data than " - "what is available"; - } lzt::metric_tracer_destroy(metric_tracer_handle); lzt::deactivate_metric_groups(device); lzt::free_memory(a_buffer); @@ -683,13 +705,15 @@ LZT_TEST_F( grp_handles.data(), &tracer_descriptor, nullptr, &metric_tracer_handle); - lzt::metric_tracer_enable(metric_tracer_handle, true); + lzt::metric_tracer_enable(metric_tracer_handle, false); int32_t j = 0; + size_t initial_buffer_size = 1024 * 1024; /* 1MB buffer */ + std::vector initial_buffer(initial_buffer_size, 0); do { - size_t raw_data_size = 0; - result = zetMetricTracerReadDataExp(metric_tracer_handle, - &raw_data_size, nullptr); + size_t raw_data_size = initial_buffer.size(); + result = zetMetricTracerReadDataExp( + metric_tracer_handle, &raw_data_size, initial_buffer.data()); if (result == ZE_RESULT_NOT_READY) { if (j == number_of_retries) { FAIL() << "Exceeded limit of retries of " @@ -714,25 +738,13 @@ LZT_TEST_F( lzt::metric_tracer_disable(metric_tracer_handle, false); int32_t k = 0; - std::vector raw_data_buffer; + size_t disable_buffer_size = 1024 * 1024; /* 1MB buffer */ + std::vector raw_data_buffer(disable_buffer_size, 0); do { - size_t raw_data_size = 0; - result = zetMetricTracerReadDataExp(metric_tracer_handle, - &raw_data_size, nullptr); - if (result == ZE_RESULT_SUCCESS) { - if (raw_data_size != 0) { - size_t new_raw_data_size = raw_data_size; - raw_data_buffer.resize(raw_data_size); - result = zetMetricTracerReadDataExp(metric_tracer_handle, - &new_raw_data_size, - raw_data_buffer.data()); - ASSERT_ZE_RESULT_SUCCESS(result); - ASSERT_EQ(raw_data_size, new_raw_data_size) - << "zetMetricTracerReadDataExp called with a non-zero " - "rawDataSize " - << raw_data_size << " modified the rawDataSize parameter " - << new_raw_data_size; - } + size_t raw_data_size = raw_data_buffer.size(); + result = zetMetricTracerReadDataExp( + metric_tracer_handle, &raw_data_size, raw_data_buffer.data()); + if (result == ZE_RESULT_SUCCESS && raw_data_size != 0) { if (k == number_of_retries) { FAIL() << "Exceeded limit of retries of " "zetMetricTracerReadDataExp " @@ -825,10 +837,12 @@ void run_metric_tracer_read_test( if (!synchronous) { int32_t j = 0; - size_t raw_data_size = 0; + size_t raw_data_size = 1024 * 1024; /* 1MB buffer */ + std::vector raw_data_buffer(raw_data_size, 0); do { - result = zetMetricTracerReadDataExp(metric_tracer_handle, - &raw_data_size, nullptr); + raw_data_size = raw_data_buffer.size(); + result = zetMetricTracerReadDataExp( + metric_tracer_handle, &raw_data_size, raw_data_buffer.data()); if (result == ZE_RESULT_NOT_READY) { if (j == number_of_retries) { FAIL() << "Exceeded limit of retries of " @@ -850,34 +864,12 @@ void run_metric_tracer_read_test( } while (result == ZE_RESULT_NOT_READY); ASSERT_ZE_RESULT_SUCCESS(result); - - if (raw_data_size != 0) { - size_t new_raw_data_size; - new_raw_data_size = raw_data_size; - std::vector raw_data_buffer(raw_data_size); - result = zetMetricTracerReadDataExp( - metric_tracer_handle, &new_raw_data_size, raw_data_buffer.data()); - ASSERT_ZE_RESULT_SUCCESS(result); - ASSERT_EQ(raw_data_size, new_raw_data_size) - << "zetMetricTracerReadDataExp called with non-zero " - "rawDataSize " - "value " - << raw_data_size << "returned a different data size " - << new_raw_data_size; - } } executeMatrixMultiplyWorkload(device, commandQueue, commandList); - size_t raw_data_size = 0; - raw_data_size = lzt::metric_tracer_read_data_size(metric_tracer_handle); - - ASSERT_NE(raw_data_size, 0) << "After executing a workload, " - "zetMetricTracerReadDataExp with an " - "enabled tracer and null data " - "pointer returned 0 raw data size"; - - size_t enabled_read_data_size = raw_data_size / 2; + /* Read partial data while tracer is enabled */ + size_t enabled_read_data_size = 1024; /* 1KB buffer */ std::vector enabled_raw_data(enabled_read_data_size); ASSERT_ZE_RESULT_SUCCESS(zetMetricTracerReadDataExp( @@ -889,7 +881,8 @@ void run_metric_tracer_read_test( lzt::metric_tracer_disable(metric_tracer_handle, synchronous); - size_t disabled_read_data_size = raw_data_size - enabled_read_data_size; + /* Read remaining data after disable */ + size_t disabled_read_data_size = 1024 * 1024; /* 1MB buffer */ std::vector disabled_raw_data(disabled_read_data_size); ASSERT_ZE_RESULT_SUCCESS(zetMetricTracerReadDataExp( @@ -901,10 +894,12 @@ void run_metric_tracer_read_test( "tracer has returned no data"; if (!synchronous) { int32_t k = 0; + size_t raw_data_size = 1024 * 1024; /* 1MB buffer */ + std::vector final_data_buffer(raw_data_size, 0); do { - size_t raw_data_size = 0; - result = zetMetricTracerReadDataExp(metric_tracer_handle, - &raw_data_size, nullptr); + raw_data_size = final_data_buffer.size(); + result = zetMetricTracerReadDataExp( + metric_tracer_handle, &raw_data_size, final_data_buffer.data()); if (result == ZE_RESULT_SUCCESS) { if (k == number_of_retries) { FAIL() << "Exceeded limit of retries of " @@ -1139,10 +1134,13 @@ LZT_TEST_F( } /* read data */ - size_t raw_data_size{}; - raw_data_size = lzt::metric_tracer_read_data_size(metric_tracer_handle); + size_t raw_data_size = 1024 * 1024; /* 1MB buffer */ std::vector raw_data(raw_data_size, 0); - lzt::metric_tracer_read_data(metric_tracer_handle, &raw_data); + ASSERT_ZE_RESULT_SUCCESS(zetMetricTracerReadDataExp( + metric_tracer_handle, &raw_data_size, raw_data.data())); + ASSERT_NE(raw_data_size, 0) + << "zetMetricTracerReadDataExp returned no data"; + raw_data.resize(raw_data_size); /* decode data */ uint32_t metric_entry_count = 0; @@ -1330,10 +1328,13 @@ LZT_TEST_F( lzt::synchronize(command_queue, std::numeric_limits::max()); lzt::metric_tracer_disable(metric_tracer_handle, true); /* read data */ - size_t raw_data_size = 0; - raw_data_size = lzt::metric_tracer_read_data_size(metric_tracer_handle); + size_t raw_data_size = 1024 * 1024; /* 1MB buffer */ std::vector raw_data(raw_data_size, 0); - lzt::metric_tracer_read_data(metric_tracer_handle, &raw_data); + ASSERT_ZE_RESULT_SUCCESS(zetMetricTracerReadDataExp( + metric_tracer_handle, &raw_data_size, raw_data.data())); + ASSERT_NE(raw_data_size, 0) + << "zetMetricTracerReadDataExp returned no data"; + raw_data.resize(raw_data_size); zet_metric_decoder_exp_handle_t metric_decoder_handle = nullptr; lzt::metric_decoder_create(metric_tracer_handle, &metric_decoder_handle); @@ -1453,10 +1454,13 @@ LZT_TEST_F( lzt::synchronize(command_queue, std::numeric_limits::max()); lzt::metric_tracer_disable(metric_tracer_handle, true); /* read data */ - size_t raw_data_size = 0; - raw_data_size = lzt::metric_tracer_read_data_size(metric_tracer_handle); + size_t raw_data_size = 1024 * 1024; /* 1MB buffer */ std::vector raw_data(raw_data_size, 0); - lzt::metric_tracer_read_data(metric_tracer_handle, &raw_data); + ASSERT_ZE_RESULT_SUCCESS(zetMetricTracerReadDataExp( + metric_tracer_handle, &raw_data_size, raw_data.data())); + ASSERT_NE(raw_data_size, 0) + << "zetMetricTracerReadDataExp returned no data"; + raw_data.resize(raw_data_size); zet_metric_decoder_exp_handle_t metric_decoder_handle = nullptr; lzt::metric_decoder_create(metric_tracer_handle, &metric_decoder_handle); @@ -1569,10 +1573,13 @@ LZT_TEST_F(zetMetricTracerTest, std::numeric_limits::max()); lzt::metric_tracer_disable(metric_tracer_handle, true); /* read data */ - size_t raw_data_size = 0; - raw_data_size = lzt::metric_tracer_read_data_size(metric_tracer_handle); + size_t raw_data_size = 1024 * 1024; /* 1MB buffer */ std::vector raw_data(raw_data_size, 0); - lzt::metric_tracer_read_data(metric_tracer_handle, &raw_data); + ASSERT_ZE_RESULT_SUCCESS(zetMetricTracerReadDataExp( + metric_tracer_handle, &raw_data_size, raw_data.data())); + ASSERT_NE(raw_data_size, 0) + << "zetMetricTracerReadDataExp returned no data"; + raw_data.resize(raw_data_size); zet_metric_decoder_exp_handle_t metric_decoder_handle = nullptr; lzt::metric_decoder_create(metric_tracer_handle, &metric_decoder_handle); @@ -1700,10 +1707,13 @@ LZT_TEST_F( lzt::synchronize(command_queue, std::numeric_limits::max()); lzt::metric_tracer_disable(metric_tracer_handle, true); /* read data */ - size_t raw_data_size = 0; - raw_data_size = lzt::metric_tracer_read_data_size(metric_tracer_handle); + size_t raw_data_size = 1024 * 1024; /* 1MB buffer */ std::vector raw_data(raw_data_size, 0); - lzt::metric_tracer_read_data(metric_tracer_handle, &raw_data); + ASSERT_ZE_RESULT_SUCCESS(zetMetricTracerReadDataExp( + metric_tracer_handle, &raw_data_size, raw_data.data())); + ASSERT_NE(raw_data_size, 0) + << "zetMetricTracerReadDataExp returned no data"; + raw_data.resize(raw_data_size); zet_metric_decoder_exp_handle_t metric_decoder_handle = nullptr; lzt::metric_decoder_create(metric_tracer_handle, &metric_decoder_handle); diff --git a/utils/test_harness/tools/include/test_harness_metric.hpp b/utils/test_harness/tools/include/test_harness_metric.hpp index 4be5fb0a..79cd535f 100644 --- a/utils/test_harness/tools/include/test_harness_metric.hpp +++ b/utils/test_harness/tools/include/test_harness_metric.hpp @@ -278,9 +278,6 @@ void metric_tracer_enable(zet_metric_tracer_exp_handle_t metric_tracer_handle, void metric_tracer_disable(zet_metric_tracer_exp_handle_t metric_tracer_handle, ze_bool_t synchronous); -size_t metric_tracer_read_data_size( - zet_metric_tracer_exp_handle_t metric_tracer_handle); - void metric_tracer_read_data( zet_metric_tracer_exp_handle_t metric_tracer_handle, std::vector *ptr_metric_data); diff --git a/utils/test_harness/tools/src/test_harness_metric.cpp b/utils/test_harness/tools/src/test_harness_metric.cpp index d3065de0..86465ac6 100644 --- a/utils/test_harness/tools/src/test_harness_metric.cpp +++ b/utils/test_harness/tools/src/test_harness_metric.cpp @@ -1712,29 +1712,6 @@ void metric_tracer_disable(zet_metric_tracer_exp_handle_t metric_tracer_handle, zetMetricTracerDisableExp(metric_tracer_handle, synchronous)); } -size_t metric_tracer_read_data_size( - zet_metric_tracer_exp_handle_t metric_tracer_handle) { - size_t metric_size = 0; - EXPECT_ZE_RESULT_SUCCESS( - zetMetricTracerReadDataExp(metric_tracer_handle, &metric_size, nullptr)); - EXPECT_NE(0u, metric_size) - << "zetMetricTracerReadDataExp reports that there are no " - "metrics available to read"; - LOG_DEBUG << "raw data size = " << metric_size; - return metric_size; -} - -void metric_tracer_read_data( - zet_metric_tracer_exp_handle_t metric_tracer_handle, - std::vector *ptr_metric_data) { - EXPECT_NE(nullptr, ptr_metric_data); - size_t metric_size = metric_tracer_read_data_size(metric_tracer_handle); - EXPECT_NE(0u, metric_size); - ptr_metric_data->resize(metric_size); - EXPECT_ZE_RESULT_SUCCESS(zetMetricTracerReadDataExp( - metric_tracer_handle, &metric_size, ptr_metric_data->data())); -} - void enable_metrics_runtime(ze_device_handle_t device) { EXPECT_NE(nullptr, device); EXPECT_ZE_RESULT_SUCCESS(zetDeviceEnableMetricsExp(device));