mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
feature: Add support for OA buffer overflow
Related-To: NEO-8685 Signed-off-by: shubham kumar <shubham.kumar@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
82eacc88bf
commit
b2d25174fb
@@ -321,6 +321,30 @@ ze_result_t MetricEnumeration::cacheMetricInformation() {
|
||||
|
||||
// 2. Find "OA" concurrent group.
|
||||
if (strcmp(pConcurrentGroupParams->SymbolName, oaConcurrentGroupName) == 0) {
|
||||
|
||||
// Find the oaBufferOverflowInformation and store in member variable pOaBufferOverflowInformation
|
||||
const uint32_t measurementInfoCount = pConcurrentGroupParams->IoMeasurementInformationCount;
|
||||
MetricsDiscovery::IInformationLatest *oaBufferOverflowInformation = nullptr;
|
||||
|
||||
for (uint32_t i = 0; i < measurementInfoCount; ++i) {
|
||||
MetricsDiscovery::IInformationLatest *ioMeasurement = pConcurrentGroup->GetIoMeasurementInformation(i);
|
||||
DEBUG_BREAK_IF(ioMeasurement == nullptr);
|
||||
|
||||
if (ioMeasurement->GetParams()->SymbolName == std::string("BufferOverflow")) {
|
||||
oaBufferOverflowInformation = ioMeasurement;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// MDAPI checks for proper library initialization
|
||||
if (oaBufferOverflowInformation == nullptr ||
|
||||
oaBufferOverflowInformation->GetParams()->IoReadEquation->GetEquationElementsCount() != 1 ||
|
||||
oaBufferOverflowInformation->GetParams()->IoReadEquation->GetEquationElement(0)->Type != MetricsDiscovery::EQUATION_ELEM_IMM_UINT64) {
|
||||
METRICS_LOG_ERR("IoMeasurmentInformation is not as expected for OA %s", " ");
|
||||
return ZE_RESULT_ERROR_UNKNOWN;
|
||||
}
|
||||
pOaBufferOverflowInformation = oaBufferOverflowInformation;
|
||||
|
||||
// Reserve memory for metric groups
|
||||
metricGroups.reserve(pConcurrentGroupParams->MetricSetsCount);
|
||||
|
||||
@@ -693,8 +717,11 @@ ze_result_t OaMetricGroupImp::readIoStream(uint32_t &reportCount, uint8_t &repor
|
||||
|
||||
switch (readResult) {
|
||||
case MetricsDiscovery::CC_OK:
|
||||
case MetricsDiscovery::CC_READ_PENDING:
|
||||
return ZE_RESULT_SUCCESS;
|
||||
case MetricsDiscovery::CC_READ_PENDING: {
|
||||
MetricsDiscovery::IInformationLatest *oaBufferOverflowInformation = getMetricEnumeration().getOaBufferOverflowInformation();
|
||||
const bool oaBufferOverflow = oaBufferOverflowInformation->GetParams()->IoReadEquation->GetEquationElement(0)->ImmediateUInt64 != 0;
|
||||
return oaBufferOverflow ? ZE_RESULT_WARNING_DROPPED_DATA : ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
default:
|
||||
return ZE_RESULT_ERROR_UNKNOWN;
|
||||
|
||||
@@ -76,6 +76,7 @@ struct MetricEnumeration {
|
||||
getMetricResultType(const MetricsDiscovery::TMetricResultType sourceMetricResultType) const;
|
||||
void getL0MetricPropertiesFromMdapiMetric(zet_metric_properties_t &l0MetricProps, MetricsDiscovery::IMetric_1_0 *mdapiMetric);
|
||||
void getL0MetricPropertiesFromMdapiInformation(zet_metric_properties_t &l0MetricProps, MetricsDiscovery::IInformation_1_0 *mdapiInformation);
|
||||
MetricsDiscovery::IInformationLatest *getOaBufferOverflowInformation() const { return pOaBufferOverflowInformation; }
|
||||
|
||||
protected:
|
||||
ze_result_t initialize();
|
||||
@@ -115,6 +116,7 @@ struct MetricEnumeration {
|
||||
MetricsDiscovery::IAdapter_1_9 *pAdapter = nullptr;
|
||||
MetricsDiscovery::IMetricsDevice_1_5 *pMetricsDevice = nullptr;
|
||||
uint32_t maximumOaBufferSize = 0u;
|
||||
MetricsDiscovery::IInformationLatest *pOaBufferOverflowInformation = nullptr;
|
||||
|
||||
public:
|
||||
// Metrics Discovery version should be at least 1.5.
|
||||
|
||||
@@ -86,7 +86,7 @@ ze_result_t OaMetricStreamerImp::readData(uint32_t maxReportCount, size_t *pRawD
|
||||
|
||||
// Read streamer data.
|
||||
result = metricGroup->readIoStream(reportCount, *pRawData);
|
||||
if (result == ZE_RESULT_SUCCESS) {
|
||||
if (result == ZE_RESULT_SUCCESS || result == ZE_RESULT_WARNING_DROPPED_DATA) {
|
||||
*pRawDataSize = reportCount * rawReportSize;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,11 +105,12 @@ void SingleMetricStreamerCollector::showResults() {
|
||||
|
||||
// Read raw data.
|
||||
rawData.resize(rawDataSize, 0);
|
||||
VALIDATECALL(zetMetricStreamerReadData(metricStreamer, maxRawReportCount, &rawDataSize, rawData.data()));
|
||||
ze_result_t status = zetMetricStreamerReadData(metricStreamer, maxRawReportCount, &rawDataSize, rawData.data());
|
||||
LOG(zmu::LogLevel::DEBUG) << "Streamer read raw bytes: " << rawDataSize << std::endl;
|
||||
|
||||
if (rawDataSize == 0) {
|
||||
if (status == ZE_RESULT_WARNING_DROPPED_DATA) {
|
||||
rawDataSize = (uint32_t)rawData.size();
|
||||
zmu::sleep(5);
|
||||
VALIDATECALL(zetMetricStreamerReadData(metricStreamer, maxRawReportCount, &rawDataSize, rawData.data()));
|
||||
LOG(zmu::LogLevel::DEBUG) << "Streamer read raw bytes: " << rawDataSize << std::endl;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
* Copyright (C) 2020-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -149,6 +149,19 @@ TEST_F(MetricQueryPoolLinuxTest, givenCorrectArgumentsWhenCacheConfigurationIsCa
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
metricsSetParams.ApiMask = MetricsDiscovery::API_TYPE_OCL;
|
||||
@@ -160,6 +173,8 @@ TEST_F(MetricQueryPoolLinuxTest, givenCorrectArgumentsWhenCacheConfigurationIsCa
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
* Copyright (C) 2020-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -31,6 +31,7 @@ using MetricsDiscovery::IAdapterGroup_1_8;
|
||||
using MetricsDiscovery::IAdapterGroup_1_9;
|
||||
using MetricsDiscovery::IAdapterGroupLatest;
|
||||
using MetricsDiscovery::IConcurrentGroup_1_5;
|
||||
using MetricsDiscovery::IEquation_1_0;
|
||||
using MetricsDiscovery::IInformation_1_0;
|
||||
using MetricsDiscovery::IMetric_1_0;
|
||||
using MetricsDiscovery::IMetricsDevice_1_5;
|
||||
@@ -45,6 +46,7 @@ using MetricsDiscovery::TAdapterParams_1_9;
|
||||
using MetricsDiscovery::TCompletionCode;
|
||||
using MetricsDiscovery::TConcurrentGroupParams_1_0;
|
||||
using MetricsDiscovery::TEngineParams_1_9;
|
||||
using MetricsDiscovery::TEquationElement_1_0;
|
||||
using MetricsDiscovery::TGlobalSymbol_1_0;
|
||||
using MetricsDiscovery::TMetricParams_1_0;
|
||||
using MetricsDiscovery::TMetricsDeviceParams_1_2;
|
||||
@@ -204,6 +206,26 @@ class Mock<IConcurrentGroup_1_5> : public IConcurrentGroup_1_5 {
|
||||
std::vector<TCompletionCode> openIoStreamResults{};
|
||||
};
|
||||
|
||||
template <>
|
||||
class Mock<IEquation_1_0> : public IEquation_1_0 {
|
||||
public:
|
||||
~Mock() override = default;
|
||||
|
||||
uint32_t GetEquationElementsCount() override {
|
||||
return getEquationElementsCount;
|
||||
}
|
||||
|
||||
TEquationElement_1_0 *GetEquationElement(uint32_t index) override {
|
||||
if (!getEquationElement.empty()) {
|
||||
return getEquationElement[index];
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector<TEquationElement_1_0 *> getEquationElement;
|
||||
uint32_t getEquationElementsCount = 1u;
|
||||
};
|
||||
|
||||
template <>
|
||||
class Mock<IMetricSet_1_5> : public IMetricSet_1_5 {
|
||||
public:
|
||||
|
||||
@@ -95,6 +95,22 @@ TEST_F(MetricEnumerationTest, givenTwoConcurrentMetricGroupsWhenZetGetMetricGrou
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup0.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
metricsConcurrentGroup1.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -137,6 +153,21 @@ TEST_F(MetricEnumerationTest, givenInvalidArgumentsWhenZetGetMetricGroupProperti
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -180,6 +211,21 @@ TEST_F(MetricEnumerationTest, givenValidArgumentsWhenZetGetMetricGroupProperties
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -234,6 +280,19 @@ TEST_F(MetricEnumerationTest, givenInvalidArgumentsWhenZetMetricGetIsCalledThenR
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -254,6 +313,8 @@ TEST_F(MetricEnumerationTest, givenInvalidArgumentsWhenZetMetricGetIsCalledThenR
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
@@ -279,6 +340,19 @@ TEST_F(MetricEnumerationTest, givenValidArgumentsWhenZetMetricGetIsCalledThenRet
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -304,6 +378,8 @@ TEST_F(MetricEnumerationTest, givenValidArgumentsWhenZetMetricGetIsCalledThenRet
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
@@ -338,6 +414,21 @@ TEST_F(MetricEnumerationTest, GivenEnumerationIsSuccessfulWhenReadingMetricsFreq
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -400,6 +491,19 @@ TEST_F(MetricEnumerationTest, GivenValidMetricGroupWhenReadingPropertiesAndIncor
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -427,6 +531,8 @@ TEST_F(MetricEnumerationTest, GivenValidMetricGroupWhenReadingPropertiesAndIncor
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
@@ -455,6 +561,21 @@ TEST_F(MetricEnumerationTest, GivenValidMetricGroupWhenReadingFrequencyAndIntern
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -555,6 +676,21 @@ TEST_F(MetricEnumerationTest, GivenEnumerationIsSuccessfulWhenReadingMetricsFreq
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -620,6 +756,21 @@ TEST_F(MetricEnumerationTest, GivenEnumerationIsSuccessfulWhenFailingToReadMetri
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -686,6 +837,21 @@ TEST_F(MetricEnumerationTest, givenValidArgumentsWhenZetMetricGetIsCalledThenRet
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -748,6 +914,21 @@ TEST_F(MetricEnumerationTest, givenInvalidArgumentsWhenZetMetricGetPropertiestIs
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -810,6 +991,19 @@ TEST_F(MetricEnumerationTest, givenValidArgumentsWhenZetMetricGetPropertiestIsCa
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -841,6 +1035,8 @@ TEST_F(MetricEnumerationTest, givenValidArgumentsWhenZetMetricGetPropertiestIsCa
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
@@ -885,6 +1081,21 @@ TEST_F(MetricEnumerationTest, givenValidArgumentsWhenZetMetricGetPropertiestIsCa
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -959,6 +1170,21 @@ TEST_F(MetricEnumerationTest, givenInvalidArgumentsWhenzetContextActivateMetricG
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -1017,6 +1243,21 @@ TEST_F(MetricEnumerationTest, givenValidEventBasedMetricGroupWhenzetContextActiv
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -1079,6 +1320,19 @@ TEST_F(MultiDeviceMetricEnumerationTest, givenMultipleDevicesAndValidEventBasedM
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -1109,6 +1363,8 @@ TEST_F(MultiDeviceMetricEnumerationTest, givenMultipleDevicesAndValidEventBasedM
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
@@ -1140,6 +1396,19 @@ TEST_F(MultiDeviceMetricEnumerationTest, givenMultipleDevicesAndTwoMetricGroupsW
|
||||
metricsConcurrentGroupParams0.MetricSetsCount = 2;
|
||||
metricsConcurrentGroupParams0.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams0.Description = "OA description";
|
||||
metricsConcurrentGroupParams0.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet0;
|
||||
@@ -1183,6 +1452,8 @@ TEST_F(MultiDeviceMetricEnumerationTest, givenMultipleDevicesAndTwoMetricGroupsW
|
||||
metricsConcurrentGroup0.getMetricSetResults.push_back(&metricsSet1);
|
||||
metricsConcurrentGroup0.getMetricSetResults.push_back(&metricsSet0);
|
||||
metricsConcurrentGroup0.getMetricSetResults.push_back(&metricsSet1);
|
||||
metricsConcurrentGroup0.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet0.GetParamsResult = &metricsSetParams0;
|
||||
metricsSet1.GetParamsResult = &metricsSetParams1;
|
||||
@@ -1227,6 +1498,21 @@ TEST_F(MetricEnumerationTest, givenValidTimeBasedMetricGroupWhenzetContextActiva
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -1288,6 +1574,21 @@ TEST_F(MetricEnumerationTest, givenActivateTheSameMetricGroupTwiceWhenzetContext
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -1354,6 +1655,24 @@ TEST_F(MetricEnumerationTest, givenActivateTwoMetricGroupsWithDifferentDomainsWh
|
||||
metricsConcurrentGroupParams0.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams1.SymbolName = "OA";
|
||||
|
||||
metricsConcurrentGroupParams0.IoMeasurementInformationCount = 1;
|
||||
metricsConcurrentGroupParams1.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
metricsConcurrentGroup0.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
metricsConcurrentGroup1.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
|
||||
// Metrics Discovery: metric set
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -1411,6 +1730,24 @@ TEST_F(MetricEnumerationTest, givenActivateTwoMetricGroupsWithDifferentDomainsAt
|
||||
metricsConcurrentGroupParams0.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams1.SymbolName = "OA";
|
||||
|
||||
metricsConcurrentGroupParams0.IoMeasurementInformationCount = 1;
|
||||
metricsConcurrentGroupParams1.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
metricsConcurrentGroup0.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
metricsConcurrentGroup1.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
|
||||
// Metrics Discovery: metric set
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -1461,6 +1798,21 @@ TEST_F(MetricEnumerationTest, givenActivateTwoMetricGroupsWithTheSameDomainsWhen
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 2;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery: metric set
|
||||
Mock<IMetricSet_1_5> metricsSet0;
|
||||
@@ -1516,6 +1868,21 @@ TEST_F(MetricEnumerationTest, givenValidMetricGroupWhenDeactivateIsDoneThenDomai
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery: metric set
|
||||
Mock<IMetricSet_1_5> metricsSet0;
|
||||
@@ -1556,6 +1923,19 @@ TEST_F(MetricEnumerationTest, GivenAlreadyActivatedMetricGroupWhenzetContextActi
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 2;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
// Metrics Discovery: metric set
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
@@ -1576,6 +1956,8 @@ TEST_F(MetricEnumerationTest, GivenAlreadyActivatedMetricGroupWhenzetContextActi
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
@@ -1623,6 +2005,21 @@ TEST_F(MetricEnumerationTest, givenInvalidArgumentsWhenZetMetricGroupCalculateMe
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery: metric set
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
@@ -1660,6 +2057,21 @@ TEST_F(MetricEnumerationTest, givenIncorrectRawReportSizeWhenZetMetricGroupCalcu
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery: metric set
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
@@ -1712,6 +2124,21 @@ TEST_F(MetricEnumerationTest, givenIncorrectRawReportSizeWhenZetMetricGroupCalcu
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery: metric set
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
@@ -1766,6 +2193,21 @@ TEST_F(MetricEnumerationTest, givenCorrectRawReportSizeWhenZetMetricGroupCalcula
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -1827,6 +2269,21 @@ TEST_F(MetricEnumerationTest, givenFailedCalculateMetricsWhenZetMetricGroupCalcu
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -1886,6 +2343,21 @@ TEST_F(MetricEnumerationTest, givenInvalidQueryReportSizeWhenZetMetricGroupCalcu
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -1949,6 +2421,21 @@ TEST_F(MetricEnumerationTest, givenCorrectRawDataHeaderWhenZetMetricGroupCalcula
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -2024,6 +2511,19 @@ TEST_F(MetricEnumerationTest, givenCorrectRawReportSizeWhenZetMetricGroupCalcula
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
// Metrics Discovery: metric set
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
@@ -2047,6 +2547,8 @@ TEST_F(MetricEnumerationTest, givenCorrectRawReportSizeWhenZetMetricGroupCalcula
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
@@ -2090,6 +2592,21 @@ TEST_F(MetricEnumerationTest, givenCorrectRawReportSizeAndLowerProvidedCalculate
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery: metric set
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
@@ -2151,6 +2668,21 @@ TEST_F(MetricEnumerationTest, givenCorrectRawReportSizeAndCorrectCalculatedRepor
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery: metric set
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
@@ -2209,6 +2741,21 @@ TEST_F(MetricEnumerationTest, givenCorrectRawReportSizeAndCorrectCalculatedRepor
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery: metric set
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
@@ -2268,6 +2815,19 @@ TEST_F(MetricEnumerationTest, givenIncorrectCalculationTypeWhenZetMetricGroupCal
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
// Metrics Discovery: metric set
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
@@ -2291,6 +2851,8 @@ TEST_F(MetricEnumerationTest, givenIncorrectCalculationTypeWhenZetMetricGroupCal
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
@@ -2329,6 +2891,19 @@ TEST_F(MetricEnumerationTest, givenNotInitializedMetricEnumerationWhenIsInitiali
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
// Metrics Discovery: metric set
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
@@ -2349,6 +2924,8 @@ TEST_F(MetricEnumerationTest, givenNotInitializedMetricEnumerationWhenIsInitiali
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
@@ -2424,6 +3001,19 @@ TEST_P(MetricEnumerationTestMetricTypes, givenValidMetricTypesWhenSetAndGetIsSam
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -2455,6 +3045,8 @@ TEST_P(MetricEnumerationTestMetricTypes, givenValidMetricTypesWhenSetAndGetIsSam
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
@@ -2530,6 +3122,21 @@ TEST_P(MetricEnumerationTestInformationTypes, givenValidInformationTypesWhenSetA
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -2691,6 +3298,21 @@ TEST_F(MetricEnumerationTest, givenValidArgumentsWhenZetGetMetricGroupProperties
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
|
||||
@@ -33,36 +33,6 @@ TEST_F(MetricEnumerationTest, givenTimeAndBufferSizeWhenOpenIoStreamReturnsError
|
||||
EXPECT_EQ(metricGroup.openIoStream(timerPeriodNs, oaBufferSize), ZE_RESULT_ERROR_UNKNOWN);
|
||||
}
|
||||
|
||||
TEST_F(MetricEnumerationTest, givenReportCountAndReportDataWhenReadIoStreamReturnsOkTheMetricGroupReadIoStreamReturnsSuccess) {
|
||||
|
||||
Mock<MetricsDiscovery::IConcurrentGroup_1_5> concurrentGroup;
|
||||
MockMetricSource mockSource{};
|
||||
MetricGroupImpTest metricGroup(mockSource);
|
||||
|
||||
metricGroup.pReferenceConcurrentGroup = &concurrentGroup;
|
||||
|
||||
uint32_t reportCount = 1;
|
||||
uint8_t reportData = 0;
|
||||
|
||||
EXPECT_EQ(metricGroup.readIoStream(reportCount, reportData), ZE_RESULT_SUCCESS);
|
||||
}
|
||||
|
||||
TEST_F(MetricEnumerationTest, givenReportCountAndReportDataWhenReadIoStreamReturnsPendingTheMetricGroupReadIoStreamReturnsSuccess) {
|
||||
|
||||
Mock<MetricsDiscovery::IConcurrentGroup_1_5> concurrentGroup;
|
||||
|
||||
MockMetricSource mockSource{};
|
||||
MetricGroupImpTest metricGroup(mockSource);
|
||||
|
||||
metricGroup.pReferenceConcurrentGroup = &concurrentGroup;
|
||||
concurrentGroup.readIoStreamResult = TCompletionCode::CC_READ_PENDING;
|
||||
|
||||
uint32_t reportCount = 1;
|
||||
uint8_t reportData = 0;
|
||||
|
||||
EXPECT_EQ(metricGroup.readIoStream(reportCount, reportData), ZE_RESULT_SUCCESS);
|
||||
}
|
||||
|
||||
TEST_F(MetricEnumerationTest, givenReportCountAndReportDataWhenReadIoStreamReturnsErrorThenMetrigGroupReadIoStreamReturnsError) {
|
||||
|
||||
Mock<MetricsDiscovery::IConcurrentGroup_1_5> concurrentGroup;
|
||||
@@ -280,6 +250,19 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenValidArgumentsWhenZetMetricGetProp
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -312,6 +295,8 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenValidArgumentsWhenZetMetricGetProp
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
@@ -364,6 +349,19 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenRootDeviceIsEnumeratedAfterSubDevi
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -389,6 +387,8 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenRootDeviceIsEnumeratedAfterSubDevi
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
@@ -416,6 +416,19 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenCorrectRawDataHeaderWhenZetMetricG
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -438,6 +451,8 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenCorrectRawDataHeaderWhenZetMetricG
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
@@ -496,6 +511,21 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenInvalidDataCountAndTotalMetricCoun
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -574,6 +604,21 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenInvalidQueryReportSizeWhenZetMetri
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -644,6 +689,21 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenErrorGeneralOnCalculateMetricsWhen
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -722,6 +782,21 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenCorrectRawDataHeaderWhenZetMetricG
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -790,6 +865,21 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenCorrectRawDataHeaderWhenFirstSubDe
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -871,6 +961,21 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenCorrectRawDataHeaderWhenSecondSubD
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -952,6 +1057,21 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenCorrectRawDataHeaderWhenBothSubDev
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -1023,6 +1143,21 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenCorrectRawDataHeaderWhenBothSubDev
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -1103,6 +1238,21 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenCorrectRawDataHeaderWhenBothSubDev
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -1183,6 +1333,19 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenOaMetricSourceWhenGetConcurrentMet
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -1205,6 +1368,8 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenOaMetricSourceWhenGetConcurrentMet
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
|
||||
@@ -23,8 +23,8 @@ static const char *testString = "TestString";
|
||||
class MockIEquation10 : public MetricsDiscovery::IEquation_1_0 {
|
||||
public:
|
||||
MockIEquation10() {
|
||||
equationElement.Type = MetricsDiscovery::EQUATION_ELEM_OPERATION;
|
||||
equationElement.Operation = MetricsDiscovery::EQUATION_OPER_RSHIFT;
|
||||
equationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
equationElement.ImmediateUInt64 = 0;
|
||||
equationElement.SymbolName = const_cast<char *>(equationName);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ class MetricExportDataOaTest : public Test<MetricMultiDeviceFixture> {
|
||||
informationParams.InfoUnits = "infoParamsUnits";
|
||||
informationParams.LongName = "infoParamsLongName";
|
||||
informationParams.ShortName = "infoParamsShortName";
|
||||
informationParams.SymbolName = "infoParamsSymbolName";
|
||||
informationParams.SymbolName = "BufferOverflow";
|
||||
informationParams.IoReadEquation = &equation;
|
||||
informationParams.QueryReadEquation = &equation;
|
||||
informationParams.OverflowFunction = deltaFunction;
|
||||
@@ -177,7 +177,7 @@ class MetricExportDataOaTest : public Test<MetricMultiDeviceFixture> {
|
||||
auto elementsPtr = zet_intel_metric_df_gpu_offset_to_ptr(zet_intel_metric_df_gpu_equation_element_0_1_offset_t, equation.elements, data);
|
||||
auto elementSymbolPtr = zet_intel_metric_df_gpu_offset_to_ptr(cstring_offset_t, elementsPtr->symbolName, data);
|
||||
EXPECT_STREQ(elementSymbolPtr, "EquationElement");
|
||||
EXPECT_EQ(readUnaligned(&elementsPtr->type), ZET_INTEL_METRIC_DF_EQUATION_ELEM_OPERATION);
|
||||
EXPECT_EQ(readUnaligned(&elementsPtr->type), ZET_INTEL_METRIC_DF_EQUATION_ELEM_IMM_UINT64);
|
||||
EXPECT_EQ(readUnaligned(&elementsPtr->operation), ZET_INTEL_METRIC_DF_EQUATION_OPER_RSHIFT);
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ class MetricExportDataOaTest : public Test<MetricMultiDeviceFixture> {
|
||||
auto shortNamePtr = zet_intel_metric_df_gpu_offset_to_ptr(cstring_offset_t, infoPtr->shortName, data);
|
||||
EXPECT_STREQ(shortNamePtr, "infoParamsShortName");
|
||||
auto symbolNamePtr = zet_intel_metric_df_gpu_offset_to_ptr(cstring_offset_t, infoPtr->symbolName, data);
|
||||
EXPECT_STREQ(symbolNamePtr, "infoParamsSymbolName");
|
||||
EXPECT_STREQ(symbolNamePtr, "BufferOverflow");
|
||||
}
|
||||
|
||||
void validateMetricSet(zet_intel_metric_df_gpu_export_data_format_t *data) {
|
||||
|
||||
@@ -43,6 +43,19 @@ TEST_F(MetricQueryPoolTest, givenCorrectArgumentsWhenStreamerIsOpenThenQueryPool
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -73,6 +86,8 @@ TEST_F(MetricQueryPoolTest, givenCorrectArgumentsWhenStreamerIsOpenThenQueryPool
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
@@ -472,6 +487,19 @@ TEST_F(MetricQueryPoolTest, givenCorrectArgumentsWhenActivateMetricGroupsIsCalle
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -509,6 +537,8 @@ TEST_F(MetricQueryPoolTest, givenCorrectArgumentsWhenActivateMetricGroupsIsCalle
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
* Copyright (C) 2020-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -86,6 +86,19 @@ TEST_F(MetricQueryPoolTest, givenMetricQueryIsActiveWhenMetricGroupDeactivateIsC
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -131,6 +144,8 @@ TEST_F(MetricQueryPoolTest, givenMetricQueryIsActiveWhenMetricGroupDeactivateIsC
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
@@ -179,6 +194,19 @@ TEST_F(MetricQueryPoolTest, givenMetricGroupIsActiveWhenQueryPoolDestroyIsCalled
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -224,6 +252,8 @@ TEST_F(MetricQueryPoolTest, givenMetricGroupIsActiveWhenQueryPoolDestroyIsCalled
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
@@ -335,6 +365,21 @@ TEST_F(MultiDeviceMetricQueryPoolTest, givenCorrectArgumentsWhenZetMetricQueryPo
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -427,6 +472,21 @@ TEST_F(MultiDeviceMetricQueryPoolTest, givenImplicitScalingIsEnabledWhenMetricsA
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -513,6 +573,19 @@ TEST_F(MultiDeviceMetricQueryPoolTest, givenEnableWalkerPartitionIsOnWhenZetComm
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -557,6 +630,8 @@ TEST_F(MultiDeviceMetricQueryPoolTest, givenEnableWalkerPartitionIsOnWhenZetComm
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
@@ -627,6 +702,21 @@ TEST_F(MultiDeviceMetricQueryPoolTest, givenFailedMetricsLibraryContextWhenZetMe
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
* Copyright (C) 2022-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -29,6 +29,19 @@ TEST_F(MultiDeviceMetricQueryPoolTest, givenFailedGetDataWhenZetMetricQueryGetDa
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -78,6 +91,8 @@ TEST_F(MultiDeviceMetricQueryPoolTest, givenFailedGetDataWhenZetMetricQueryGetDa
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
@@ -146,6 +161,21 @@ TEST_F(MultiDeviceMetricQueryPoolTest, givenCorrectArgumentsWhenZetCommandListAp
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -279,6 +309,19 @@ TEST_F(MultiDeviceMetricQueryPoolTest, givenInvalidCommandBufferGetSizeWhenZetCo
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -326,6 +369,8 @@ TEST_F(MultiDeviceMetricQueryPoolTest, givenInvalidCommandBufferGetSizeWhenZetCo
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
@@ -378,6 +423,21 @@ TEST_F(MultiDeviceMetricQueryPoolTest, givenInvalidCommandBufferGetWhenZetComman
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
* Copyright (C) 2022-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -39,6 +39,21 @@ TEST_F(MultiDeviceMetricQueryPoolTest, givenValidArgumentsWhenZetMetricGroupCalc
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -166,6 +181,19 @@ TEST_F(MultiDeviceMetricQueryPoolTest, givenCorrectArgumentsWhenActivateMetricGr
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -203,6 +231,8 @@ TEST_F(MultiDeviceMetricQueryPoolTest, givenCorrectArgumentsWhenActivateMetricGr
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
@@ -246,6 +276,21 @@ TEST_F(MultiDeviceMetricQueryPoolTest, givenMetricQueryPoolIsDestroyedWhenMetric
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
* Copyright (C) 2020-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -42,6 +42,51 @@ TEST_F(MetricStreamerTest, givenInvalidMetricGroupTypeWhenZetMetricStreamerOpenI
|
||||
|
||||
metricGroup.getPropertiesOutProperties = &metricGroupProperties;
|
||||
|
||||
metricsDeviceParams.ConcurrentGroupsCount = 1;
|
||||
|
||||
Mock<IConcurrentGroup_1_5> metricsConcurrentGroup;
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
metricsSetParams.ApiMask = MetricsDiscovery::API_TYPE_OCL;
|
||||
metricsSetParams.QueryReportSize = 0;
|
||||
metricsSetParams.MetricsCount = 11;
|
||||
|
||||
Mock<IMetric_1_0> metric;
|
||||
MetricsDiscovery::TMetricParams_1_0 metricParams = {};
|
||||
|
||||
openMetricsAdapter();
|
||||
|
||||
setupDefaultMocksForMetricDevice(metricsDevice);
|
||||
|
||||
metricsDevice.getConcurrentGroupResults.push_back(&metricsConcurrentGroup);
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
|
||||
metric.GetParamsResult = &metricParams;
|
||||
|
||||
// Metric streamer open.
|
||||
EXPECT_EQ(zetMetricStreamerOpen(context->toHandle(), metricDeviceHandle, metricGroupHandle, &streamerDesc, eventHandle, &streamerHandle), ZE_RESULT_ERROR_INVALID_ARGUMENT);
|
||||
EXPECT_EQ(streamerHandle, nullptr);
|
||||
@@ -72,6 +117,19 @@ TEST_F(MetricStreamerTest, givenValidArgumentsWhenZetMetricStreamerOpenIsCalledT
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -89,6 +147,8 @@ TEST_F(MetricStreamerTest, givenValidArgumentsWhenZetMetricStreamerOpenIsCalledT
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
@@ -147,6 +207,21 @@ TEST_F(MetricStreamerTest, givenRawReportSizeAsZeroWhenZetMetricStreamerOpenIsCa
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -221,6 +296,19 @@ TEST_F(MetricStreamerTest, givenValidArgumentsAndMetricGroupsIsNotActivatedWhenZ
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -238,6 +326,8 @@ TEST_F(MetricStreamerTest, givenValidArgumentsAndMetricGroupsIsNotActivatedWhenZ
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
@@ -250,6 +340,181 @@ TEST_F(MetricStreamerTest, givenValidArgumentsAndMetricGroupsIsNotActivatedWhenZ
|
||||
EXPECT_EQ(streamerHandle, nullptr);
|
||||
}
|
||||
|
||||
TEST_F(MetricStreamerTest, givenInValidOaInformationSymbolNameWhenZetMetricGroupGetIsCalledThenCallSucceedsWithCountZero) {
|
||||
|
||||
zet_device_handle_t metricDeviceHandle = device->toHandle();
|
||||
|
||||
// One api: metric group handle.
|
||||
auto &metricOaSource = (static_cast<DeviceImp *>(device))->getMetricDeviceContext().getMetricSource<OaMetricSourceImp>();
|
||||
Mock<MetricGroup> metricGroup(metricOaSource);
|
||||
|
||||
// Metrics Discovery device.
|
||||
metricsDeviceParams.ConcurrentGroupsCount = 1;
|
||||
|
||||
// Metrics Discovery concurrent group.
|
||||
Mock<IConcurrentGroup_1_5> metricsConcurrentGroup;
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 1;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "Invalid";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
metricsSetParams.ApiMask = MetricsDiscovery::API_TYPE_IOSTREAM;
|
||||
metricsSetParams.MetricsCount = 0;
|
||||
metricsSetParams.SymbolName = "Metric set name";
|
||||
metricsSetParams.ShortName = "Metric set description";
|
||||
metricsSetParams.RawReportSize = 256;
|
||||
|
||||
openMetricsAdapter();
|
||||
setupDefaultMocksForMetricDevice(metricsDevice);
|
||||
|
||||
metricsDevice.getConcurrentGroupResults.push_back(&metricsConcurrentGroup);
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
metricsConcurrentGroup.readIoStreamResult = TCompletionCode::CC_READ_PENDING;
|
||||
|
||||
// Metric group count.
|
||||
uint32_t metricGroupCount = 0;
|
||||
EXPECT_EQ(zetMetricGroupGet(metricDeviceHandle, &metricGroupCount, nullptr), ZE_RESULT_SUCCESS);
|
||||
EXPECT_EQ(metricGroupCount, 0u);
|
||||
}
|
||||
|
||||
TEST_F(MetricStreamerTest, givenInValidInformationElementCountWhenZetMetricGroupGetIsCalledThenCallSucceedsWithCountZero) {
|
||||
|
||||
zet_device_handle_t metricDeviceHandle = device->toHandle();
|
||||
|
||||
// One api: metric group handle.
|
||||
auto &metricOaSource = (static_cast<DeviceImp *>(device))->getMetricDeviceContext().getMetricSource<OaMetricSourceImp>();
|
||||
Mock<MetricGroup> metricGroup(metricOaSource);
|
||||
|
||||
// Metrics Discovery device.
|
||||
metricsDeviceParams.ConcurrentGroupsCount = 1;
|
||||
|
||||
// Metrics Discovery concurrent group.
|
||||
Mock<IConcurrentGroup_1_5> metricsConcurrentGroup;
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
ioReadEquation.getEquationElementsCount = 0u;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 1;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
metricsSetParams.ApiMask = MetricsDiscovery::API_TYPE_IOSTREAM;
|
||||
metricsSetParams.MetricsCount = 0;
|
||||
metricsSetParams.SymbolName = "Metric set name";
|
||||
metricsSetParams.ShortName = "Metric set description";
|
||||
metricsSetParams.RawReportSize = 256;
|
||||
|
||||
openMetricsAdapter();
|
||||
setupDefaultMocksForMetricDevice(metricsDevice);
|
||||
|
||||
metricsDevice.getConcurrentGroupResults.push_back(&metricsConcurrentGroup);
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
metricsConcurrentGroup.readIoStreamResult = TCompletionCode::CC_READ_PENDING;
|
||||
|
||||
// Metric group count.
|
||||
uint32_t metricGroupCount = 0;
|
||||
EXPECT_EQ(zetMetricGroupGet(metricDeviceHandle, &metricGroupCount, nullptr), ZE_RESULT_SUCCESS);
|
||||
EXPECT_EQ(metricGroupCount, 0u);
|
||||
}
|
||||
|
||||
TEST_F(MetricStreamerTest, givenInValidInformationElementTypeWhenZetMetricGroupGetIsCalledThenCallSucceedsWithCountZero) {
|
||||
|
||||
zet_device_handle_t metricDeviceHandle = device->toHandle();
|
||||
|
||||
// One api: metric group handle.
|
||||
auto &metricOaSource = (static_cast<DeviceImp *>(device))->getMetricDeviceContext().getMetricSource<OaMetricSourceImp>();
|
||||
Mock<MetricGroup> metricGroup(metricOaSource);
|
||||
|
||||
// Metrics Discovery device.
|
||||
metricsDeviceParams.ConcurrentGroupsCount = 1;
|
||||
|
||||
// Metrics Discovery concurrent group.
|
||||
Mock<IConcurrentGroup_1_5> metricsConcurrentGroup;
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_LAST_1_0;
|
||||
ioEquationElement.ImmediateUInt64 = 1;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
metricsSetParams.ApiMask = MetricsDiscovery::API_TYPE_IOSTREAM;
|
||||
metricsSetParams.MetricsCount = 0;
|
||||
metricsSetParams.SymbolName = "Metric set name";
|
||||
metricsSetParams.ShortName = "Metric set description";
|
||||
metricsSetParams.RawReportSize = 256;
|
||||
|
||||
openMetricsAdapter();
|
||||
setupDefaultMocksForMetricDevice(metricsDevice);
|
||||
|
||||
metricsDevice.getConcurrentGroupResults.push_back(&metricsConcurrentGroup);
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
metricsConcurrentGroup.readIoStreamResult = TCompletionCode::CC_READ_PENDING;
|
||||
|
||||
// Metric group count.
|
||||
uint32_t metricGroupCount = 0;
|
||||
EXPECT_EQ(zetMetricGroupGet(metricDeviceHandle, &metricGroupCount, nullptr), ZE_RESULT_SUCCESS);
|
||||
EXPECT_EQ(metricGroupCount, 0u);
|
||||
}
|
||||
|
||||
TEST_F(MetricStreamerTest, givenValidArgumentsWhenZetMetricStreamerOpenIsCalledTwiceThenReturnsObjectInUse) {
|
||||
|
||||
// One api: device handle.
|
||||
@@ -282,6 +547,19 @@ TEST_F(MetricStreamerTest, givenValidArgumentsWhenZetMetricStreamerOpenIsCalledT
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
// Metrics Discovery metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -300,6 +578,8 @@ TEST_F(MetricStreamerTest, givenValidArgumentsWhenZetMetricStreamerOpenIsCalledT
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
@@ -422,6 +702,21 @@ TEST_F(MetricStreamerTest, givenInvalidArgumentsWhenZetMetricStreamerReadDataIsC
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -502,6 +797,7 @@ TEST_F(MetricStreamerTest, givenValidArgumentsWhenZetMetricStreamerReadDataIsCal
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
// Metrics Discovery metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -512,6 +808,18 @@ TEST_F(MetricStreamerTest, givenValidArgumentsWhenZetMetricStreamerReadDataIsCal
|
||||
metricsSetParams.ShortName = "Metric set description";
|
||||
metricsSetParams.RawReportSize = 256;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
openMetricsAdapter();
|
||||
|
||||
setupDefaultMocksForMetricDevice(metricsDevice);
|
||||
@@ -520,8 +828,10 @@ TEST_F(MetricStreamerTest, givenValidArgumentsWhenZetMetricStreamerReadDataIsCal
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metric group count.
|
||||
uint32_t metricGroupCount = 0;
|
||||
@@ -562,6 +872,111 @@ TEST_F(MetricStreamerTest, givenValidArgumentsWhenZetMetricStreamerReadDataIsCal
|
||||
EXPECT_EQ(zetMetricStreamerClose(streamerHandle), ZE_RESULT_SUCCESS);
|
||||
}
|
||||
|
||||
TEST_F(MetricStreamerTest, givenValidArgumentsWhenZetMetricStreamerReadDataIsCalledAndOaBufferOverflowHappensThenDroppedDataIsReturned) {
|
||||
|
||||
// One api: device handle.
|
||||
zet_device_handle_t metricDeviceHandle = device->toHandle();
|
||||
|
||||
// One api: event handle.
|
||||
ze_event_handle_t eventHandle = {};
|
||||
|
||||
// One api: streamer handle.
|
||||
zet_metric_streamer_handle_t streamerHandle = {};
|
||||
zet_metric_streamer_desc_t streamerDesc = {};
|
||||
|
||||
streamerDesc.stype = ZET_STRUCTURE_TYPE_METRIC_STREAMER_DESC;
|
||||
streamerDesc.notifyEveryNReports = 32768;
|
||||
streamerDesc.samplingPeriod = 1000;
|
||||
|
||||
// One api: metric group handle.
|
||||
auto &metricOaSource = (static_cast<DeviceImp *>(device))->getMetricDeviceContext().getMetricSource<OaMetricSourceImp>();
|
||||
Mock<MetricGroup> metricGroup(metricOaSource);
|
||||
zet_metric_group_handle_t metricGroupHandle = metricGroup.toHandle();
|
||||
zet_metric_group_properties_t metricGroupProperties = {ZET_STRUCTURE_TYPE_METRIC_GROUP_PROPERTIES, nullptr};
|
||||
|
||||
// Metrics Discovery device.
|
||||
metricsDeviceParams.ConcurrentGroupsCount = 1;
|
||||
|
||||
// Metrics Discovery concurrent group.
|
||||
Mock<IConcurrentGroup_1_5> metricsConcurrentGroup;
|
||||
TConcurrentGroupParams_1_0 metricsConcurrentGroupParams = {};
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 1;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
metricsSetParams.ApiMask = MetricsDiscovery::API_TYPE_IOSTREAM;
|
||||
metricsSetParams.MetricsCount = 0;
|
||||
metricsSetParams.SymbolName = "Metric set name";
|
||||
metricsSetParams.ShortName = "Metric set description";
|
||||
metricsSetParams.RawReportSize = 256;
|
||||
|
||||
openMetricsAdapter();
|
||||
setupDefaultMocksForMetricDevice(metricsDevice);
|
||||
|
||||
metricsDevice.getConcurrentGroupResults.push_back(&metricsConcurrentGroup);
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
metricsConcurrentGroup.readIoStreamResult = TCompletionCode::CC_READ_PENDING;
|
||||
|
||||
// Metric group count.
|
||||
uint32_t metricGroupCount = 0;
|
||||
EXPECT_EQ(zetMetricGroupGet(metricDeviceHandle, &metricGroupCount, nullptr), ZE_RESULT_SUCCESS);
|
||||
EXPECT_EQ(metricGroupCount, 1u);
|
||||
|
||||
// Metric group handle.
|
||||
EXPECT_EQ(zetMetricGroupGet(metricDeviceHandle, &metricGroupCount, &metricGroupHandle), ZE_RESULT_SUCCESS);
|
||||
EXPECT_EQ(metricGroupCount, 1u);
|
||||
EXPECT_NE(metricGroupHandle, nullptr);
|
||||
|
||||
// Metric group properties.
|
||||
EXPECT_EQ(zetMetricGroupGetProperties(metricGroupHandle, &metricGroupProperties), ZE_RESULT_SUCCESS);
|
||||
EXPECT_EQ(metricGroupProperties.domain, 0u);
|
||||
EXPECT_EQ(metricGroupProperties.samplingType, ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_TIME_BASED);
|
||||
EXPECT_EQ(metricGroupProperties.metricCount, metricsSetParams.MetricsCount);
|
||||
EXPECT_EQ(strcmp(metricGroupProperties.description, metricsSetParams.ShortName), 0);
|
||||
EXPECT_EQ(strcmp(metricGroupProperties.name, metricsSetParams.SymbolName), 0);
|
||||
|
||||
// Metric group activation.
|
||||
EXPECT_EQ(zetContextActivateMetricGroups(context->toHandle(), metricDeviceHandle, 1, &metricGroupHandle), ZE_RESULT_SUCCESS);
|
||||
|
||||
// Metric streamer open.
|
||||
EXPECT_EQ(zetMetricStreamerOpen(context->toHandle(), metricDeviceHandle, metricGroupHandle, &streamerDesc, eventHandle, &streamerHandle), ZE_RESULT_SUCCESS);
|
||||
EXPECT_NE(streamerHandle, nullptr);
|
||||
|
||||
// Metric streamer: get desired raw data size.
|
||||
size_t rawSize = 0;
|
||||
uint32_t reportCount = 256;
|
||||
EXPECT_EQ(zetMetricStreamerReadData(streamerHandle, reportCount, &rawSize, nullptr), ZE_RESULT_SUCCESS);
|
||||
|
||||
// Metric streamer: read the data.
|
||||
std::vector<uint8_t> rawData;
|
||||
rawData.resize(rawSize);
|
||||
EXPECT_EQ(zetMetricStreamerReadData(streamerHandle, reportCount, &rawSize, rawData.data()), ZE_RESULT_WARNING_DROPPED_DATA);
|
||||
|
||||
// Metric streamer close.
|
||||
EXPECT_EQ(zetMetricStreamerClose(streamerHandle), ZE_RESULT_SUCCESS);
|
||||
}
|
||||
|
||||
TEST_F(MetricStreamerTest, givenValidArgumentsWhenZetMetricStreamerReadDataIsCalledWithMaxReportCountOverTheSupportedThenReturnsSuccess) {
|
||||
|
||||
zet_device_handle_t metricDeviceHandle = device->toHandle();
|
||||
@@ -582,6 +997,7 @@ TEST_F(MetricStreamerTest, givenValidArgumentsWhenZetMetricStreamerReadDataIsCal
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -591,6 +1007,18 @@ TEST_F(MetricStreamerTest, givenValidArgumentsWhenZetMetricStreamerReadDataIsCal
|
||||
metricsSetParams.ShortName = "Metric set description";
|
||||
metricsSetParams.RawReportSize = 256;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
openMetricsAdapter();
|
||||
|
||||
setupDefaultMocksForMetricDevice(metricsDevice);
|
||||
@@ -599,8 +1027,10 @@ TEST_F(MetricStreamerTest, givenValidArgumentsWhenZetMetricStreamerReadDataIsCal
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
uint32_t metricGroupCount = 0;
|
||||
EXPECT_EQ(zetMetricGroupGet(metricDeviceHandle, &metricGroupCount, nullptr), ZE_RESULT_SUCCESS);
|
||||
@@ -666,6 +1096,21 @@ TEST_F(MetricStreamerTest, givenInvalidArgumentsWhenZetCommandListAppendMetricSt
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -751,6 +1196,19 @@ TEST_F(MetricStreamerTest, givenValidArgumentsWhenZetCommandListAppendMetricStre
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
// Metrics Discovery metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -783,6 +1241,8 @@ TEST_F(MetricStreamerTest, givenValidArgumentsWhenZetCommandListAppendMetricStre
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
@@ -853,6 +1313,19 @@ TEST_F(MetricStreamerTest, givenMultipleMarkerInsertionsWhenZetCommandListAppend
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
// Metrics Discovery metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
@@ -883,6 +1356,8 @@ TEST_F(MetricStreamerTest, givenMultipleMarkerInsertionsWhenZetCommandListAppend
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
* Copyright (C) 2021-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -43,6 +43,19 @@ TEST_F(MetricStreamerMultiDeviceTest, givenInvalidMetricGroupTypeWhenZetMetricSt
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -60,6 +73,8 @@ TEST_F(MetricStreamerMultiDeviceTest, givenInvalidMetricGroupTypeWhenZetMetricSt
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
@@ -106,6 +121,19 @@ TEST_F(MetricStreamerMultiDeviceTest, givenValidArgumentsWhenZetMetricStreamerOp
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -123,6 +151,8 @@ TEST_F(MetricStreamerMultiDeviceTest, givenValidArgumentsWhenZetMetricStreamerOp
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
@@ -178,6 +208,19 @@ TEST_F(MetricStreamerMultiDeviceTest, givenEnableWalkerPartitionIsOnWhenZetMetri
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -198,6 +241,8 @@ TEST_F(MetricStreamerMultiDeviceTest, givenEnableWalkerPartitionIsOnWhenZetMetri
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
@@ -249,6 +294,21 @@ TEST_F(MetricStreamerMultiDeviceTest, givenValidArgumentsWhenZetMetricStreamerOp
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -305,6 +365,19 @@ TEST_F(MetricStreamerMultiDeviceTest, givenValidArgumentsAndCloseIoStreamFailsWh
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -322,6 +395,8 @@ TEST_F(MetricStreamerMultiDeviceTest, givenValidArgumentsAndCloseIoStreamFailsWh
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
@@ -387,6 +462,19 @@ TEST_F(MetricStreamerMultiDeviceTest, givenValidArgumentsWhenZetMetricStreamerOp
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -404,6 +492,8 @@ TEST_F(MetricStreamerMultiDeviceTest, givenValidArgumentsWhenZetMetricStreamerOp
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
@@ -461,6 +551,7 @@ TEST_F(MetricStreamerMultiDeviceTest, givenValidArgumentsWhenZetMetricStreamerRe
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -470,6 +561,18 @@ TEST_F(MetricStreamerMultiDeviceTest, givenValidArgumentsWhenZetMetricStreamerRe
|
||||
metricsSetParams.ShortName = "Metric set description";
|
||||
metricsSetParams.RawReportSize = 256;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
openMetricsAdapter();
|
||||
|
||||
setupDefaultMocksForMetricDevice(metricsDevice);
|
||||
@@ -478,8 +581,10 @@ TEST_F(MetricStreamerMultiDeviceTest, givenValidArgumentsWhenZetMetricStreamerRe
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsConcurrentGroup.readIoStreamOutReportsCount.push_back(20);
|
||||
metricsConcurrentGroup.readIoStreamOutReportsCount.push_back(10);
|
||||
@@ -553,6 +658,19 @@ TEST_F(MetricStreamerMultiDeviceTest, givenValidArgumentsWhenZetMetricStreamerRe
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -570,6 +688,8 @@ TEST_F(MetricStreamerMultiDeviceTest, givenValidArgumentsWhenZetMetricStreamerRe
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
@@ -625,6 +745,19 @@ TEST_F(MetricStreamerMultiDeviceTest, givenMultipleMarkerInsertionsWhenZetComman
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -654,6 +787,8 @@ TEST_F(MetricStreamerMultiDeviceTest, givenMultipleMarkerInsertionsWhenZetComman
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
* Copyright (C) 2021-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -48,6 +48,19 @@ TEST_F(MetricStreamerMultiDeviceTest, givenEnableWalkerPartitionIsOnWhenZetComma
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -77,6 +90,8 @@ TEST_F(MetricStreamerMultiDeviceTest, givenEnableWalkerPartitionIsOnWhenZetComma
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
@@ -127,6 +142,7 @@ TEST_F(MetricStreamerMultiDeviceTest, givenValidArgumentsWhenZetMetricGroupCalcu
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -136,6 +152,18 @@ TEST_F(MetricStreamerMultiDeviceTest, givenValidArgumentsWhenZetMetricGroupCalcu
|
||||
metricsSetParams.RawReportSize = 256;
|
||||
metricsSetParams.MetricsCount = 11;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<IMetric_1_0> metric;
|
||||
MetricsDiscovery::TMetricParams_1_0 metricParams = {};
|
||||
|
||||
@@ -149,12 +177,14 @@ TEST_F(MetricStreamerMultiDeviceTest, givenValidArgumentsWhenZetMetricGroupCalcu
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
metricsSet.GetMetricResult = &metric;
|
||||
metricsSet.calculateMetricsOutReportCount = &returnedMetricCount;
|
||||
|
||||
metric.GetParamsResult = &metricParams;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
uint32_t metricGroupCount = 0;
|
||||
EXPECT_EQ(zetMetricGroupGet(metricDeviceHandle, &metricGroupCount, nullptr), ZE_RESULT_SUCCESS);
|
||||
@@ -214,6 +244,19 @@ TEST_F(MetricStreamerTest, givenRawReportSizeIsNotAlignedToOaBufferSizeWhenZetMe
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
MetricsDiscovery::TMetricSetParams_1_4 metricsSetParams = {};
|
||||
@@ -233,6 +276,8 @@ TEST_F(MetricStreamerTest, givenRawReportSizeIsNotAlignedToOaBufferSizeWhenZetMe
|
||||
|
||||
metricsConcurrentGroup.GetParamsResult = &metricsConcurrentGroupParams;
|
||||
metricsConcurrentGroup.getMetricSetResult = &metricsSet;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
metricsSet.GetParamsResult = &metricsSetParams;
|
||||
|
||||
|
||||
@@ -30,6 +30,21 @@ TEST_F(MetricEnumerationProgrammableTest, whenProgrammableApisAreCalledUnsupport
|
||||
metricsConcurrentGroupParams.MetricSetsCount = 1;
|
||||
metricsConcurrentGroupParams.SymbolName = "OA";
|
||||
metricsConcurrentGroupParams.Description = "OA description";
|
||||
metricsConcurrentGroupParams.IoMeasurementInformationCount = 1;
|
||||
|
||||
Mock<MetricsDiscovery::IEquation_1_0> ioReadEquation;
|
||||
MetricsDiscovery::TEquationElement_1_0 ioEquationElement = {};
|
||||
ioEquationElement.Type = MetricsDiscovery::EQUATION_ELEM_IMM_UINT64;
|
||||
ioEquationElement.ImmediateUInt64 = 0;
|
||||
|
||||
ioReadEquation.getEquationElement.push_back(&ioEquationElement);
|
||||
|
||||
Mock<MetricsDiscovery::IInformation_1_0> ioMeasurement;
|
||||
MetricsDiscovery::TInformationParams_1_0 oaInformation = {};
|
||||
oaInformation.SymbolName = "BufferOverflow";
|
||||
oaInformation.IoReadEquation = &ioReadEquation;
|
||||
metricsConcurrentGroup.GetIoMeasurementInformationResult = &ioMeasurement;
|
||||
ioMeasurement.GetParamsResult = &oaInformation;
|
||||
|
||||
// Metrics Discovery:: metric set.
|
||||
Mock<MetricsDiscovery::IMetricSet_1_5> metricsSet;
|
||||
|
||||
Reference in New Issue
Block a user