linux-stable/tools/perf
Kim Phillips b13bbeee5e perf annotate: Fix branch instruction with multiple operands
'perf annotate' is dropping the cr* fields from branch instructions.

Fix it by adding support to display branch instructions having
multiple operands.

Power Arch objdump of int_sqrt:

 20.36 | c0000000004d2694:   subf   r10,r10,r3
       | c0000000004d2698: v bgt    cr6,c0000000004d26a0 <int_sqrt+0x40>
  1.82 | c0000000004d269c:   mr     r3,r10
 29.18 | c0000000004d26a0:   mr     r10,r8
       | c0000000004d26a4: v bgt    cr7,c0000000004d26ac <int_sqrt+0x4c>
       | c0000000004d26a8:   mr     r10,r7

Power Arch Before Patch:

 20.36 |       subf   r10,r10,r3
       |     v bgt    40
  1.82 |       mr     r3,r10
 29.18 | 40:   mr     r10,r8
       |     v bgt    4c
       |       mr     r10,r7

Power Arch After patch:

 20.36 |       subf   r10,r10,r3
       |     v bgt    cr6,40
  1.82 |       mr     r3,r10
 29.18 | 40:   mr     r10,r8
       |     v bgt    cr7,4c
       |       mr     r10,r7

Also support AArch64 conditional branch instructions, which can
have up to three operands:

Aarch64 Non-simplified (raw objdump) view:

       │ffff0000083cd11c: ↑ cbz    w0, ffff0000083cd100 <security_fil▒
...
  4.44 │ffff000│083cd134: ↓ tbnz   w0, #26, ffff0000083cd190 <securit▒
...
  1.37 │ffff000│083cd144: ↓ tbnz   w22, #5, ffff0000083cd1a4 <securit▒
       │ffff000│083cd148:   mov    w19, #0x20000                   //▒
  1.02 │ffff000│083cd14c: ↓ tbz    w22, #2, ffff0000083cd1ac <securit▒
...
  0.68 │ffff000└──3cd16c: ↑ cbnz   w0, ffff0000083cd120 <security_fil▒

Aarch64 Simplified, before this patch:

       │    ↑ cbz    40
...
  4.44 │   │↓ tbnz   w0, #26, ffff0000083cd190 <security_file_permiss▒
...
  1.37 │   │↓ tbnz   w22, #5, ffff0000083cd1a4 <security_file_permiss▒
       │   │  mov    w19, #0x20000                   // #131072
  1.02 │   │↓ tbz    w22, #2, ffff0000083cd1ac <security_file_permiss▒
...
  0.68 │   └──cbnz   60

the cbz operand is missing, and the tbz doesn't get simplified processing
at all because the parsing function failed to match an address.

Aarch64 Simplified, After this patch applied:

       │    ↑ cbz    w0, 40
...
  4.44 │   │↓ tbnz   w0, #26, d0
...
  1.37 │   │↓ tbnz   w22, #5, e4
       │   │  mov    w19, #0x20000                   // #131072
  1.02 │   │↓ tbz    w22, #2, ec
...
  0.68 │   └──cbnz   w0, 60

Originally-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Tested-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Reported-by: Anton Blanchard <anton@samba.org>
Reported-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Kim Phillips <kim.phillips@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Taeung Song <treeze.taeung@gmail.com>
Link: http://lkml.kernel.org/r/20170601092959.f60d98912e8a1b66fd1e4c0e@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-06-01 14:48:36 -03:00
..
arch perf annotate: Fix AArch64 comment char 2017-05-04 10:03:00 -03:00
bench perf tools: Move extra string util functions to util/string2.h 2017-04-19 13:01:51 -03:00
Documentation perf script: Add --inline option for debugging 2017-05-24 08:41:48 +02:00
jvmti
pmu-events perf vendor events intel: Add missing space in json descriptions 2017-03-30 13:35:50 -07:00
python
scripts
tests perf tests kmod-path: Don't fail if compressed modules aren't supported 2017-05-04 10:05:55 -03:00
trace perf tools: Add signal.h to places using its definitions 2017-04-20 13:22:43 -03:00
ui perf tools: Put caller above callee in --children mode 2017-05-24 08:41:49 +02:00
util perf annotate: Fix branch instruction with multiple operands 2017-06-01 14:48:36 -03:00
.gitignore perf tools: Ignore generated files pmu-events/{jevents,pmu-events.c} for git 2017-03-13 10:59:36 -03:00
Build perf trace: Beautify statx syscall 'flag' and 'mask' arguments 2017-03-31 14:42:31 -03:00
builtin-annotate.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-bench.c perf tools: Remove unused 'prefix' from builtin functions 2017-03-27 11:58:09 -03:00
builtin-buildid-cache.c perf symbols: Accept symbols starting at address 0 2017-05-02 18:23:04 -03:00
builtin-buildid-list.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-c2c.c perf tools: Move event prototypes from util.h to event.h 2017-04-25 15:30:47 -03:00
builtin-config.c perf config: Refactor a duplicated code for obtaining config file name 2017-05-02 18:23:12 -03:00
builtin-data.c perf tools: Remove unused 'prefix' from builtin functions 2017-03-27 11:58:09 -03:00
builtin-diff.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-evlist.c perf tools: Remove unused 'prefix' from builtin functions 2017-03-27 11:58:09 -03:00
builtin-ftrace.c perf tools: Remove poll.h and wait.h from util.h 2017-04-24 13:43:34 -03:00
builtin-help.c perf tools: Remove string.h, unistd.h and sys/stat.h from util.h 2017-04-24 13:43:33 -03:00
builtin-inject.c perf tools: Use just forward declarations for struct thread where possible 2017-04-24 13:43:35 -03:00
builtin-kallsyms.c perf tools: Including missing inttypes.h header 2017-04-19 13:01:46 -03:00
builtin-kmem.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-kvm.c perf tools: Remove poll.h and wait.h from util.h 2017-04-24 13:43:34 -03:00
builtin-list.c perf tools: Remove unused 'prefix' from builtin functions 2017-03-27 11:58:09 -03:00
builtin-lock.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-mem.c perf tools: Use just forward declarations for struct thread where possible 2017-04-24 13:43:35 -03:00
builtin-probe.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2017-05-02 19:09:35 -07:00
builtin-record.c perf tools: Remove poll.h and wait.h from util.h 2017-04-24 13:43:34 -03:00
builtin-report.c perf tools: Remove string.h, unistd.h and sys/stat.h from util.h 2017-04-24 13:43:33 -03:00
builtin-sched.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-script.c perf script: Add --inline option for debugging 2017-05-24 08:41:48 +02:00
builtin-stat.c perf tools: Remove poll.h and wait.h from util.h 2017-04-24 13:43:34 -03:00
builtin-timechart.c perf tools: Use just forward declarations for struct thread where possible 2017-04-24 13:43:35 -03:00
builtin-top.c perf tools: Move event prototypes from util.h to event.h 2017-04-25 15:30:47 -03:00
builtin-trace.c perf trace: Add mmap alias for s390 2017-06-01 10:13:21 -03:00
builtin-version.c perf tools: Remove string.h, unistd.h and sys/stat.h from util.h 2017-04-24 13:43:33 -03:00
builtin.h perf tools: Remove stale prototypes from builtin.h 2017-04-24 13:43:33 -03:00
check-headers.sh tools include uapi: Grab copies of stat.h and fcntl.h 2017-03-31 11:26:03 -03:00
command-list.txt perf tools: Missing c2c command in command-list 2017-03-13 10:59:31 -03:00
CREDITS
design.txt
Makefile
Makefile.config perf tools: Disable JVMTI if no ELF support available 2017-04-13 11:47:43 -03:00
Makefile.perf perf build: Add special fixdep cleaning rule 2017-02-17 16:04:38 -03:00
MANIFEST tools include: Introduce linux/bug.h, from the kernel sources 2017-04-19 13:01:42 -03:00
perf-archive.sh
perf-completion.sh
perf-read-vdso.c
perf-sys.h
perf-with-kcore.sh
perf.c perf tools: Move event prototypes from util.h to event.h 2017-04-25 15:30:47 -03:00
perf.h perf tools: Add PERF_RECORD_NAMESPACES to include namespaces related info 2017-03-14 11:38:23 -03:00