LKML Archive on
 help / color / Atom feed
From: Jiri Olsa <>
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 <>
Subject: [PATCH] perf tools: Fix proper buffer size for feature processing
Date: Mon, 15 Jul 2019 16:04:26 +0200
Message-ID: <> (raw)

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 <>
Cc: Song Liu <>
Cc: Kan Liang <>
Reported-by: Arnaldo Carvalho de Melo <>
Fixes: e9def1b2e74e ("perf tools: Add feature header record to pipe-mode")
Signed-off-by: Jiri Olsa <>
 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); = &session->header;
 	if (feat_ops[feat].process(&ff, NULL))

             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 14:04 Jiri Olsa [this message]
2019-07-16 18:46 ` Arnaldo Carvalho de Melo
2019-07-23 21:48 ` [tip:perf/urgent] " tip-bot for Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git
	git clone --mirror lkml/git/9.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/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone