[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
- [RISU v2 13/17] Split RES_MISMATCH for registers and memory, (continued)
- [RISU v2 13/17] Split RES_MISMATCH for registers and memory, Richard Henderson, 2020/05/18
- [RISU v2 14/17] Add magic and size to the trace header, Richard Henderson, 2020/05/18
- [RISU v2 15/17] Compute reginfo_size based on the reginfo, Richard Henderson, 2020/05/18
- [RISU v2 16/17] aarch64: Reorg sve reginfo to save space, Richard Henderson, 2020/05/18
- [RISU v2 17/17] Add --dump option to inspect trace files, Richard Henderson, 2020/05/18
- Re: [RISU v2 17/17] Add --dump option to inspect trace files,
Alex Bennée <=