mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
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:
committed by
Compute-Runtime-Automation
parent
3ebcb30244
commit
6968d26f3a
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user