[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190715140426.32509-1-jolsa@kernel.org>
Date: Mon, 15 Jul 2019 16:04:26 +0200
From: Jiri Olsa <jolsa@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: David Carrillo-Cisneros <davidcc@...gle.com>,
Song Liu <songliubraving@...com>,
Kan Liang <kan.liang@...ux.intel.com>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
lkml <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: [PATCH] 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.
Cc: David Carrillo-Cisneros <davidcc@...gle.com>
Cc: Song Liu <songliubraving@...com>
Cc: Kan Liang <kan.liang@...ux.intel.com>
Reported-by: Arnaldo Carvalho de Melo <acme@...hat.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@...nel.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
Powered by blists - more mailing lists