mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-24 00:06:09 +00:00
intel_reg_dumper: Also decode registers given by address
One can now give an address instead of a register name to decode a single register. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
2fd80079c0
commit
763d22cbf8
@ -1996,7 +1996,7 @@ find_register_by_name(struct reg_debug *regs, int count,
|
||||
}
|
||||
|
||||
static void
|
||||
decode_register(const char *name, uint32_t val)
|
||||
decode_register_name(const char *name, uint32_t val)
|
||||
{
|
||||
int i;
|
||||
struct reg_debug *reg = NULL;
|
||||
@ -2017,6 +2017,35 @@ decode_register(const char *name, uint32_t val)
|
||||
_intel_dump_reg(reg, val);
|
||||
}
|
||||
|
||||
static void
|
||||
decode_register_address(int address, uint32_t val)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(known_registers); i++) {
|
||||
struct reg_debug *regs = known_registers[i].regs;
|
||||
|
||||
for (j = 0; j < known_registers[i].count; j++)
|
||||
if (regs[j].reg == address)
|
||||
_intel_dump_reg(®s[j], val);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
decode_register(const char *name, uint32_t val)
|
||||
{
|
||||
long int address;
|
||||
char *end;
|
||||
|
||||
address = strtoul(name, &end, 0);
|
||||
|
||||
/* found a register address */
|
||||
if (address && *end == '\0')
|
||||
decode_register_address(address, val);
|
||||
else
|
||||
decode_register_name(name, val);
|
||||
}
|
||||
|
||||
static void
|
||||
intel_dump_other_regs(void)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user