diff options
author | Andi Kleen <ak@linux.intel.com> | 2015-07-18 08:24:50 -0700 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-08-06 16:36:12 -0300 |
commit | 30e863bb6f708c0abd422fbb0e6b295f5ee6407b (patch) | |
tree | 61f2ba3ee89bb1162a3e2f4275194589c1ae97f0 /tools/perf/util/annotate.h | |
parent | 57849998e2cd24d50295076a1bbd2f029e2d7c38 (diff) | |
download | linux-30e863bb6f708c0abd422fbb0e6b295f5ee6407b.tar.gz linux-30e863bb6f708c0abd422fbb0e6b295f5ee6407b.tar.bz2 linux-30e863bb6f708c0abd422fbb0e6b295f5ee6407b.zip |
perf annotate: Compute IPC and basic block cycles
Compute the IPC and the basic block cycles for the annotate display.
IPC is computed by counting the instructions, and then dividing the
accounted cycles by that count.
The actual IPC computation can only be done at annotate time, because we
need to parse the objdump output first to know the number of
instructions in the basic block.
The cycles/IPC are also put into the perf function annotation so that
the display code can show them.
Again basic block overlaps are not handled, with the longest winning,
but there are some heuristics to hide the IPC when the longest is not
the most common.
v2: Compute IPC correctly.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1437233094-12844-6-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/annotate.h')
-rw-r--r-- | tools/perf/util/annotate.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index a06518dca4b7..e9996092a093 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -59,6 +59,8 @@ struct disasm_line { char *name; struct ins *ins; int line_nr; + float ipc; + u64 cycles; struct ins_operands ops; }; |