Jin Yao
bb848c14f8
perf annotate: Support to display the IPC/Cycle in TUI mode
Unlike the perf report interactive annotate mode, the perf annotate
doesn't display the IPC/Cycle even if branch info is recorded in perf
data file.
perf record -b ...
perf annotate function
It should show IPC/cycle, but it doesn't.
This patch lets perf annotate support the displaying of IPC/Cycle if
branch info is in perf data.
For example,
perf annotate compute_flag
Percent│ IPC Cycle
│
│
│ Disassembly of section .text:
│
│ 0000000000400640 <compute_flag>:
│ compute_flag():
│ volatile int count;
│ static unsigned int s_randseed;
│
│ __attribute__((noinline))
│ int compute_flag()
│ {
22.96 │1.18 584 sub $0x8,%rsp
│ int i;
│
│ i = rand() % 2;
23.02 │1.18 1 → callq rand@plt
│
│ return i;
27.05 │3.37 mov %eax,%edx
│ }
│3.37 add $0x8,%rsp
│ {
│ int i;
│
│ i = rand() % 2;
│
│ return i;
│3.37 shr $0x1f,%edx
│3.37 add %edx,%eax
│3.37 and $0x1,%eax
│3.37 sub %edx,%eax
│ }
26.97 │3.37 2 ← retq
Note that, this patch only supports TUI mode. For stdio, now it just keeps
original behavior. Will support it in a follow-up patch.
$ perf annotate compute_flag --stdio
Percent | Source code & Disassembly of div for cycles:ppp (7993 samples)
------------------------------------------------------------------------------
:
:
:
: Disassembly of section .text:
:
: 0000000000400640 <compute_flag>:
: compute_flag():
: volatile int count;
: static unsigned int s_randseed;
:
: __attribute__((noinline))
: int compute_flag()
: {
0.29 : 400640: sub $0x8,%rsp # +100.00%
: int i;
:
: i = rand() % 2;
42.93 : 400644: callq 400490 <rand@plt> # -100.00% (p:100.00%)
:
: return i;
0.10 : 400649: mov %eax,%edx # +100.00%
: }
0.94 : 40064b: add $0x8,%rsp
: {
: int i;
:
: i = rand() % 2;
:
: return i;
27.02 : 40064f: shr $0x1f,%edx
0.15 : 400652: add %edx,%eax
1.24 : 400654: and $0x1,%eax
2.08 : 400657: sub %edx,%eax
: }
25.26 : 400659: retq # -100.00% (p:100.00%)
Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/20180223170210.GC7045@tassilo.jf.intel.com
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1519724327-7773-1-git-send-email-yao.jin@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-03-08 11:30:52 -03:00
..
2018-03-08 10:05:59 -03:00
2017-12-27 12:15:49 -03:00
2018-03-08 10:05:49 -03:00
2017-12-18 11:54:08 -03:00
2018-02-15 09:49:44 -03:00
2018-02-19 12:28:08 -03:00
2018-02-19 12:28:23 -03:00
2018-03-08 10:05:53 -03:00
2018-01-25 06:37:31 -03:00
2018-03-08 11:30:36 -03:00
2018-03-08 11:30:46 -03:00
2018-02-05 13:58:02 -03:00
2018-01-23 09:51:38 -03:00
2018-03-08 11:30:52 -03:00
2017-11-02 11:10:55 +01:00
2017-11-16 14:49:54 -03:00
2017-11-07 10:30:18 +01:00
2018-03-08 11:30:45 -03:00
2017-11-07 10:30:18 +01:00
2017-11-02 11:10:55 +01:00
2017-11-07 10:30:18 +01:00
2017-11-07 10:30:18 +01:00
2018-02-19 09:49:12 -03:00
2018-01-23 09:51:38 -03:00
2018-01-18 09:01:23 -03:00
2017-04-19 13:01:46 -03:00
2017-11-15 18:21:06 -08:00
2018-03-08 10:05:53 -03:00
2017-11-07 10:30:18 +01:00
2017-11-07 10:30:18 +01:00
2017-11-07 10:30:18 +01:00
2017-07-18 23:14:11 -03:00
2018-03-08 11:30:43 -03:00
2018-03-08 11:30:51 -03:00
2018-03-07 10:22:26 -03:00
2018-02-16 10:09:23 -03:00
2018-03-08 10:05:49 -03:00
2017-10-30 13:37:37 -03:00
2018-03-08 10:05:53 -03:00
2018-03-08 10:05:53 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-02-16 14:55:47 -03:00
2017-03-13 10:59:31 -03:00
2014-03-18 18:17:06 -03:00
2017-11-02 11:10:55 +01:00
2018-02-19 12:28:23 -03:00
2018-03-08 11:30:47 -03:00
2017-09-25 10:39:43 -03:00
2017-11-02 11:10:55 +01:00
2017-12-27 12:16:00 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2015-08-06 16:48:27 -03:00
2018-01-23 09:51:38 -03:00
2018-03-05 11:52:41 -03:00