LKML Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/3] perf script: Fix --max-blocks man page description
@ 2019-07-11 18:19 Andi Kleen
  2019-07-11 18:19 ` [PATCH 2/3] perf script: Fix off by one in brstackinsn IPC computation Andi Kleen
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Andi Kleen @ 2019-07-11 18:19 UTC (permalink / raw)
  To: acme; +Cc: jolsa, linux-kernel, linux-perf-users, Andi Kleen

From: Andi Kleen <ak@linux.intel.com>

The --max-blocks description was using the old name brstackasm.
Use brstackinsn instead.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 tools/perf/Documentation/perf-script.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index d4e2e18a5881..042b9e5dcc32 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -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::
-- 
2.20.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 2/3] perf script: Fix off by one in brstackinsn IPC computation
  2019-07-11 18:19 [PATCH 1/3] perf script: Fix --max-blocks man page description Andi Kleen
@ 2019-07-11 18:19 ` Andi Kleen
  2019-07-16 18:44   ` Arnaldo Carvalho de Melo
  2019-07-23 21:47   ` [tip:perf/urgent] " tip-bot for Andi Kleen
  2019-07-11 18:19 ` [PATCH 3/3] perf script: Improve man page description of metrics Andi Kleen
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 9+ messages in thread
From: Andi Kleen @ 2019-07-11 18:19 UTC (permalink / raw)
  To: acme; +Cc: jolsa, linux-kernel, linux-perf-users, Andi Kleen, Denis Bakhvalov

From: Andi Kleen <ak@linux.intel.com>

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>
---
 tools/perf/builtin-script.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 2f6232f1bfdc..9a63cb3442a9 100644
--- 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);
-- 
2.20.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 3/3] perf script: Improve man page description of metrics
  2019-07-11 18:19 [PATCH 1/3] perf script: Fix --max-blocks man page description Andi Kleen
  2019-07-11 18:19 ` [PATCH 2/3] perf script: Fix off by one in brstackinsn IPC computation Andi Kleen
@ 2019-07-11 18:19 ` Andi Kleen
  2019-07-16 18:45   ` Arnaldo Carvalho de Melo
  2019-07-23 21:47   ` [tip:perf/urgent] " tip-bot for Andi Kleen
  2019-07-16 18:43 ` [PATCH 1/3] perf script: Fix --max-blocks man page description Arnaldo Carvalho de Melo
  2019-07-23 21:46 ` [tip:perf/urgent] " tip-bot for Andi Kleen
  3 siblings, 2 replies; 9+ messages in thread
From: Andi Kleen @ 2019-07-11 18:19 UTC (permalink / raw)
  To: acme; +Cc: jolsa, linux-kernel, linux-perf-users, Andi Kleen

From: Andi Kleen <ak@linux.intel.com>

Clarify that a metric is based on events, not referring
to itself. Also some improvements with the sentences.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 tools/perf/Documentation/perf-script.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index 042b9e5dcc32..caaab28f8400 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -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:
-- 
2.20.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] perf script: Fix --max-blocks man page description
  2019-07-11 18:19 [PATCH 1/3] perf script: Fix --max-blocks man page description Andi Kleen
  2019-07-11 18:19 ` [PATCH 2/3] perf script: Fix off by one in brstackinsn IPC computation Andi Kleen
  2019-07-11 18:19 ` [PATCH 3/3] perf script: Improve man page description of metrics Andi Kleen
@ 2019-07-16 18:43 ` Arnaldo Carvalho de Melo
  2019-07-23 21:46 ` [tip:perf/urgent] " tip-bot for Andi Kleen
  3 siblings, 0 replies; 9+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-07-16 18:43 UTC (permalink / raw)
  To: Andi Kleen; +Cc: jolsa, linux-kernel, linux-perf-users, Andi Kleen

Em Thu, Jul 11, 2019 at 11:19:20AM -0700, Andi Kleen escreveu:
> From: Andi Kleen <ak@linux.intel.com>
> 
> The --max-blocks description was using the old name brstackasm.
> Use brstackinsn instead.

Thanks, applied.

- Arnaldo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] perf script: Fix off by one in brstackinsn IPC computation
  2019-07-11 18:19 ` [PATCH 2/3] perf script: Fix off by one in brstackinsn IPC computation Andi Kleen
@ 2019-07-16 18:44   ` Arnaldo Carvalho de Melo
  2019-07-23 21:47   ` [tip:perf/urgent] " tip-bot for Andi Kleen
  1 sibling, 0 replies; 9+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-07-16 18:44 UTC (permalink / raw)
  To: Andi Kleen
  Cc: jolsa, linux-kernel, linux-perf-users, Andi Kleen, Denis Bakhvalov

Em Thu, Jul 11, 2019 at 11:19:21AM -0700, Andi Kleen escreveu:
> From: Andi Kleen <ak@linux.intel.com>
> 
> 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:

Thanks, applied.

- Arnaldo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] perf script: Improve man page description of metrics
  2019-07-11 18:19 ` [PATCH 3/3] perf script: Improve man page description of metrics Andi Kleen
@ 2019-07-16 18:45   ` Arnaldo Carvalho de Melo
  2019-07-23 21:47   ` [tip:perf/urgent] " tip-bot for Andi Kleen
  1 sibling, 0 replies; 9+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-07-16 18:45 UTC (permalink / raw)
  To: Andi Kleen; +Cc: jolsa, linux-kernel, linux-perf-users, Andi Kleen

Em Thu, Jul 11, 2019 at 11:19:22AM -0700, Andi Kleen escreveu:
> From: Andi Kleen <ak@linux.intel.com>
> 
> Clarify that a metric is based on events, not referring
> to itself. Also some improvements with the sentences.

Thanks, applied.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [tip:perf/urgent] perf script: Fix --max-blocks man page description
  2019-07-11 18:19 [PATCH 1/3] perf script: Fix --max-blocks man page description Andi Kleen
                   ` (2 preceding siblings ...)
  2019-07-16 18:43 ` [PATCH 1/3] perf script: Fix --max-blocks man page description Arnaldo Carvalho de Melo
@ 2019-07-23 21:46 ` " tip-bot for Andi Kleen
  3 siblings, 0 replies; 9+ messages in thread
From: tip-bot for Andi Kleen @ 2019-07-23 21:46 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: mingo, linux-kernel, acme, tglx, jolsa, ak, hpa

Commit-ID:  5f8eec3225ff7b86763b060164e9ce47b1a71406
Gitweb:     https://git.kernel.org/tip/5f8eec3225ff7b86763b060164e9ce47b1a71406
Author:     Andi Kleen <ak@linux.intel.com>
AuthorDate: Thu, 11 Jul 2019 11:19:20 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20190711181922.18765-1-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-script.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index d4e2e18a5881..042b9e5dcc32 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -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::

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [tip:perf/urgent] perf script: Improve man page description of metrics
  2019-07-11 18:19 ` [PATCH 3/3] perf script: Improve man page description of metrics Andi Kleen
  2019-07-16 18:45   ` Arnaldo Carvalho de Melo
@ 2019-07-23 21:47   ` " tip-bot for Andi Kleen
  1 sibling, 0 replies; 9+ messages in thread
From: tip-bot for Andi Kleen @ 2019-07-23 21:47 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: tglx, acme, mingo, linux-kernel, jolsa, hpa, ak

Commit-ID:  7db7218a7ea577f04c2df92453d47ab5ebfc8863
Gitweb:     https://git.kernel.org/tip/7db7218a7ea577f04c2df92453d47ab5ebfc8863
Author:     Andi Kleen <ak@linux.intel.com>
AuthorDate: Thu, 11 Jul 2019 11:19:22 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20190711181922.18765-3-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-script.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index 042b9e5dcc32..caaab28f8400 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -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:

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [tip:perf/urgent] perf script: Fix off by one in brstackinsn IPC computation
  2019-07-11 18:19 ` [PATCH 2/3] perf script: Fix off by one in brstackinsn IPC computation Andi Kleen
  2019-07-16 18:44   ` Arnaldo Carvalho de Melo
@ 2019-07-23 21:47   ` " tip-bot for Andi Kleen
  1 sibling, 0 replies; 9+ messages in thread
From: tip-bot for Andi Kleen @ 2019-07-23 21:47 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, tglx, linux-kernel, acme, hpa, jolsa, denis.bakhvalov, ak

Commit-ID:  dde4e732a5b02fa5599c2c0e6c48a0c11789afc4
Gitweb:     https://git.kernel.org/tip/dde4e732a5b02fa5599c2c0e6c48a0c11789afc4
Author:     Andi Kleen <ak@linux.intel.com>
AuthorDate: Thu, 11 Jul 2019 11:19:21 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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 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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 8f24865596af..0140ddb8dd0b 100644
--- 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);

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, back to index

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11 18:19 [PATCH 1/3] perf script: Fix --max-blocks man page description Andi Kleen
2019-07-11 18:19 ` [PATCH 2/3] perf script: Fix off by one in brstackinsn IPC computation Andi Kleen
2019-07-16 18:44   ` Arnaldo Carvalho de Melo
2019-07-23 21:47   ` [tip:perf/urgent] " tip-bot for Andi Kleen
2019-07-11 18:19 ` [PATCH 3/3] perf script: Improve man page description of metrics Andi Kleen
2019-07-16 18:45   ` Arnaldo Carvalho de Melo
2019-07-23 21:47   ` [tip:perf/urgent] " tip-bot for Andi Kleen
2019-07-16 18:43 ` [PATCH 1/3] perf script: Fix --max-blocks man page description Arnaldo Carvalho de Melo
2019-07-23 21:46 ` [tip:perf/urgent] " tip-bot for Andi Kleen

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git