Commit Graph

92 Commits

Author SHA1 Message Date
Brandon Yates fd48de3da9 feature(debugger): Add initial Xe debugger skeleton
sync xe_drm.h for debugger to 1d2144ed from
https://gitlab.freedesktop.org/miku/kernel/-/tree/eudebug-dev

Related-to: NEO-8402

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-11-07 17:36:18 +01:00
Brandon Yates 157d7a327a feature(debugger): Create DebugSessionLinux class
DebugSessionLinux is common base class for all linux dbgUMD
implementations. This patch also moves DrmHelper to common debug folder

Related-to: NEO-8404

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-10-24 21:22:44 +02:00
Brandon Yates 85d35d5239 feature(debugger): use linux driver type to create correct debug session imp
Related-to: NEO-8403

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-10-23 10:25:28 +02:00
Mateusz Jablonski 420f273a6c fix: don't wait on condition in unit tests
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-10-10 15:14:30 +02:00
Brandon Yates 3fbce47182 refactor(debugger): Rename DebugSessionLinux
Rename to DebugSessionLinuxi915 in preparation
for implementation of Xe debugger

Related-to: NEO-8404

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-10-09 10:12:47 +02:00
Mateusz Jablonski 95eb5df978 refactor: use reference in for-range loops
Related-To: NEO-9038
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-10-04 15:32:26 +02:00
Mateusz Jablonski 895a586083 refactor: use reference in for-range loops
Related-To: NEO-9038
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-10-03 18:56:53 +02:00
Brandon Yates 253e1df43b feature(debugger): Filter page fault threads by start IP
When a thread is stopped due to potential page fault
we must check AIP against start IP to ensure it is not
a newly started thread accidentally caught by PF algorithm

Related-to: NEO-8617

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-09-29 12:45:32 +02:00
Brandon Yates 7c1f5585d7 feature(debugger): online page fault event handling
Sync to
https://github.com/intel-gpu/drm-uapi-helper/releases/tag/v2.0-rc20

Related-to: LOCI-2052

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-09-18 00:15:45 +02:00
Brandon Yates 513045bd90 fix(debugger): auto-ack vmbind on tile for module from other tiles
Related-to: NEO-8371

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-09-14 15:33:58 +02:00
Compute-Runtime-Validation e61c5af7ec Revert "feature(debugger): online page fault event handling"
This reverts commit 0c6444aab7.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-08-24 08:16:45 +02:00
Brandon Yates 0c6444aab7 feature(debugger): online page fault event handling
Related-to: LOCI-2052

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-08-23 18:29:58 +02:00
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 6205cca038 fix(debugger): require immediate binding for Module's allocations
- all bos from Module must have requireImmediateBinding
flag set
- this change fixes hang in debugger - where MODULE LOAD event
was not sent

Resolves: NEO-8121

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-07-06 17:34:22 +02:00
Mateusz Hoppe c4f36a6808 fix(debugger): ack pending events before closing session
- ack module / isa vm bind events before close(fd)

Related-To: NEO-7960

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-05-11 17:21:23 +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 d1393e08d3 refactor: remove debug break when EU CONTROL ioctl fails
- when no threads are executing, interrupt all may fail and debug break
fires - although error is handled and correct event is returned. To
prevent abort, debug break has to be removed

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-04-05 13:07:31 +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
Mateusz Hoppe f2275caf3a performance: L0 debug - improve single-step time
- check threads with ATT only when more than one thread is resumed
- if single thread is resumed - check only that thread
- delay thread state check - allowing thread to reenter SIP

Related-To: NEO-7750

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-03-15 09:48:35 +01:00
Mateusz Hoppe caecbb12f0 fix: Add ATT scan after interrupt in handling ATT event
- make sure to capture all threads after interrupt, also those that
could be lagging to enter SIP

Related-To: NEO-7776

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-03-07 11:53:25 +01:00
Mateusz Hoppe e8b4841577 perf(debugger): Optimize single-stepping of eu threads
Single-stepping threads is based on resume() and THREAD_STOPPED events
To speed up single-stepping, stopped threads must be discovered
immediately after resume() is called.
This change is adding ATT scan and event generation in resume()

Related-To: NEO-7750

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-02-23 11:06:13 +01:00
Warchulski, Jaroslaw b224ec947e Cleanup includes 50
Cleaned up files:
shared/source/helpers/hw_info.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-02-10 20:26:13 +01:00
Kamil Kopryk d8d1b7f331 Initialize status variable
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2023-02-10 11:01:47 +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 11764dd9bf Cleanup includes 40
Cleaned up files:
shared/source/os_interface/linux/drm_neo.h
shared/source/os_interface/windows/wddm/um_km_data_translator.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-01-23 16:19:35 +01:00
Mateusz Hoppe f30e66d950 fix: add SLM support for tile attach
Resolves: NEO-7650

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-01-20 16:11:36 +01:00
Filip Hazubski 2ed2ac73d1 refactor: correct ioctl and related functions to return signed int
Change IoctlHelper::ioctl function to return int.
Change IoctlHelper::createGemExt function to return int.
Change IoctlHelper::queryDistances function to return int.
Change UuidRegisterResult::retVal type to int32_t.
Rename res to ret in debug_session.cpp for consistency.

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2023-01-19 22:04:27 +01:00
Mateusz Hoppe 23b1f74615 fix: L0 debug - use correct condition variable to wait for event
- getInternalEvent() should wait on cv that is notified when new event is
read
- this change speeds up application execution under debugger
- refactor unit tests - do not start async thread in ults when not
needed , use synchronous read mode instead

Related-To: NEO-7641

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-01-18 11:55:32 +01:00
Mateusz Jablonski 43b790957d style: format code using clang-format 15.0.6
Related-To: NEO-7500
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-01-05 10:33:47 +01:00
Mateusz Hoppe ee499d689b fix(zebin): fix module load/unload events while debugging
- do not trigger incorrect / spurious events from internal modules
for debugger
- do not register Elf for internal modules

Related-To: NEO-7605

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-01-04 19:12:30 +01:00
Warchulski, Jaroslaw 0eac749fcc Cleanup includes 19
Cleaned up files:
opencl/source/api/cl_types.h
shared/source/compiler_interface/external_functions.h
shared/source/compiler_interface/linker.h
shared/source/device_binary_format/elf/elf.h
shared/source/helpers/preamble.h
shared/source/memory_manager/definitions/storage_info.h
shared/source/memory_manager/memory_manager.h
shared/source/memory_manager/os_agnostic_memory_manager.h
shared/source/program/program_info.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-01-03 11:02:05 +01:00
Mateusz Jablonski 575f0f8b92 refactor: Stop using global gfx core helper getter in L0
Related-To: NEO-6853
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-01-02 14:15:53 +01:00
Warchulski, Jaroslaw 7ae44268cb Cleanup includes 17
Cleaned up files:
shared/source/built_ins/sip.h
shared/source/compiler_interface/compiler_cache.h
shared/source/compiler_interface/compiler_interface.h
shared/source/device_binary_format/device_binary_formats.h
shared/source/helpers/timestamp_packet.h
shared/source/kernel/debug_data.h
shared/source/utilities/tag_allocator.h
shared/test/common/mocks/mock_device.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-01-02 10:59:08 +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
Mateusz Hoppe 6f710bfad7 L0Debug - disallow attaching to multiple pids
Resolves: NEO-7476

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-11-03 19:21:53 +01:00
Warchulski, Jaroslaw 90bc1a69d2 L0Debug - wait for the thread to start
Related-To: NEO-7322
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2022-10-20 10:44:16 +02:00
Mateusz Hoppe 95505d87a5 L0Debug - fix interrupt
- pass deviceIndex based on deviceBitfield
- do not call ioctl again on EBUSY error

Resolves: NEO-7414

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-10-14 13:56:57 +02:00
Yates, Brandon 44894c1fdf L0 Debug- Create generic topologyMap interface
Move Linux DebugSession thread conversion functions up to
DebugSessionImp to allow reuse in windows implementation

Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
2022-10-13 15:12:05 +02:00
Matias Cabral 56109b882f Support debugger SLM write
Resolves: NEO-5998

Signed-off-by: Matias Cabral <matias.a.cabral@intel.com>
2022-10-11 16:37:14 +02:00
Mateusz Hoppe e9a7c990ef L0Debug - log deviceBitfield for ISA event
- enhancement to logging

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-10-05 11:44:44 +02:00
Mateusz Hoppe ec4d0dd0a6 L0Debug - ignore unknown VM BIND events - do not push to pending
Related-To: NEO-7366

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-09-30 13:31:30 +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 6811b1079f L0Debug - support for out of order debug events
Related-To: NEO-7366
- if VM BIND comes with VM that cannot be mapped to tile,
push the event to pending events and process next events
until context params event with comes
- when pending event is handled - remove it from queue

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-09-30 11:26:24 +02:00
Mateusz Hoppe 7e2e940d6e L0Debug - zebin modules support for mirrored isa heaps
- all tileInstanced ISAs must be received before sending
MODULE LOAD/UNLOAD events for zebin modules

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-09-28 10:53:51 +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