mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-26 23:33:20 +08:00
L0Debug - close debug fd when DebugSession is destroyed
- after last tile DebugSession is detached, root DebugSession must close fd Related-To: NEO-5784 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ca0686b404
commit
aa59ee94b2
@@ -47,6 +47,7 @@ DebugSessionLinux::~DebugSessionLinux() {
|
||||
delete session.first;
|
||||
}
|
||||
tileSessions.resize(0);
|
||||
closeFd();
|
||||
}
|
||||
|
||||
DebugSession *DebugSession::create(const zet_debug_config_t &config, Device *device, ze_result_t &result) {
|
||||
@@ -341,6 +342,21 @@ void DebugSessionLinux::closeAsyncThread() {
|
||||
internalEventThread.close();
|
||||
}
|
||||
|
||||
bool DebugSessionLinux::closeFd() {
|
||||
if (fd == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto res = NEO::SysCalls::close(fd);
|
||||
|
||||
if (res != 0) {
|
||||
PRINT_DEBUGGER_ERROR_LOG("Debug connection close() on fd: %d failed: retCode: %d\n", fd, res);
|
||||
return false;
|
||||
}
|
||||
fd = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
std::unique_ptr<uint64_t[]> DebugSessionLinux::getInternalEvent() {
|
||||
std::unique_ptr<uint64_t[]> eventMemory;
|
||||
|
||||
@@ -427,18 +443,8 @@ void DebugSessionLinux::readInternalEventsAsync() {
|
||||
|
||||
bool DebugSessionLinux::closeConnection() {
|
||||
closeAsyncThread();
|
||||
internalEventThread.close();
|
||||
if (fd == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto res = NEO::SysCalls::close(fd);
|
||||
|
||||
if (res != 0) {
|
||||
PRINT_DEBUGGER_ERROR_LOG("Debug connection close() on fd: %d failed: retCode: %d\n", fd, res);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
closeInternalEventsThread();
|
||||
return closeFd();
|
||||
}
|
||||
|
||||
void DebugSessionLinux::handleEvent(prelim_drm_i915_debug_event *event) {
|
||||
|
||||
Reference in New Issue
Block a user