Adrian Hunter
5172672da0
perf script: Fix invalid LBR/binary mismatch error
...
The 'len' returned by grab_bb() includes an extra MAXINSN bytes to allow
for the last instruction, so the the final 'offs' will not be 'len'.
Fix the error condition logic accordingly.
Before:
$ perf record -e '{intel_pt//,cpu/mem_inst_retired.all_loads,aux-sample-size=8192/pp}:u' grep -rqs jhgjhg /boot
[ perf record: Woken up 19 times to write data ]
[ perf record: Captured and wrote 2.274 MB perf.data ]
$ perf script -F +brstackinsn --xed --itrace=i1usl100 | head
grep 13759 [002] 8091.310257: 1862 instructions:uH: 5641d58069eb bmexec+0x86b (/bin/grep)
bmexec+2485:
00005641d5806b35 jnz 0x5641d5806bd0 # MISPRED
00005641d5806bd0 movzxb (%r13,%rdx,1), %eax
00005641d5806bd6 add %rdi, %rax
00005641d5806bd9 movzxb -0x1(%rax), %edx
00005641d5806bdd cmp %rax, %r14
00005641d5806be0 jnb 0x5641d58069c0 # MISPRED
mismatch of LBR data and executable
00005641d58069c0 movzxb (%r13,%rdx,1), %edi
After:
$ perf script -F +brstackinsn --xed --itrace=i1usl100 | head
grep 13759 [002] 8091.310257: 1862 instructions:uH: 5641d58069eb bmexec+0x86b (/bin/grep)
bmexec+2485:
00005641d5806b35 jnz 0x5641d5806bd0 # MISPRED
00005641d5806bd0 movzxb (%r13,%rdx,1), %eax
00005641d5806bd6 add %rdi, %rax
00005641d5806bd9 movzxb -0x1(%rax), %edx
00005641d5806bdd cmp %rax, %r14
00005641d5806be0 jnb 0x5641d58069c0 # MISPRED
00005641d58069c0 movzxb (%r13,%rdx,1), %edi
00005641d58069c6 add %rax, %rdi
Fixes: e98df280bc2a ("perf script brstackinsn: Fix recovery from LBR/binary mismatch")
Reported-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lore.kernel.org/lkml/20191127095631.15663-1-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-11-28 08:08:38 -03:00
..
2019-11-26 11:07:46 -03:00
2019-09-20 09:19:21 -03:00
2019-11-22 10:48:13 -03:00
2019-08-26 11:58:29 -03:00
2019-07-29 18:34:40 -03:00
2019-10-15 11:47:38 -03:00
2019-11-06 15:43:05 -03:00
2019-11-12 15:26:55 -03:00
2019-06-05 17:37:14 +02:00
2019-11-13 09:13:16 -03:00
2019-11-26 11:07:46 -03:00
2019-10-19 15:35:02 -03:00
2019-11-26 11:07:46 -03:00
2019-11-28 08:08:38 -03:00
2019-08-31 22:27:52 -03:00
2019-02-14 15:18:08 -03:00
2019-11-12 08:20:53 -03:00
2019-08-29 17:38:32 -03:00
2019-09-20 15:58:11 -03:00
2019-09-20 15:58:11 -03:00
2019-10-15 12:08:13 -03:00
2019-09-20 09:19:20 -03:00
2019-08-31 19:10:19 -03:00
2019-11-28 08:08:38 -03:00
2019-09-25 16:26:34 -03:00
2019-08-31 22:24:10 -03:00
2019-08-31 19:10:19 -03:00
2019-11-22 10:48:13 -03:00
2019-08-31 22:24:10 -03:00
2019-11-12 08:20:53 -03:00
2019-11-06 15:43:05 -03:00
2019-10-19 15:35:01 -03:00
2019-09-20 15:58:11 -03:00
2019-09-20 15:58:11 -03:00
2019-08-31 22:24:10 -03:00
2019-11-22 10:48:13 -03:00
2019-11-26 11:07:46 -03:00
2019-11-12 08:20:53 -03:00
2019-11-28 08:08:38 -03:00
2019-11-18 19:14:29 -03:00
2019-09-20 15:58:11 -03:00
2019-11-12 08:20:53 -03:00
2019-11-18 19:14:29 -03:00
2019-08-31 22:27:48 -03:00
2019-08-28 17:19:34 -03:00
2019-11-25 09:09:27 +01:00
2019-01-21 11:01:18 +01:00
2019-11-26 11:17:45 -03:00
2019-11-26 11:17:45 -03:00
2019-07-09 10:13:26 -03:00
2019-01-08 13:28:13 -03:00
2019-10-31 21:38:41 +01:00
2019-06-17 12:29:16 +02:00
2019-09-25 09:51:49 -03:00
2019-08-29 17:38:32 -03:00