Sysman: Add support for sysman APIs

In level_zero/sysman directory This change:
- Adds support for accessing linux based filesystem
- Add support for telemetry
- Add support for LinuxSysmanImp

Related-To: LOCI-3889
Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
This commit is contained in:
Jitendra Sharma
2023-02-14 15:03:52 +00:00
committed by Compute-Runtime-Automation
parent 3ebcb30244
commit 6968d26f3a
41 changed files with 2652 additions and 45 deletions

View File

@@ -102,6 +102,7 @@ class Drm : public DriverModel {
MOCKABLE_VIRTUAL void checkPreemptionSupport();
inline int getFileDescriptor() const { return hwDeviceId->getFileDescriptor(); }
inline void closeFileDescriptor() const { return hwDeviceId->closeFileDescriptor(); }
ADAPTER_BDF getAdapterBDF() const {
return adapterBDF;
}

View File

@@ -21,10 +21,11 @@ class HwDeviceIdDrm : public HwDeviceId {
fileDescriptor(fileDescriptorIn), pciPath(pciPathIn) {}
~HwDeviceIdDrm() override;
int getFileDescriptor() const { return fileDescriptor; }
void closeFileDescriptor();
const char *getPciPath() const { return pciPath.c_str(); }
protected:
const int fileDescriptor;
int fileDescriptor;
const std::string pciPath;
};
} // namespace NEO

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -10,8 +10,15 @@
namespace NEO {
void HwDeviceIdDrm::closeFileDescriptor() {
if (fileDescriptor > 0) {
SysCalls::close(fileDescriptor);
fileDescriptor = -1;
}
}
HwDeviceIdDrm::~HwDeviceIdDrm() {
SysCalls::close(fileDescriptor);
closeFileDescriptor();
}
} // namespace NEO

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -31,5 +31,6 @@ int munmap(void *addr, size_t size);
ssize_t read(int fd, void *buf, size_t count);
int fcntl(int fd, int cmd);
int fcntl(int fd, int cmd, int arg);
char *realpath(const char *path, char *buf);
} // namespace SysCalls
} // namespace NEO

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -100,5 +100,9 @@ int fcntl(int fd, int cmd, int arg) {
return ::fcntl(fd, cmd, arg);
}
char *realpath(const char *path, char *buf) {
return ::realpath(path, buf);
}
} // namespace SysCalls
} // namespace NEO