Re: [PATCH] perf tools: add aarch64 registers to --user-regs

James Clark
2020-11-30T15:56:02Z

On 27/11/2020 17:39, Alexandre Truong wrote:
> Previously, this command returns no help message on aarch64:
>
> -> ./perf record --user-regs=?
>
> available registers:
> Usage: perf record [<options>] [<command>]
> or: perf record [<options>] -- <command> [<options>]
>
> With this change, the registers are listed.
>
> -> ./perf record --user-regs=?
>
> available registers: x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 lr sp pc
>
> It's also now possible to record subsets of registers on aarch64:
>
> -> ./perf record --user-regs=x4,x5 ls
> -> ./perf report --dump-raw-trace
>
> 12801163749305260 0xc70 [0x40]: PERF_RECORD_SAMPLE(IP, 0x2): 51956/51956: 0xffffaa6571f0 period: 145785 addr: 0
> ... user regs: mask 0x30 ABI 64-bit
> .... x4 0x000000000000006c
> .... x5 0x0000001001000001
> ... thread: ls:51956
> ...... dso: /usr/lib64/ld-2.17.so
>

Checked that the registers can be listed with =? and that recording different combinations of registers works as expected.

Tested-by: James Clark <james.clark@arm.com>