LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] perf tools: Fix proper buffer size for feature processing
@ 2019-07-15 14:04 Jiri Olsa
  2019-07-16 18:46 ` Arnaldo Carvalho de Melo
  2019-07-23 21:48 ` [tip:perf/urgent] " tip-bot for Jiri Olsa
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Olsa @ 2019-07-15 14:04 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: David Carrillo-Cisneros, Song Liu, Kan Liang,
	Arnaldo Carvalho de Melo, lkml, Ingo Molnar, Namhyung Kim,
	Alexander Shishkin, Peter Zijlstra

After Song Liu's segfault fix for pipe mode, Arnaldo reported
following error:

  # perf record -o - | perf script
  0x514 [0x1ac]: failed to process type: 80

It's caused by wrong buffer size setup in feature processing,
which makes cpu topology feature fail, because it's using
buffer size to recognize its header version.

Cc: David Carrillo-Cisneros <davidcc@google.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Fixes: e9def1b2e74e ("perf tools: Add feature header record to pipe-mode")
Link: http://lkml.kernel.org/n/tip-2lj87zz8tq9ye1ntax3ulw0n@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/util/header.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index c24db7f4909c..20111f8da5cb 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -3747,7 +3747,7 @@ int perf_event__process_feature(struct perf_session *session,
 		return 0;
 
 	ff.buf  = (void *)fe->data;
-	ff.size = event->header.size - sizeof(event->header);
+	ff.size = event->header.size - sizeof(*fe);
 	ff.ph = &session->header;
 
 	if (feat_ops[feat].process(&ff, NULL))
-- 
2.21.0


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

* Re: [PATCH] perf tools: Fix proper buffer size for feature processing
  2019-07-15 14:04 [PATCH] perf tools: Fix proper buffer size for feature processing Jiri Olsa
@ 2019-07-16 18:46 ` Arnaldo Carvalho de Melo
  2019-07-23 21:48 ` [tip:perf/urgent] " tip-bot for Jiri Olsa
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-07-16 18:46 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: David Carrillo-Cisneros, Song Liu, Kan Liang,
	Arnaldo Carvalho de Melo, lkml, Ingo Molnar, Namhyung Kim,
	Alexander Shishkin, Peter Zijlstra

Em Mon, Jul 15, 2019 at 04:04:26PM +0200, Jiri Olsa escreveu:
> After Song Liu's segfault fix for pipe mode, Arnaldo reported
> following error:
> 
>   # perf record -o - | perf script
>   0x514 [0x1ac]: failed to process type: 80

Thanks, tested and applied.

- Arnaldo

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

* [tip:perf/urgent] perf tools: Fix proper buffer size for feature processing
  2019-07-15 14:04 [PATCH] perf tools: Fix proper buffer size for feature processing Jiri Olsa
  2019-07-16 18:46 ` Arnaldo Carvalho de Melo
@ 2019-07-23 21:48 ` tip-bot for Jiri Olsa
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Jiri Olsa @ 2019-07-23 21:48 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: alexander.shishkin, davidcc, kan.liang, acme, peterz,
	linux-kernel, tglx, hpa, jolsa, mingo, namhyung, songliubraving

Commit-ID:  79b2fe5e756163897175a8f57d66b26cd9befd59
Gitweb:     https://git.kernel.org/tip/79b2fe5e756163897175a8f57d66b26cd9befd59
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Mon, 15 Jul 2019 16:04:26 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 23 Jul 2019 08:59:49 -0300

perf tools: Fix proper buffer size for feature processing

After Song Liu's segfault fix for pipe mode, Arnaldo reported following
error:

  # perf record -o - | perf script
  0x514 [0x1ac]: failed to process type: 80

It's caused by wrong buffer size setup in feature processing, which
makes cpu topology feature fail, because it's using buffer size to
recognize its header version.

Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Carrillo-Cisneros <davidcc@google.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Fixes: e9def1b2e74e ("perf tools: Add feature header record to pipe-mode")
Link: http://lkml.kernel.org/r/20190715140426.32509-1-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/header.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index c24db7f4909c..20111f8da5cb 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -3747,7 +3747,7 @@ int perf_event__process_feature(struct perf_session *session,
 		return 0;
 
 	ff.buf  = (void *)fe->data;
-	ff.size = event->header.size - sizeof(event->header);
+	ff.size = event->header.size - sizeof(*fe);
 	ff.ph = &session->header;
 
 	if (feat_ops[feat].process(&ff, NULL))

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

end of thread, other threads:[~2019-07-23 21:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15 14:04 [PATCH] perf tools: Fix proper buffer size for feature processing Jiri Olsa
2019-07-16 18:46 ` Arnaldo Carvalho de Melo
2019-07-23 21:48 ` [tip:perf/urgent] " tip-bot for Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).