qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RISU v2 17/17] Add --dump option to inspect trace files


From: Alex Bennée
Subject: Re: [RISU v2 17/17] Add --dump option to inspect trace files
Date: Wed, 20 May 2020 18:49:30 +0100
User-agent: mu4e 1.4.6; emacs 28.0.50

Richard Henderson <address@hidden> writes:

> Adjust some of the aarch64 code to look at the reginfo struct
> instead of looking at test_sve, so that we do not need to pass
> the --test-sve option in order to dump sve trace files.
>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
>  risu.h                 |   1 +
>  risu.c                 | 108 ++++++++++++++++++++++++++++++++++++++++-
>  risu_reginfo_aarch64.c |  55 +++++++++++++--------
>  risu_reginfo_arm.c     |   4 ++
>  risu_reginfo_i386.c    |   4 ++
>  risu_reginfo_m68k.c    |   4 ++
>  risu_reginfo_ppc64.c   |   4 ++
>  7 files changed, 159 insertions(+), 21 deletions(-)
>
> diff --git a/risu.h b/risu.h
> index 054cef7..3bfe765 100644
> --- a/risu.h
> +++ b/risu.h
> @@ -23,6 +23,7 @@
>  extern const struct option * const arch_long_opts;
>  extern const char * const arch_extra_help;
>  void process_arch_opt(int opt, const char *arg);
> +void arch_init(void);
>  #define FIRST_ARCH_OPT   0x100
>  
>  /* GCC computed include to pull in the correct risu_reginfo_*.h for
> diff --git a/risu.c b/risu.c
> index 95b4674..d7c7556 100644
> --- a/risu.c
> +++ b/risu.c
> @@ -249,6 +249,93 @@ static int apprentice(void)
>      }
>  }
>  
> +static int dump_trace(void)
> +{
> +    trace_header_t header;
> +    union {
> +        struct reginfo ri;
> +        unsigned char memblock[MEMBLOCKLEN];
> +    } u;

If you kept a p(rev) copy you could also add an option to:

> +    const char *op_name;
> +
<snip>
> +            printf("%s: (pc %#lx)\n", op_name, (unsigned long)header.pc);
> +            reginfo_dump(&u.ri, stdout);

optionally call reginfo_dump_mismatch(&u.ri, &p.ri, stdout) here so you
can see what is changing for each instruction. It looks a bit ugly
calling them mismatches though ;-)

Anyway:

Tested-by: Alex Bennée <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>

-- 
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]