All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bugfix perf script -F ip,brstack (and brstackoff)
@ 2017-10-06  8:07 Mark Santaniello
  2017-10-06 12:25 ` Arnaldo Carvalho de Melo
  2017-10-10 17:28 ` [tip:perf/urgent] perf script: Add missing separator for "-F ip,brstack" " tip-bot for Mark Santaniello
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Santaniello @ 2017-10-06  8:07 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin
  Cc: linux-kernel, Mark Santaniello

Prior to commit 55b9b50811ca ("perf script: Support -F brstack,dso and
brstacksym,dso"), we were printing a space before the brstack data. It
seems that this space was important.  Without it, parsing is difficult.

Very sorry for the mistake.

Notice here how the "ip" and "brstack" run together:

$ perf script -F ip,brstack | head -n 1
          22e18c40x22e19e2/0x22e190b/P/-/-/0 0x22e19a1/0x22e19d0/P/-/-/0 0x22e195d/0x22e1990/P/-/-/0 0x22e18e9/0x22e1943/P/-/-/0 0x22e1a69/0x22e18c0/P/-/-/0 0x22e19f7/0x22e1a20/P/-/-/0 0x22e1910/0x22e19ee/P/-/-/0 0x22e19e2/0x22e190b/P/-/-/0 0x22e19a1/0x22e19d0/P/-/-/0 0x22e195d/0x22e1990/P/-/-/0 0x22e18e9/0x22e1943/P/-/-/0 0x22e1a69/0x22e18c0/P/-/-/0 0x22e19f7/0x22e1a20/P/-/-/0 0x22e1910/0x22e19ee/P/-/-/0 0x22e19e2/0x22e190b/P/-/-/0 0x22e19a1/0x22e19d0/P/-/-/0

After this diff, sanity is restored:

$ perf script -F ip,brstack | head -n 1
          22e18c4 0x22e19e2/0x22e190b/P/-/-/0  0x22e19a1/0x22e19d0/P/-/-/0  0x22e195d/0x22e1990/P/-/-/0  0x22e18e9/0x22e1943/P/-/-/0  0x22e1a69/0x22e18c0/P/-/-/0  0x22e19f7/0x22e1a20/P/-/-/0  0x22e1910/0x22e19ee/P/-/-/0  0x22e19e2/0x22e190b/P/-/-/0  0x22e19a1/0x22e19d0/P/-/-/0  0x22e195d/0x22e1990/P/-/-/0  0x22e18e9/0x22e1943/P/-/-/0  0x22e1a69/0x22e18c0/P/-/-/0  0x22e19f7/0x22e1a20/P/-/-/0  0x22e1910/0x22e19ee/P/-/-/0  0x22e19e2/0x22e190b/P/-/-/0  0x22e19a1/0x22e19d0/P/-/-/0

Signed-off-by: Mark Santaniello <marksan@fb.com>
---
 tools/perf/builtin-script.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 3d4c3b5..0c977b6 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -586,7 +586,7 @@ static void print_sample_brstack(struct perf_sample *sample,
 			thread__find_addr_map(thread, sample->cpumode, MAP__FUNCTION, to, &alt);
 		}
 
-		printf("0x%"PRIx64, from);
+		printf(" 0x%"PRIx64, from);
 		if (PRINT_FIELD(DSO)) {
 			printf("(");
 			map__fprintf_dsoname(alf.map, stdout);
@@ -681,7 +681,7 @@ static void print_sample_brstackoff(struct perf_sample *sample,
 		if (alt.map && !alt.map->dso->adjust_symbols)
 			to = map__map_ip(alt.map, to);
 
-		printf("0x%"PRIx64, from);
+		printf(" 0x%"PRIx64, from);
 		if (PRINT_FIELD(DSO)) {
 			printf("(");
 			map__fprintf_dsoname(alf.map, stdout);
-- 
2.9.5

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

* Re: [PATCH] Bugfix perf script -F ip,brstack (and brstackoff)
  2017-10-06  8:07 [PATCH] Bugfix perf script -F ip,brstack (and brstackoff) Mark Santaniello
@ 2017-10-06 12:25 ` Arnaldo Carvalho de Melo
  2017-10-10 17:28 ` [tip:perf/urgent] perf script: Add missing separator for "-F ip,brstack" " tip-bot for Mark Santaniello
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-10-06 12:25 UTC (permalink / raw)
  To: Mark Santaniello
  Cc: Peter Zijlstra, Ingo Molnar, Alexander Shishkin, linux-kernel

Em Fri, Oct 06, 2017 at 01:07:22AM -0700, Mark Santaniello escreveu:
> Prior to commit 55b9b50811ca ("perf script: Support -F brstack,dso and
> brstacksym,dso"), we were printing a space before the brstack data. It
> seems that this space was important.  Without it, parsing is difficult.
> 
> Very sorry for the mistake.

Thanks, applied and added:

    Cc: 4.13+ <stable@vger.kernel.org>

As:

[acme@jouet linux]$ git tag --contains 55b9b50811ca | grep ^v4
v4.13
v4.13-rc1
v4.13-rc2
v4.13-rc3
v4.13-rc4
v4.13-rc5
v4.13-rc6
v4.13-rc7
v4.14-rc1
v4.14-rc2
v4.14-rc3
[acme@jouet linux]$
 
> Notice here how the "ip" and "brstack" run together:
> 
> $ perf script -F ip,brstack | head -n 1
>           22e18c40x22e19e2/0x22e190b/P/-/-/0 0x22e19a1/0x22e19d0/P/-/-/0 0x22e195d/0x22e1990/P/-/-/0 0x22e18e9/0x22e1943/P/-/-/0 0x22e1a69/0x22e18c0/P/-/-/0 0x22e19f7/0x22e1a20/P/-/-/0 0x22e1910/0x22e19ee/P/-/-/0 0x22e19e2/0x22e190b/P/-/-/0 0x22e19a1/0x22e19d0/P/-/-/0 0x22e195d/0x22e1990/P/-/-/0 0x22e18e9/0x22e1943/P/-/-/0 0x22e1a69/0x22e18c0/P/-/-/0 0x22e19f7/0x22e1a20/P/-/-/0 0x22e1910/0x22e19ee/P/-/-/0 0x22e19e2/0x22e190b/P/-/-/0 0x22e19a1/0x22e19d0/P/-/-/0
> 
> After this diff, sanity is restored:
> 
> $ perf script -F ip,brstack | head -n 1
>           22e18c4 0x22e19e2/0x22e190b/P/-/-/0  0x22e19a1/0x22e19d0/P/-/-/0  0x22e195d/0x22e1990/P/-/-/0  0x22e18e9/0x22e1943/P/-/-/0  0x22e1a69/0x22e18c0/P/-/-/0  0x22e19f7/0x22e1a20/P/-/-/0  0x22e1910/0x22e19ee/P/-/-/0  0x22e19e2/0x22e190b/P/-/-/0  0x22e19a1/0x22e19d0/P/-/-/0  0x22e195d/0x22e1990/P/-/-/0  0x22e18e9/0x22e1943/P/-/-/0  0x22e1a69/0x22e18c0/P/-/-/0  0x22e19f7/0x22e1a20/P/-/-/0  0x22e1910/0x22e19ee/P/-/-/0  0x22e19e2/0x22e190b/P/-/-/0  0x22e19a1/0x22e19d0/P/-/-/0
> 
> Signed-off-by: Mark Santaniello <marksan@fb.com>
> ---
>  tools/perf/builtin-script.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index 3d4c3b5..0c977b6 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -586,7 +586,7 @@ static void print_sample_brstack(struct perf_sample *sample,
>  			thread__find_addr_map(thread, sample->cpumode, MAP__FUNCTION, to, &alt);
>  		}
>  
> -		printf("0x%"PRIx64, from);
> +		printf(" 0x%"PRIx64, from);
>  		if (PRINT_FIELD(DSO)) {
>  			printf("(");
>  			map__fprintf_dsoname(alf.map, stdout);
> @@ -681,7 +681,7 @@ static void print_sample_brstackoff(struct perf_sample *sample,
>  		if (alt.map && !alt.map->dso->adjust_symbols)
>  			to = map__map_ip(alt.map, to);
>  
> -		printf("0x%"PRIx64, from);
> +		printf(" 0x%"PRIx64, from);
>  		if (PRINT_FIELD(DSO)) {
>  			printf("(");
>  			map__fprintf_dsoname(alf.map, stdout);
> -- 
> 2.9.5

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

* [tip:perf/urgent] perf script: Add missing separator for "-F ip,brstack" (and brstackoff)
  2017-10-06  8:07 [PATCH] Bugfix perf script -F ip,brstack (and brstackoff) Mark Santaniello
  2017-10-06 12:25 ` Arnaldo Carvalho de Melo
@ 2017-10-10 17:28 ` tip-bot for Mark Santaniello
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Mark Santaniello @ 2017-10-10 17:28 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: marksan, tglx, stable, linux-kernel, hpa, peterz,
	alexander.shishkin, acme, mingo

Commit-ID:  e9516c0813aeb89ebd19ec0ed39fbfcd78b6ef3a
Gitweb:     https://git.kernel.org/tip/e9516c0813aeb89ebd19ec0ed39fbfcd78b6ef3a
Author:     Mark Santaniello <marksan@fb.com>
AuthorDate: Fri, 6 Oct 2017 01:07:22 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 6 Oct 2017 09:48:32 -0300

perf script: Add missing separator for "-F ip,brstack" (and brstackoff)

Prior to commit 55b9b50811ca ("perf script: Support -F brstack,dso and
brstacksym,dso"), we were printing a space before the brstack data. It
seems that this space was important.  Without it, parsing is difficult.

Very sorry for the mistake.

Notice here how the "ip" and "brstack" run together:

$ perf script -F ip,brstack | head -n 1
          22e18c40x22e19e2/0x22e190b/P/-/-/0 0x22e19a1/0x22e19d0/P/-/-/0 0x22e195d/0x22e1990/P/-/-/0 0x22e18e9/0x22e1943/P/-/-/0 0x22e1a69/0x22e18c0/P/-/-/0 0x22e19f7/0x22e1a20/P/-/-/0 0x22e1910/0x22e19ee/P/-/-/0 0x22e19e2/0x22e190b/P/-/-/0 0x22e19a1/0x22e19d0/P/-/-/0 0x22e195d/0x22e1990/P/-/-/0 0x22e18e9/0x22e1943/P/-/-/0 0x22e1a69/0x22e18c0/P/-/-/0 0x22e19f7/0x22e1a20/P/-/-/0 0x22e1910/0x22e19ee/P/-/-/0 0x22e19e2/0x22e190b/P/-/-/0 0x22e19a1/0x22e19d0/P/-/-/0

After this diff, sanity is restored:

$ perf script -F ip,brstack | head -n 1
          22e18c4 0x22e19e2/0x22e190b/P/-/-/0  0x22e19a1/0x22e19d0/P/-/-/0  0x22e195d/0x22e1990/P/-/-/0  0x22e18e9/0x22e1943/P/-/-/0  0x22e1a69/0x22e18c0/P/-/-/0  0x22e19f7/0x22e1a20/P/-/-/0  0x22e1910/0x22e19ee/P/-/-/0  0x22e19e2/0x22e190b/P/-/-/0  0x22e19a1/0x22e19d0/P/-/-/0  0x22e195d/0x22e1990/P/-/-/0  0x22e18e9/0x22e1943/P/-/-/0  0x22e1a69/0x22e18c0/P/-/-/0  0x22e19f7/0x22e1a20/P/-/-/0  0x22e1910/0x22e19ee/P/-/-/0  0x22e19e2/0x22e190b/P/-/-/0  0x22e19a1/0x22e19d0/P/-/-/0

Signed-off-by: Mark Santaniello <marksan@fb.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: 4.13+ <stable@vger.kernel.org>
Fixes: 55b9b50811ca ("perf script: Support -F brstack,dso and brstacksym,dso")
Link: http://lkml.kernel.org/r/20171006080722.3442046-1-marksan@fb.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-script.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 3d4c3b5..0c977b6 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -586,7 +586,7 @@ static void print_sample_brstack(struct perf_sample *sample,
 			thread__find_addr_map(thread, sample->cpumode, MAP__FUNCTION, to, &alt);
 		}
 
-		printf("0x%"PRIx64, from);
+		printf(" 0x%"PRIx64, from);
 		if (PRINT_FIELD(DSO)) {
 			printf("(");
 			map__fprintf_dsoname(alf.map, stdout);
@@ -681,7 +681,7 @@ static void print_sample_brstackoff(struct perf_sample *sample,
 		if (alt.map && !alt.map->dso->adjust_symbols)
 			to = map__map_ip(alt.map, to);
 
-		printf("0x%"PRIx64, from);
+		printf(" 0x%"PRIx64, from);
 		if (PRINT_FIELD(DSO)) {
 			printf("(");
 			map__fprintf_dsoname(alf.map, stdout);

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

end of thread, other threads:[~2017-10-10 17:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-06  8:07 [PATCH] Bugfix perf script -F ip,brstack (and brstackoff) Mark Santaniello
2017-10-06 12:25 ` Arnaldo Carvalho de Melo
2017-10-10 17:28 ` [tip:perf/urgent] perf script: Add missing separator for "-F ip,brstack" " tip-bot for Mark Santaniello

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.