Skip to content

Commit 7bc4b57

Browse files
committed
zetSysmanDeviceGetProperties report unknown driver version
Sysman API for device properties will report unknown driver version to avoid spawning new process in the system Change-Id: I4edde9d9670773e339125c71bae6947575789a19 Signed-off-by: Matias Cabral <[email protected]>
1 parent 7fd9118 commit 7bc4b57

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

level_zero/tools/source/sysman/sysman_device/linux/os_sysman_device_imp.cpp

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -109,27 +109,8 @@ void LinuxSysmanDeviceImp::getVendorName(int8_t (&vendorName)[ZET_STRING_PROPERT
109109
}
110110

111111
void LinuxSysmanDeviceImp::getDriverVersion(int8_t (&driverVersion)[ZET_STRING_PROPERTY_SIZE]) {
112-
std::string output, command, strVal, driver;
113-
//First get the driver name
114-
ze_result_t result = pSysfsAccess->readSymLink(driverFile, strVal);
115-
if (ZE_RESULT_SUCCESS != result) {
116-
std::copy(unknown.begin(), unknown.end(), driverVersion);
117-
driverVersion[unknown.size()] = '\0';
118-
return;
119-
}
120-
const auto loc = strVal.find_last_of('/');
121-
driver = strVal.substr(loc + 1);
122-
//create the command like: modinfo -F vermagic i915
123-
command = "modinfo -F vermagic " + driver;
124-
result = pLinuxSysmanImp->systemCmd(command, output);
125-
if (ZE_RESULT_SUCCESS != result) {
126-
std::copy(unknown.begin(), unknown.end(), driverVersion);
127-
driverVersion[unknown.size()] = '\0';
128-
return;
129-
}
130-
131-
//After below copy Not appending null in driverVersion, as output is null terminated
132-
std::copy(output.begin(), output.end(), driverVersion);
112+
std::copy(unknown.begin(), unknown.end(), driverVersion);
113+
driverVersion[unknown.size()] = '\0';
133114
}
134115

135116
LinuxSysmanDeviceImp::LinuxSysmanDeviceImp(OsSysman *pOsSysman) {

0 commit comments

Comments
 (0)