[linux] 01/01: Fix perf to be able to find debug info based on build-id.
debian-kernel at lists.debian.org
debian-kernel at lists.debian.org
Sun Jul 31 20:35:21 UTC 2016
This is an automated email from the git hooks/post-receive script.
ukleinek pushed a commit to branch sid
in repository linux.
commit f8edc4357a254cc615ffadb55f0da23885bcd281
Author: Uwe Kleine-König <ukleinek at debian.org>
Date: Sun Jul 31 22:35:09 2016 +0200
Fix perf to be able to find debug info based on build-id.
---
debian/changelog | 5 ++
...s-Use-proper-dso-name-for-is_regular_file.patch | 88 ++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 94 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 1ad0b91..ecc53d7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
linux (4.6.5-1) UNRELEASED; urgency=medium
+ [ Ben Hutchings ]
* New upstream stable update:
https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.6.5
- cfg80211: remove get/set antenna and tx power warnings
@@ -205,6 +206,10 @@ linux (4.6.5-1) UNRELEASED; urgency=medium
- ovl: Do d_type check only if work dir creation was successful
- ovl: warn instead of error if d_type is not supported
+ [ Uwe Kleine-König ]
+ * Fix perf to be able to find debug info based on build-id. (Closes:
+ #833096)
+
-- Ben Hutchings <ben at decadent.org.uk> Sat, 30 Jul 2016 14:23:58 +0100
linux (4.6.4-1) unstable; urgency=medium
diff --git a/debian/patches/bugfix/all/perf-symbols-Use-proper-dso-name-for-is_regular_file.patch b/debian/patches/bugfix/all/perf-symbols-Use-proper-dso-name-for-is_regular_file.patch
new file mode 100644
index 0000000..6749bc2
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-symbols-Use-proper-dso-name-for-is_regular_file.patch
@@ -0,0 +1,88 @@
+From ed7b630b310775f3b6c0b360ede7a12cd8dff6fe Mon Sep 17 00:00:00 2001
+From: Jiri Olsa <jolsa at redhat.com>
+Date: Fri, 24 Jun 2016 14:40:25 +0200
+Subject: [PATCH] perf symbols: Use proper dso name for is_regular_file
+Origin: https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=ed7b630b310775f3b6c0b360ede7a12cd8dff6fe
+
+Marc reported use of uninitialized memory:
+
+> In commit "403567217d3f perf symbols: Do not read symbols/data from
+> device files" a check to uninitialzied memory was added. This leads to
+> the following valgrind output:
+>
+> ==24515== Syscall param stat(file_name) points to uninitialised byte(s)
+> ==24515== at 0x75B26D5: _xstat (in /lib/x86_64-linux-gnu/libc-2.22.so)
+> ==24515== by 0x4E548D: stat (stat.h:454)
+> ==24515== by 0x4E548D: is_regular_file (util.c:687)
+> ==24515== by 0x4A5BEE: dso__load (symbol.c:1435)
+> ==24515== by 0x4BB1AE: map__load (map.c:289)
+> ==24515== by 0x4BB1AE: map__find_symbol (map.c:333)
+> ==24515== by 0x4835B3: thread__find_addr_location (event.c:1300)
+> ==24515== by 0x4B5342: add_callchain_ip (machine.c:1652)
+> ==24515== by 0x4B5342: thread__resolve_callchain_sample (machine.c:1906)
+> ==24515== by 0x4B9E7D: thread__resolve_callchain (machine.c:1958)
+> ==24515== by 0x441B3E: process_event (builtin-script.c:795)
+> ==24515== by 0x441B3E: process_sample_event (builtin-script.c:920)
+> ==24515== by 0x4BEE29: perf_evlist__deliver_sample (session.c:1192)
+> ==24515== by 0x4BEE29: machines__deliver_event (session.c:1229)
+> ==24515== by 0x4BF770: perf_session__deliver_event (session.c:1286)
+> ==24515== by 0x4BF770: ordered_events__deliver_event (session.c:114)
+> ==24515== by 0x4C1D17: __ordered_events__flush (ordered-events.c:207)
+> ==24515== by 0x4C1D17: ordered_events__flush.part.3 (ordered-events.c:274)
+> ==24515== by 0x4BF44C: perf_session__process_user_event (session.c:1325)
+> ==24515== by 0x4BF44C: perf_session__process_event (session.c:1451)
+> ==24515== Address 0x807c6a0 is 0 bytes inside a block of size 4,096 alloc'd
+> ==24515== at 0x4C29C0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
+> ==24515== by 0x4A5BCB: dso__load (symbol.c:1421)
+> ==24515== by 0x4BB1AE: map__load (map.c:289)
+> ==24515== by 0x4BB1AE: map__find_symbol (map.c:333)
+> ==24515== by 0x4835B3: thread__find_addr_location (event.c:1300)
+> ==24515== by 0x4B5342: add_callchain_ip (machine.c:1652)
+> ==24515== by 0x4B5342: thread__resolve_callchain_sample (machine.c:1906)
+> ==24515== by 0x4B9E7D: thread__resolve_callchain (machine.c:1958)
+> ==24515== by 0x441B3E: process_event (builtin-script.c:795)
+> ==24515== by 0x441B3E: process_sample_event (builtin-script.c:920)
+> ==24515== by 0x4BEE29: perf_evlist__deliver_sample (session.c:1192)
+> ==24515== by 0x4BEE29: machines__deliver_event (session.c:1229)
+> ==24515== by 0x4BF770: perf_session__deliver_event (session.c:1286)
+> ==24515== by 0x4BF770: ordered_events__deliver_event (session.c:114)
+> ==24515== by 0x4C1D17: __ordered_events__flush (ordered-events.c:207)
+> ==24515== by 0x4C1D17: ordered_events__flush.part.3 (ordered-events.c:274)
+> ==24515== by 0x4BF44C: perf_session__process_user_event (session.c:1325)
+> ==24515== by 0x4BF44C: perf_session__process_event (session.c:1451)
+> ==24515== by 0x4C0EAC: __perf_session__process_events (session.c:1804)
+> ==24515== by 0x4C0EAC: perf_session__process_events (session.c:1858)
+
+The reason was a typo that passed global 'name' variable as the
+is_regular_file argument instead dso->long_name.
+
+Reported-by: Marc Kleine-Budde <mkl at pengutronix.de>
+Signed-off-by: Jiri Olsa <jolsa at kernel.org>
+Acked-by: Marc Kleine-Budde <mkl at pengutronix.de>
+Cc: David Ahern <dsahern at gmail.com>
+Cc: Namhyung Kim <namhyung at kernel.org>
+Cc: Peter Zijlstra <a.p.zijlstra at chello.nl>
+Cc: Wang Nan <wangnan0 at huawei.com>
+Fixes: 403567217d3f ("perf symbols: Do not read symbols/data from device files")
+Link: http://lkml.kernel.org/r/1466772025-17471-2-git-send-email-jolsa@kernel.org
+Signed-off-by: Arnaldo Carvalho de Melo <acme at redhat.com>
+---
+ tools/perf/util/symbol.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
+index b044f1a32d16..37e8d20ae03e 100644
+--- a/tools/perf/util/symbol.c
++++ b/tools/perf/util/symbol.c
+@@ -1430,7 +1430,7 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
+ * Read the build id if possible. This is required for
+ * DSO_BINARY_TYPE__BUILDID_DEBUGINFO to work
+ */
+- if (is_regular_file(name) &&
++ if (is_regular_file(dso->long_name) &&
+ filename__read_build_id(dso->long_name, build_id, BUILD_ID_SIZE) > 0)
+ dso__set_build_id(dso, build_id);
+
+--
+2.8.1
+
diff --git a/debian/patches/series b/debian/patches/series
index 41d22eb..14f6244 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -138,6 +138,7 @@ bugfix/all/liblockdep-enable-wall-by-default.patch
bugfix/all/liblockdep-fix-unused-value-warnings.patch
bugfix/all/liblockdep-fix-set-but-not-used-warnings.patch
bugfix/all/liblockdep-fix-defined-but-not-used-warning-for-init.patch
+bugfix/all/perf-symbols-Use-proper-dso-name-for-is_regular_file.patch
# Debian bug #794266
bugfix/all/rtc-initialize-output-parameter-for-read-alarm-to-un.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git
More information about the Kernel-svn-changes
mailing list