Commit Graph

52 Commits

Author SHA1 Message Date
Mateusz Hoppe 8e07dd30cb performance(debugger): optimize ATT handling - minimize mem allocs
- do not allocate state save area every time attention event
is handled
- keep allocated memory for subsequent events
- remove not needed DBEUG_BREAK

Related-To: NEO-8183

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-07-18 08:37:04 +02:00
Mateusz Hoppe 9a53f20e6c performance(debugger): optimize ATT event handling
- check threads with attention state before reading SR_IDENT
- memory read is costly, for threads already in stopped state
there is no need to read sr_ident and check thread state again
- single stepping one thread performance is substantially improved,
by the factor of 6x

Related-To: NEO-8183

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-07-17 10:42:34 +02:00
Mateusz Hoppe 079105a5c2 fix: optimize ATT handling - read state save area once for all threads
- reading state save area for every threads takes too long when all
application threads have completed and there are stale ATT events to
process
- on detach gdb seemed to be frozen waiting for ATT event to be handled
- fix is to read state save area once - and check SIP counter for every
thread in ATT bitmask

Related-To: NEO-7897

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-04-14 10:57:18 +02:00
Mateusz Hoppe e26ebfc51b fix: check exception reason for stopped threads
- before marking interrupt request check exception reason. If there is
exception other than forced exception or forced external halt treat
thread as stopped and generate distinct event for it.

Related-To: NEO-7869

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-04-05 12:01:20 +02:00
Yates, Brandon 0f6140deb0 fix(l0debug): windows topology map should always be created
Topology map was only being created when ZET_ENABLE_PROGAM_DEBUGGING was
set.  This was not correct.  Now it is unconditionally created at init,
and debug attach will fail if it is not valid.

Related-to: LOCI-3937

Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
2023-03-27 16:24:57 +02:00
Filip Hazubski bd6349724b feature(debugger): Increase buffer size used in readAndHandleEvent function
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2023-03-17 15:54:32 +01:00
Warchulski, Jaroslaw 64f735481d Cleanup includes 48
Cleaned up files:
shared/source/command_container/command_encoder.inl
shared/source/os_interface/hw_info_config.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-02-10 17:23:02 +01:00
Warchulski, Jaroslaw a2e6a8284b Cleanup includes 47
Cleaned up files:
level_zero/tools/source/debug/windows/debug_session.h
level_zero/tools/source/sysman/memory/windows/os_memory_imp.h
level_zero/tools/source/sysman/windows/kmd_sys_manager.h
opencl/test/unit_test/aub_tests/command_stream/copy_engine_aub_tests_xehp_and
shared/source/command_container/command_encoder.inl
shared/source/command_stream/command_stream_receiver_hw_xehp_and_later.inl
shared/source/helpers/blit_commands_helper_base.inl
shared/test/unit_test/image/image_surface_state_fixture.h
shared/test/unit_test/os_interface/windows/os_interface_win_tests.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-02-10 17:07:30 +01:00
Kamil Kopryk 524d945e8c refactor: rename l0 hw_helpers dir to gfx_core_helpers
Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2023-02-02 11:15:56 +01:00
Kamil Kopryk eb002acaa1 refactor: rename l0_gfx_core_helper files
Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2023-01-24 12:59:26 +01:00
Warchulski, Jaroslaw bd81b5546d Cleanup includes 25
Cleaned up files:
level_zero/core/source/device/device.h
opencl/source/helpers/dispatch_info.h
shared/source/os_interface/os_interface.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-01-10 12:54:45 +01:00
Warchulski, Jaroslaw f275eea6ec Cleanup includes 14
Cleaned up files:
shared/source/device/device.h

Related-To: NEO-5548

Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2022-12-23 10:46:34 +01:00
Yates, Brandon 43ddabd8e6 L0 Debug - Change interrupt return code to match linux
Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
2022-12-08 09:42:08 +01:00
Yates, Brandon 668149ab81 [L0 Debug] Add additional log messages to gfxmem r/w
Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
2022-12-07 21:08:10 +01:00
Kamil Kopryk 73b2104183 Rename L0HwHelper -> L0GfxCoreHelper
Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2022-12-05 11:26:05 +01:00
Matias Cabral 467119931c Add SIP version check
Make SLM access a single template function

Resolves: NEO-7335

Signed-off-by: Matias Cabral <matias.a.cabral@intel.com>
2022-12-01 00:55:04 +01:00
Igor Venevtsev 271a50d48e L0Debug Win: Fix process hang on exit in L0 debugger tests
Some L0 debug CTSs intentionnally written to exit w/o proper
resource clenup, f.e do not call zetDebugDetach() etc.
On windows it could be the situation when cleanup of DebugSession is
called in context of DllMain(DLL_PROCESS_DETACH).
At this point all threads other then main already terminated by Windows,
see remarks for DLL_PROCESS_DETACH in
https://learn.microsoft.com/en-us/windows/win32/dlls/dllmain
In this case worker thread object still exists, handle and Id are not
null but corresponding Windows thread does not exist any more and
application waits forever for threadFinished variable. We can safely
omit this waiting since join() will either return immediately in case of
thread was killed by Windows or wait until thread is terminated in normal way.

Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
2022-11-18 17:34:11 +01:00
Mateusz Hoppe 5c23d05312 L0Debug - add support for blocking VM BIND on fence
Related-To: NEO-7454

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-11-18 12:00:23 +01:00
Yates, Brandon c95d40ccdd L0 debug- Windows - Add gpuVA to log for r/w gfx mem
Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
2022-11-17 19:08:50 +01:00
Kamil Kopryk 88ed486f6b Move L0HwHelper ownership to RootDeviceEnvironment 3/n
Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>

Use RootDeviceEnvironment getHelper<L0CoreHelper> for
- getAttentionBitmaskForSingleThreads
- getThreadsFromAttentionBitmask
2022-11-15 17:30:15 +01:00
Yates, Brandon 99ef6c499b L0 debug - fix windows bitmask decode
Keep threads created in EU range (0,7)

Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
2022-11-07 14:41:29 +01:00
Igor Venevtsev f47e1306f2 L0Debug: do not set acknowledge flag for MODULE_UNLOAD event
Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
2022-11-07 14:01:29 +01:00
Matias Cabral 0772d32a76 Windows debugger access to SLM
Resolves: NEO-7382

Signed-off-by: Matias Cabral <matias.a.cabral@intel.com>
2022-11-02 10:58:09 +01:00
Yates, Brandon 789a53e8f8 L0 Debug - Don't pollute debug log with event timeouts
Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
2022-10-19 17:26:31 +02:00
Igor Venevtsev 5a0dd8048b L0Debug Win: fix bitmap reading for EU_ATTN_BIT_SET event
Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
2022-10-06 15:41:14 +02:00
Matias Cabral c012034c19 Debugger access to SLM
Resolves: NEO-5998

Signed-off-by: Matias Cabral <matias.a.cabral@intel.com>
2022-09-30 11:31:19 +02:00
Mateusz Hoppe 7ff258fc92 L0Debug - Enable attaching to Root or Subdevices
- enable tile attach mode by default
- both root device and subdevice may be attached to

Related-To: NEO-7347

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-09-26 16:03:54 +02:00
Yates, Brandon 12c7f32679 L0 Win Debugger - implement thread control
Resolves: NEO-6722

Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
2022-09-05 19:26:14 +02:00
Jitendra Sharma 3212a71760 Debugger L0 Win: Attention event handling from UMD
Related-To: NEO-7261

Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
2022-09-02 18:22:41 +02:00
Igor Venevtsev d40173e47a L0Debug Win: Always generate module create/destroy events
We have to always generate module create/destroy events to give
debugger a chance to insert bp, read/write debuggee memory  etc
even there is no debug data was generated. In this case ELF will not be
reported to debugger, just ISA GpuVA

Related-To: NEO-6723

Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
2022-08-24 14:58:30 +02:00
Yates, Brandon dbf955c1f2 L0 win debugger - implement read elf
Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
2022-08-11 16:16:21 +02:00
Igor Venevtsev 4cb9ad5d55 Debugger L0 Win: implement module destroy event
Related-To: NEO-6723

Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
2022-07-28 15:55:40 +02:00
Kamil Kopryk d4d54f5093 Cleanup includes
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2022-07-25 09:58:38 +02:00
Igor Venevtsev d79e799bea Debugger L0 win: implement zetAcknowledgeEvent API
Related-To: NEO-6723

Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
2022-07-22 16:46:27 +02:00
Igor Venevtsev 547dd59272 Debugger L0 Win: Implement CREATE_DEBUG_DATA/MODULE_CREATE events handling
Related-To: NEO-6723

Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
2022-07-20 13:20:50 +02:00
Jitendra Sharma 4a8a93af96 Debugger L0 Win - Generate Proc Entry/Exit events
Related-To: NEO-7117

Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
2022-07-18 12:32:57 +02:00
Mateusz Hoppe bd07b3ec97 L0Debug refactor: Replace ze_device_thread_t with EuThread::ThreadId
- ThreadId is preferred beacuse it uniquely identifies thread and is
not related to device topology

Related-To: NEO-5784

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-07-14 20:01:56 +02:00
Mateusz Hoppe d139d307f0 L0Debug - extract memory access params validation
- remove duplication of code by moving common code
to DebugSessionImp

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-07-13 16:45:37 +02:00
Yates, Brandon 7ccde3fb20 L0 Win Debug - read StateSave and moduleDebug header
Related-to: NEO-7162
Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
2022-07-13 14:33:47 +02:00
Jitendra Sharma c86c518bc4 L0 Debugger Win - read SBA tracking buffer address
MMIO will store SBA tracking buffer address for current context.
This change helps in extracting this address and use to read SBA virtual
register.

Related-To: NEO-6765

Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
2022-06-23 15:02:38 +02:00
Mateusz Hoppe 673bf3b553 Move DebuggerL0 to shared
Related-To: NEO-7075

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-06-23 10:05:45 +02:00
Yates, Brandon 60b88806d5 L0 Windows Debugger - Implement GPU mem read/write
Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
2022-06-23 09:28:47 +02:00
Igor Venevtsev cb6db5672b Debugger L0 Win - register allocations metadata in debugger
Related-To: NEO-6764

Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
2022-06-22 17:22:15 +02:00
Compute-Runtime-Validation c45ddab1c3 Revert "Move DebuggerL0 to shared"
This reverts commit 7eba4db2e7.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2022-06-22 04:38:32 +02:00
Mateusz Hoppe 7eba4db2e7 Move DebuggerL0 to shared
Related-To: NEO-7075

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-06-21 17:10:46 +02:00
Yates, Brandon 481ac32fcf Windows L0 Debugger - Implement async events handling
Add event handlers for context and debug data

Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
2022-06-15 17:48:24 +02:00
Igor Venevtsev dc2e1dfdb0 L0 Debugger Win - add initial event handling
Related-To: NEO-6723

Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
2022-05-31 13:27:06 +02:00
Igor Venevtsev 608a1d39bc L0 debugger Win - code cleanup
- remove unnecessary KmHeaders WA

Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
2022-05-30 12:13:42 +02:00
Igor Venevtsev 8c165a6f41 L0 Debugger Windows - implement debugger attach/detach
Related-To: NEO-6718

Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
2022-05-27 16:25:56 +02:00
Compute-Runtime-Validation daf7829fa2 Revert "L0 Debugger Windows - implement debugger attach/detach"
This reverts commit f45431c173.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2022-05-17 19:02:11 +02:00