Implements the "maintenance info amdgpu address-aliases" command - #225
Implements the "maintenance info amdgpu address-aliases" command#225czidev-amd wants to merge 1 commit into
Conversation
3d2d94b to
d234a73
Compare
dbe0775 to
1432895
Compare
czidev-amd
left a comment
There was a problem hiding this comment.
Thank you @lumachad for your review, I have reworked a bit this PR to include your comments. One observation is the renaming of the tests to match other "maint" tests naming pattern. Also, I have relaxed the test as I cannot really guarantee the same output across different architectures. Now, the tests is testing if gdb implementation is sane rather than gdbabi output sanity.
1432895 to
2f1c254
Compare
|
I have spined a new version including Pedro's and Lancelot's inputs. |
| /* Not a real alias, NULL just maps to NULL in every | ||
| space. */ | ||
| if (src_is_null_address) | ||
| ui_out->field_string ("valid", "<null>"); |
There was a problem hiding this comment.
IMHO it wouldn't be wrong to print 0 here.
There was a problem hiding this comment.
I can do that, let's see if anyone else has a different idea.
| Some address spaces are private to a wave or a lane of a wave, and | ||
| @value{GDBN} converts using whichever wave and lane are currently | ||
| selected. Not every address is reachable from every space: if it isn't, | ||
| the row for that space reads @samp{<not reachable>}. |
There was a problem hiding this comment.
One nit, I think that we do an LDS -> global conversion, but this is only valid (ish) while the wave is stopped. As soon as we resume, this address is not valid anymore. Not sure if this should be described, or maybe this is just a dbgapi bug we should address.
2f1c254 to
9b0c0d2
Compare
9b0c0d2 to
ec37ff2
Compare
It can sometimes be useful to be able to convert address from an
address space to another one (if such conversion is possible). This
patch proposes to add a maintenance command which shows for a given
address (in any address space) the aliasing addresses in other address
spaces. It also shows the number of consecutive bytes this conversion
is valid for.
Here are example outputs on this new command:
(gdb) maintenance info amdgpu address-aliases &idx
Address space Address Valid for
global 0x7ff7f4600c00 0x4
generic generic#0x2000000000030 0x3d0
private_wave private_wave#0xc00 0x4
private_lane private_lane#0x30 0x3d0
local <not reachable> 0x0
(gdb) maintenance info amdgpu address-aliases gidx_p
Address space Address Valid for
global <not reachable> 0x0
generic generic#0x1000000000000 0x200
private_wave <not reachable> 0x0
private_lane <not reachable> 0x0
local local#0x0 0x100000000
Tested on x86_64-linux + gfx942.
Change-Id: I9d118f208589c3db6a2ec966ac221b1a54d0ccb6
Co-authored-by: Claudiu Zissulescu-Ianculescu <claudiu.zissulescu-ianculescu@amd.com>
ec37ff2 to
866d8c3
Compare
Motivation
Given an expression that evaluates to an address in some address space, show for each address space supported by the current AMDGPU architecture the aliasing address in that space, if any, along with the number of consecutive bytes for which the aliasing is valid.
This is purely a diagnostic aid: it queries amd_dbgapi_convert_address_space for every address space known to the architecture and reports "" for the ones the given address does not alias into.
Test Plan
New
show_address_aliases.exptest added.