Re: [PATCH] perf tests: improve reading of objdump output

From: Peter Zijlstra
Date: Mon Aug 31 2015 - 03:23:13 EST


On Mon, Aug 31, 2015 at 09:18:33AM +0200, Jan Stancek wrote:
> There are couple of situations, where objdump output doesn't
> match "code reading" test expectations:
>
> 1. gaps in output, objdump skips zero blocks by default
>
> ffffffff816704fe <sysret_check+0x4b>:
> ffffffff816704fe: 7b 34 jnp ffffffff81670534 <sysret_signal+0x1c>
> ...
> ffffffff81670501 <sysret_careful>:
> ffffffff81670501: 0f ba e2 03 bt $0x3,%edx
> ffffffff81670505: 73 11 jae ffffffff81670518 <sysret_signal>
>
> This patch adds "-z" to objdump parameters.
>
> 2. bytes can be repeated in objdump output, test reads it all sequentially
> assuming each address is represented in output only once.
>
> ffffffff8164efb3 <retint_swapgs+0x9>:
> ffffffff8164efb3: c1 5d 00 eb rcrl $0xeb,0x0(%rbp)
> ffffffff8164efb7: 00 4c 8b 5c add %cl,0x5c(%rbx,%rcx,4)
>
> ffffffff8164efb8 <restore_c_regs_and_iret>:
> ffffffff8164efb8: 4c 8b 5c 24 30 mov 0x30(%rsp),%r11
> ffffffff8164efbd: 4c 8b 54 24 38 mov 0x38(%rsp),%r10
>
> This patch stores objdump output to buffer according to address
> on each line.
>
> 3. objdump output can span across multiple sections
>
> Disassembly of section .text:
> 0000000000000008 <crc32c+0x8>:
> 8: 48 89 e5 mov %rsp,%rbp
> b: 53 push %rbx
> c: 8b 01 mov (%rcx),%eax
> <snip>
> 6b: 90 nop
>
> Disassembly of section .init.text:
> 0000000000000008 <init_module+0x8>:
> 8: 00 00 add %al,(%rax)
> a: 00 00 add %al,(%rax)
> c: 48 89 e5
>
> This patch aborts further reading if address starts going backwards,
> assuming we crossed sections.

I would have expected 3 patches, each patch doing exactly one of the
above.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/