mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 16:45:25 +08:00
sysman: add diagnostics boilerplate code
Signed-off-by: Vilvaraj, T J Vivek <t.j.vivek.vilvaraj@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d264dc858f
commit
457d05420d
49
level_zero/tools/source/sysman/diagnostics/diagnostics.h
Normal file
49
level_zero/tools/source/sysman/diagnostics/diagnostics.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <level_zero/zes_api.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct _zes_diag_handle_t {
|
||||
virtual ~_zes_diag_handle_t() = default;
|
||||
};
|
||||
|
||||
namespace L0 {
|
||||
|
||||
struct OsSysman;
|
||||
|
||||
class Diagnostics : _zes_diag_handle_t {
|
||||
public:
|
||||
virtual ~Diagnostics() {}
|
||||
virtual ze_result_t diagnosticsGetProperties(zes_diag_properties_t *pProperties) = 0;
|
||||
inline zes_diag_handle_t toHandle() { return this; }
|
||||
|
||||
static Diagnostics *fromHandle(zes_diag_handle_t handle) {
|
||||
return static_cast<Diagnostics *>(handle);
|
||||
}
|
||||
bool isDiagnosticsEnabled = false;
|
||||
};
|
||||
|
||||
struct DiagnosticsHandleContext {
|
||||
DiagnosticsHandleContext(OsSysman *pOsSysman) : pOsSysman(pOsSysman){};
|
||||
~DiagnosticsHandleContext();
|
||||
|
||||
void init();
|
||||
|
||||
ze_result_t diagnosticsGet(uint32_t *pCount, zes_diag_handle_t *phDiagnostics);
|
||||
|
||||
OsSysman *pOsSysman = nullptr;
|
||||
std::vector<Diagnostics *> handleList = {};
|
||||
|
||||
private:
|
||||
void createHandle();
|
||||
};
|
||||
|
||||
} // namespace L0
|
||||
Reference in New Issue
Block a user