Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-08-16 22:01:45 +0200
committerJiri Slaby <jslaby@suse.cz>2019-08-16 22:25:10 +0200
commita7f0a80ffdd03d015e8e1ca1fa1077aa4c8a5f1c (patch)
tree57e733573b259d8d015efc3092e2d91b31a23791
parent644116cba4459f9f44b6d7f28c20e61ab427bd23 (diff)
perf tools: Fix proper buffer size for feature processing
-rw-r--r--patches.kernel.org/5.2.9-097-perf-tools-Fix-proper-buffer-size-for-feature-p.patch53
-rw-r--r--series.conf1
2 files changed, 54 insertions, 0 deletions
diff --git a/patches.kernel.org/5.2.9-097-perf-tools-Fix-proper-buffer-size-for-feature-p.patch b/patches.kernel.org/5.2.9-097-perf-tools-Fix-proper-buffer-size-for-feature-p.patch
new file mode 100644
index 0000000000..13a84214f1
--- /dev/null
+++ b/patches.kernel.org/5.2.9-097-perf-tools-Fix-proper-buffer-size-for-feature-p.patch
@@ -0,0 +1,53 @@
+From: Jiri Olsa <jolsa@kernel.org>
+Date: Mon, 15 Jul 2019 16:04:26 +0200
+Subject: [PATCH] perf tools: Fix proper buffer size for feature processing
+References: bnc#1012628
+Patch-mainline: 5.2.9
+Git-commit: 79b2fe5e756163897175a8f57d66b26cd9befd59
+
+[ Upstream commit 79b2fe5e756163897175a8f57d66b26cd9befd59 ]
+
+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>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ 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 b82d4577d969..e84b70be3fc1 100644
+--- a/tools/perf/util/header.c
++++ b/tools/perf/util/header.c
+@@ -3666,7 +3666,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.22.0
+
diff --git a/series.conf b/series.conf
index 3e859aa687..e8f0a3caec 100644
--- a/series.conf
+++ b/series.conf
@@ -1117,6 +1117,7 @@
patches.kernel.org/5.2.9-094-ALSA-compress-Don-t-allow-paritial-drain-operat.patch
patches.kernel.org/5.2.9-095-ALSA-compress-Be-more-restrictive-about-when-a-.patch
patches.kernel.org/5.2.9-096-perf-script-Fix-off-by-one-in-brstackinsn-IPC-c.patch
+ patches.kernel.org/5.2.9-097-perf-tools-Fix-proper-buffer-size-for-feature-p.patch
########################################################
# Build fixes that apply to the vanilla kernel too.