projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7db7218
)
perf script: Fix off by one in brstackinsn IPC computation
author
Andi Kleen
<ak@linux.intel.com>
Thu, 11 Jul 2019 18:19:21 +0000
(11:19 -0700)
committer
Arnaldo Carvalho de Melo
<acme@redhat.com>
Tue, 23 Jul 2019 11:59:37 +0000
(08:59 -0300)
When we hit the end of a program block, need to count the last
instruction too for the IPC computation. This caused large errors for
small blocks.
% perf script -b ls / > /dev/null
Before:
% perf script -F +brstackinsn --xed
...
00007f94c9ac70d8
jz 0x7f94c9ac70e3 # PRED 3 cycles [36] 4.33 IPC
00007f94c9ac70e3
testb $0x20, 0x31d(%rbx)
00007f94c9ac70ea
jnz 0x7f94c9ac70b0
00007f94c9ac70ec
testb $0x8, 0x205ad(%rip)
00007f94c9ac70f3
jz 0x7f94c9ac6ff0 # PRED 1 cycles [37] 3.00 IPC
After:
% perf script -F +brstackinsn --xed
...
00007f94c9ac70d8
jz 0x7f94c9ac70e3 # PRED 3 cycles [15] 4.67 IPC
00007f94c9ac70e3
testb $0x20, 0x31d(%rbx)
00007f94c9ac70ea
jnz 0x7f94c9ac70b0
00007f94c9ac70ec
testb $0x8, 0x205ad(%rip)
00007f94c9ac70f3
jz 0x7f94c9ac6ff0 # PRED 1 cycles [16] 4.00 IPC
Suggested-by: Denis Bakhvalov <denis.bakhvalov@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Link:
http://lkml.kernel.org/r/20190711181922.18765-2-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-script.c
patch
|
blob
|
history
diff --git
a/tools/perf/builtin-script.c
b/tools/perf/builtin-script.c
index 8f24865596af2fd5a6334f9c5fa10b726bc22956..0140ddb8dd0bd34883d0e6d848d9012dd8fe1c2b 100644
(file)
--- a/
tools/perf/builtin-script.c
+++ b/
tools/perf/builtin-script.c
@@
-1059,7
+1059,7
@@
static int perf_sample__fprintf_brstackinsn(struct perf_sample *sample,
printed += ip__fprintf_sym(ip, thread, x.cpumode, x.cpu, &lastsym, attr, fp);
if (ip == end) {
- printed += ip__fprintf_jump(ip, &br->entries[i], &x, buffer + off, len - off, insn, fp,
+ printed += ip__fprintf_jump(ip, &br->entries[i], &x, buffer + off, len - off,
++
insn, fp,
&total_cycles);
if (PRINT_FIELD(SRCCODE))
printed += print_srccode(thread, x.cpumode, ip);