perf script: Fix --max-blocks man page description
PATCH 1/3 perf script: Fix --max-blocks man page description
From: Andi Kleen <[email protected]>
The --max-blocks description was using the old name brstackasm. Use brstackinsn instead.
--- tools/perf/Documentation/perf-script.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Documentation/perf-script.txt +1 -1
@@ -384,7 +384,7 @@ include::itrace.txt[] perf script --time 0%-10%,30%-40% --max-blocks:: - Set the maximum number of program blocks to print with brstackasm for + Set the maximum number of program blocks to print with brstackinsn for each sample. --reltime::
Signature · 1 line
2.20.1
PATCH 2/3 perf script: Fix off by one in brstackinsn IPC computation
From: Andi Kleen <[email protected]>
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 IPCAfter:
% 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--- tools/perf/builtin-script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-script.c +1 -1
@@ -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);
Signature · 1 line
2.20.1
Arnaldo Carvalho de Melo
AppliedRe: [PATCH 2/3] perf script: Fix off by one in brstackinsn IPC computation
Em Thu, Jul 11, 2019 at 11:19:21AM -0700, Andi Kleen escreveu:
Quoted 8 lines
From: Andi Kleen <[email protected]>
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/nullBefore:
Thanks, applied.
- Arnaldo
tip-bot for Andi Kleen
merge bot[tip:perf/urgent] perf script: Fix off by one in brstackinsn IPC computation
In reply to Andi Kleenperf script: Fix off by one in brstackinsn IPC computation
Commit-ID: dde4e732a5b02fa5599c2c0e6c48a0c11789afc4 Gitweb: https://git.kernel.org/tip/dde4e732a5b02fa5599c2c0e6c48a0c11789afc4 Author: Andi Kleen <[email protected]> AuthorDate: Thu, 11 Jul 2019 11:19:21 -0700 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 23 Jul 2019 08:59:37 -0300
perf script: Fix off by one in brstackinsn IPC computation
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 IPCAfter:
% 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--- tools/perf/builtin-script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-script.c +1 -1
@@ -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);
PATCH 3/3 perf script: Improve man page description of metrics
In reply to Andi KleenFrom: Andi Kleen <[email protected]>
Clarify that a metric is based on events, not referring to itself. Also some improvements with the sentences.
--- tools/perf/Documentation/perf-script.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/perf/Documentation/perf-script.txt +3 -3
@@ -228,11 +228,11 @@ OPTIONS With the metric option perf script can compute metrics for sampling periods, similar to perf stat. This requires - specifying a group with multiple metrics with the :S option + specifying a group with multiple events defining metrics with the :S option for perf record. perf will sample on the first event, and - compute metrics for all the events in the group. Please note + print computed metrics for all the events in the group. Please note that the metric computed is averaged over the whole sampling - period, not just for the sample point. + period (since the last sample), not just for the sample point. For sample events it's possible to display misc field with -F +misc option, following letters are displayed for each bit:
Signature · 1 line
2.20.1
Arnaldo Carvalho de Melo
AppliedRe: [PATCH 3/3] perf script: Improve man page description of metrics
Em Thu, Jul 11, 2019 at 11:19:22AM -0700, Andi Kleen escreveu:
Quoted 4 lines
From: Andi Kleen <[email protected]>
Clarify that a metric is based on events, not referring to itself. Also some improvements with the sentences.
Thanks, applied.
tip-bot for Andi Kleen
merge bot[tip:perf/urgent] perf script: Improve man page description of metrics
In reply to Andi Kleenperf script: Improve man page description of metrics
Commit-ID: 7db7218a7ea577f04c2df92453d47ab5ebfc8863 Gitweb: https://git.kernel.org/tip/7db7218a7ea577f04c2df92453d47ab5ebfc8863 Author: Andi Kleen <[email protected]> AuthorDate: Thu, 11 Jul 2019 11:19:22 -0700 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 23 Jul 2019 08:58:11 -0300
perf script: Improve man page description of metrics
Clarify that a metric is based on events, not referring to itself. Also some improvements with the sentences.
--- tools/perf/Documentation/perf-script.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/perf/Documentation/perf-script.txt +3 -3
@@ -228,11 +228,11 @@ OPTIONS With the metric option perf script can compute metrics for sampling periods, similar to perf stat. This requires - specifying a group with multiple metrics with the :S option + specifying a group with multiple events defining metrics with the :S option for perf record. perf will sample on the first event, and - compute metrics for all the events in the group. Please note + print computed metrics for all the events in the group. Please note that the metric computed is averaged over the whole sampling - period, not just for the sample point. + period (since the last sample), not just for the sample point. For sample events it's possible to display misc field with -F +misc option, following letters are displayed for each bit:
Arnaldo Carvalho de Melo
AppliedEm Thu, Jul 11, 2019 at 11:19:20AM -0700, Andi Kleen escreveu:
Quoted 4 lines
From: Andi Kleen <[email protected]>
The --max-blocks description was using the old name brstackasm. Use brstackinsn instead.
Thanks, applied.
- Arnaldo
tip-bot for Andi Kleen
merge botperf script: Fix --max-blocks man page description
Commit-ID: 5f8eec3225ff7b86763b060164e9ce47b1a71406 Gitweb: https://git.kernel.org/tip/5f8eec3225ff7b86763b060164e9ce47b1a71406 Author: Andi Kleen <[email protected]> AuthorDate: Thu, 11 Jul 2019 11:19:20 -0700 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 23 Jul 2019 08:57:54 -0300
perf script: Fix --max-blocks man page description
The --max-blocks description was using the old name brstackasm. Use brstackinsn instead.
--- tools/perf/Documentation/perf-script.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Documentation/perf-script.txt +1 -1
@@ -384,7 +384,7 @@ include::itrace.txt[] perf script --time 0%-10%,30%-40% --max-blocks:: - Set the maximum number of program blocks to print with brstackasm for + Set the maximum number of program blocks to print with brstackinsn for each sample. --reltime::