gdb/amd-dbgapi-target: add trap-on-entry support - #219
Conversation
|
Corresponding dbgapi PR : ROCm/rocm-systems#8762 |
|
@sebdar Is there a ticket tracking this work? If so, it would be nice to add it to the PR/commit. |
30b0af2 to
3a8e4e5
Compare
|
Thanks for the review @aktemur . In the last push :
|
3a8e4e5 to
2506a8c
Compare
d6849ff to
ceee9db
Compare
lancesix
left a comment
There was a problem hiding this comment.
Documentation is missing.
Other bits and bobs comments below.
| # Not every architecture supports trap-on-entry. Request the feature before | ||
| # the process starts, then let the process attach apply it and report through | ||
| # "show" whether it actually became effective. | ||
| set trap_on_entry_supported false |
There was a problem hiding this comment.
nit: I think I would make supports_trap_on_entry a function which can be called, rather than inlining it. But this is mostly a me thing.
| static void | ||
| set_process_trap_on_entry (amd_dbgapi_inferior_info &info) | ||
| { | ||
| #if AMD_DBGAPI_VERSION_MAJOR > 0 || AMD_DBGAPI_VERSION_MINOR >= 81 |
There was a problem hiding this comment.
Ideally, we might want to have a configure test checking if AMD_DBGAPI_WAVE_LAUNCH_TRAP_ON_ENTRY_ENABLED is defined for example, and set a AMD_DBGAPI_SUPPORTS_TRAP_ON_ENTRY. This would remove some ordering issues, as we have quite a few dbgapi things in the pipeline comming, ordering might not guarantee that this feature will be 0.81.
ceee9db to
539883b
Compare
|
In the last push :
|
lancesix
left a comment
There was a problem hiding this comment.
some minor comments, otherwise LGTM.
539883b to
655de73
Compare
|
In the last push :
|
655de73 to
eb00ed3
Compare
This commit introduces interface to the new 'trap-on-entry' feature. Users may
now ask the debugger to halt any new wavefront executing on an AMD GPU using:
(gdb) set amdgpu trap-on-entry on
As soon as the inferior runs a compute workload, control is returned to the
debugger:
Thread 15 "kernel" received signal SIGTRAP, Trace/breakpoint trap.
[Switching to thread 15, lane 0 (AMDGPU Lane 1:2:2:9/0 (0,0,0)[0,0,0])]
kernel () at /home/sdarche/test-dbg/src/app/long_wave.cpp:12
12 __global__ void kernel() {
(gdb)
This feature can be similarly disabled using `set amdgpu trap-on-entry off`.
It is disabled by default.
New testcases are provided in gdb.rocm/trap-on-entry.exp. These testcases
exercise the feature and verify that it disables cleanly.
eb00ed3 to
82392de
Compare
|
New PR is ROCm/rocm-systems#9925. Pre-commit seems unhappy about whitespaces. |
Motivation
This commit introduces interface to the new 'trap-on-entry' feature. Users may now ask the debugger to halt any new wavefront executing on an AMD GPU using:
(gdb) set amdgpu trap-on-entry on
As soon as the inferior runs a compute workload, control is returned to the debugger:
This feature can be similarly disabled using
set amdgpu trap-on-entry off. It is disabled by default.Tracking
JIRA ID : AIROCGDB-647
Test Plan
New testcases are provided in gdb.rocm/trap-on-entry.exp. These testcases exercise the feature and verify that it disables cleanly.
Test Result
Tests should pass with the new dbgapi. They are unsupported for version < 0.81.
Submission Checklist