Metric Refactor Metric Context

Rename Metric Context and move OA specific functions
and members from Metric Context to OA specific class(MetricSource).
This refactoring is done so that additional Metric Source
like Stall Sampling could be Seamlessly implemented.

Related-To: LOCI-2753


Signed-off-by: Joshua Santosh Ranjan <joshua.santosh.ranjan@intel.com>
This commit is contained in:
Joshua Santosh Ranjan
2022-01-12 08:24:41 +00:00
committed by Compute-Runtime-Automation
parent 27c90ac2d6
commit f1c50a8c89
31 changed files with 697 additions and 527 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -10,6 +10,7 @@
#include "shared/source/os_interface/os_interface.h"
#include "level_zero/tools/source/metrics/metric_enumeration_imp.h"
#include "level_zero/tools/source/metrics/metric_source_oa.h"
#include <sys/stat.h>
#include <sys/sysmacros.h>
@@ -20,7 +21,7 @@ const char *MetricEnumeration::getMetricsDiscoveryFilename() { return "libmd.so.
bool MetricEnumeration::getAdapterId(uint32_t &adapterMajor, uint32_t &adapterMinor) {
auto &device = metricContext.getDevice();
auto &device = metricSource.getMetricDeviceContext().getDevice();
auto &osInterface = device.getOsInterface();
auto drm = osInterface.getDriverModel()->as<NEO::Drm>();
auto drmFile = drm->getFileDescriptor();

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -10,6 +10,7 @@
#include "level_zero/core/source/device/device.h"
#include "level_zero/tools/source/metrics/metric_query_imp.h"
#include "level_zero/tools/source/metrics/metric_source_oa.h"
using namespace MetricsLibraryApi;