All of lore.kernel.org
 help / color / mirror / Atom feed
From: Edward O'Callaghan <funfunctor-dczkZgxz+BNUPWh3PAxdjQ@public.gmane.org>
To: Tom St Denis <tstdenis82-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Tom St Denis <tom.stdenis-5C7GfCeVMHo@public.gmane.org>
Subject: Re: [PATCH umr] Add program memory dump to wave status.
Date: Sat, 25 Mar 2017 00:00:01 +1100	[thread overview]
Message-ID: <a9059ebe-a562-e30d-e12b-9bfb7d78320c@folklore1984.net> (raw)
In-Reply-To: <20170321141122.15451-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>


[-- Attachment #1.1.1: Type: text/plain, Size: 3726 bytes --]

Reviewed-by: Edward O'Callaghan <funfunctor-dczkZgxz+BNUPWh3PAxdjQ@public.gmane.org>

On 03/22/2017 01:11 AM, Tom St Denis wrote:
> It will display the leading 4 words up to
> the current PC value and then 4 words after.
> 
> Signed-off-by: Tom St Denis <tom.stdenis-5C7GfCeVMHo@public.gmane.org>
> ---
>  src/app/print_waves.c | 44 +++++++++++++++++++++++++++++++++-----------
>  1 file changed, 33 insertions(+), 11 deletions(-)
> 
> diff --git a/src/app/print_waves.c b/src/app/print_waves.c
> index f0eeeba43a99..e3662983d8d1 100644
> --- a/src/app/print_waves.c
> +++ b/src/app/print_waves.c
> @@ -35,7 +35,8 @@
>  
>  void umr_print_waves(struct umr_asic *asic)
>  {
> -	uint32_t x, se, sh, cu, simd, wave, sgprs[1024], shift;
> +	uint32_t x, se, sh, cu, simd, wave, sgprs[1024], shift, opcodes[8];
> +	uint64_t pgm_addr;
>  	struct umr_wave_status ws;
>  	int first = 1, col = 0;
>  
> @@ -74,17 +75,24 @@ void umr_print_waves(struct umr_asic *asic)
>  (unsigned long)ws.hw_id.value, (unsigned long)ws.gpr_alloc.value, (unsigned long)ws.lds_alloc.value, (unsigned long)ws.trapsts.value, (unsigned long)ws.ib_sts.value,
>  (unsigned long)ws.tba_hi, (unsigned long)ws.tba_lo, (unsigned long)ws.tma_hi, (unsigned long)ws.tma_lo, (unsigned long)ws.ib_dbg0, (unsigned long)ws.m0
>  );
> -					for (x = 0; x < ((ws.gpr_alloc.sgpr_size + 1) << shift); x += 4)
> -						printf(">SGPRS[%u..%u] = { %08lx, %08lx, %08lx, %08lx }\n",
> -							(unsigned)((ws.gpr_alloc.sgpr_base << shift) + x),
> -							(unsigned)((ws.gpr_alloc.sgpr_base << shift) + x + 3),
> -							(unsigned long)sgprs[x],
> -							(unsigned long)sgprs[x+1],
> -							(unsigned long)sgprs[x+2],
> -							(unsigned long)sgprs[x+3]);
> -					}
> +						for (x = 0; x < ((ws.gpr_alloc.sgpr_size + 1) << shift); x += 4)
> +							printf(">SGPRS[%u..%u] = { %08lx, %08lx, %08lx, %08lx }\n",
> +								(unsigned)((ws.gpr_alloc.sgpr_base << shift) + x),
> +								(unsigned)((ws.gpr_alloc.sgpr_base << shift) + x + 3),
> +								(unsigned long)sgprs[x],
> +								(unsigned long)sgprs[x+1],
> +								(unsigned long)sgprs[x+2],
> +								(unsigned long)sgprs[x+3]);
>  
> -					if (options.bitfields) {
> +						pgm_addr = (((uint64_t)ws.pc_hi << 32) | ws.pc_lo) - (sizeof(opcodes)/2);
> +						umr_read_vram(asic, ws.hw_id.vm_id, pgm_addr, sizeof(opcodes), opcodes);
> +						for (x = 0; x < sizeof(opcodes)/4; x++) {
> +							printf(">pgm[%lu@%llx] = %08lx\n",
> +								(unsigned long)ws.hw_id.vm_id,
> +								(unsigned long long)(pgm_addr + 4 * x),
> +								(unsigned long)opcodes[x]);
> +						}
> +					} else {
>  						first = 0;
>  						printf("\n------------------------------------------------------\nse%u.sh%u.cu%u.simd%u.wave%u\n",
>  						(unsigned)se, (unsigned)sh, (unsigned)cu, (unsigned)ws.hw_id.simd_id, (unsigned)ws.hw_id.wave_id);
> @@ -156,6 +164,20 @@ void umr_print_waves(struct umr_asic *asic)
>  								(unsigned long)sgprs[x+2],
>  								(unsigned long)sgprs[x+3]);
>  
> +						printf("\n\nPGM_MEM:\n");
> +						pgm_addr = (((uint64_t)ws.pc_hi << 32) | ws.pc_lo) - (sizeof(opcodes)/2);
> +						umr_read_vram(asic, ws.hw_id.vm_id, pgm_addr, sizeof(opcodes), opcodes);
> +						for (x = 0; x < sizeof(opcodes)/4; x++) {
> +							if (x == (sizeof(opcodes)/8))
> +								printf("*\t");
> +							else
> +								printf("\t");
> +							printf("pgm[%lu@%llx] = %08lx\n",
> +								(unsigned long)ws.hw_id.vm_id,
> +								(unsigned long long)(pgm_addr + 4 * x),
> +								(unsigned long)opcodes[x]);
> +						}
> +
>  						Hv("LDS_ALLOC", ws.lds_alloc.value);
>  						PP(lds_alloc, lds_base);
>  						PP(lds_alloc, lds_size);
> 


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      parent reply	other threads:[~2017-03-24 13:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21 14:11 [PATCH umr] Add program memory dump to wave status Tom St Denis
     [not found] ` <20170321141122.15451-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
2017-03-24 13:00   ` Edward O'Callaghan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a9059ebe-a562-e30d-e12b-9bfb7d78320c@folklore1984.net \
    --to=funfunctor-dczkzgxz+bnupwh3paxdjq@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=tom.stdenis-5C7GfCeVMHo@public.gmane.org \
    --cc=tstdenis82-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.