From: Greg Kroah-Hartman Date: Fri, 19 Jun 2020 14:09:04 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v4.4.228~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=89d687886989b4589ce9d9512d41c4df32737526;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: perf-probe-do-not-show-the-skipped-events.patch perf-symbols-fix-debuginfo-search-for-ubuntu.patch --- diff --git a/queue-4.4/perf-probe-do-not-show-the-skipped-events.patch b/queue-4.4/perf-probe-do-not-show-the-skipped-events.patch new file mode 100644 index 00000000000..050003935a0 --- /dev/null +++ b/queue-4.4/perf-probe-do-not-show-the-skipped-events.patch @@ -0,0 +1,67 @@ +From f41ebe9defacddeae96a872a33f0f22ced0bfcef Mon Sep 17 00:00:00 2001 +From: Masami Hiramatsu +Date: Thu, 23 Apr 2020 20:01:22 +0900 +Subject: perf probe: Do not show the skipped events + +From: Masami Hiramatsu + +commit f41ebe9defacddeae96a872a33f0f22ced0bfcef upstream. + +When a probe point is expanded to several places (like inlined) and if +some of them are skipped because of blacklisted or __init function, +those trace_events has no event name. It must be skipped while showing +results. + +Without this fix, you can see "(null):(null)" on the list, + + # ./perf probe request_resource + reserve_setup is out of .text, skip it. + Added new events: + (null):(null) (on request_resource) + probe:request_resource (on request_resource) + + You can now use it in all perf tools, such as: + + perf record -e probe:request_resource -aR sleep 1 + + # + +With this fix, it is ignored: + + # ./perf probe request_resource + reserve_setup is out of .text, skip it. + Added new events: + probe:request_resource (on request_resource) + + You can now use it in all perf tools, such as: + + perf record -e probe:request_resource -aR sleep 1 + + # + +Fixes: 5a51fcd1f30c ("perf probe: Skip kernel symbols which is out of .text") +Signed-off-by: Masami Hiramatsu +Tested-by: Arnaldo Carvalho de Melo +Cc: Jiri Olsa +Cc: Namhyung Kim +Cc: stable@vger.kernel.org +Link: http://lore.kernel.org/lkml/158763968263.30755.12800484151476026340.stgit@devnote2 +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/builtin-probe.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/tools/perf/builtin-probe.c ++++ b/tools/perf/builtin-probe.c +@@ -336,6 +336,9 @@ static int perf_add_probe_events(struct + + for (k = 0; k < pev->ntevs; k++) { + struct probe_trace_event *tev = &pev->tevs[k]; ++ /* Skipped events have no event name */ ++ if (!tev->event) ++ continue; + + /* We use tev's name for showing new events */ + show_perf_probe_event(tev->group, tev->event, pev, diff --git a/queue-4.4/perf-symbols-fix-debuginfo-search-for-ubuntu.patch b/queue-4.4/perf-symbols-fix-debuginfo-search-for-ubuntu.patch new file mode 100644 index 00000000000..b1f06562526 --- /dev/null +++ b/queue-4.4/perf-symbols-fix-debuginfo-search-for-ubuntu.patch @@ -0,0 +1,123 @@ +From 85afd35575a3c1a3a905722dde5ee70b49282e70 Mon Sep 17 00:00:00 2001 +From: Adrian Hunter +Date: Tue, 26 May 2020 18:52:07 +0300 +Subject: perf symbols: Fix debuginfo search for Ubuntu + +From: Adrian Hunter + +commit 85afd35575a3c1a3a905722dde5ee70b49282e70 upstream. + +Reportedly, from 19.10 Ubuntu has begun mixing up the location of some +debug symbol files, putting files expected to be in +/usr/lib/debug/usr/lib into /usr/lib/debug/lib instead. Fix by adding +another dso_binary_type. + +Example on Ubuntu 20.04 + + Before: + + $ perf record -e intel_pt//u uname + Linux + [ perf record: Woken up 1 times to write data ] + [ perf record: Captured and wrote 0.030 MB perf.data ] + $ perf script --call-trace | head -5 + uname 14003 [005] 15321.764958566: cbr: 42 freq: 4219 MHz (156%) + uname 14003 [005] 15321.764958566: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) 7f1e71cc4100 + uname 14003 [005] 15321.764961566: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) 7f1e71cc4df0 + uname 14003 [005] 15321.764961900: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) 7f1e71cc4e18 + uname 14003 [005] 15321.764963233: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) 7f1e71cc5128 + + After: + + $ perf script --call-trace | head -5 + uname 14003 [005] 15321.764958566: cbr: 42 freq: 4219 MHz (156%) + uname 14003 [005] 15321.764958566: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) _start + uname 14003 [005] 15321.764961566: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) _dl_start + uname 14003 [005] 15321.764961900: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) _dl_start + uname 14003 [005] 15321.764963233: (/usr/lib/x86_64-linux-gnu/ld-2.31.so ) _dl_start + +Reported-by: Travis Downs +Signed-off-by: Adrian Hunter +Cc: Jiri Olsa +Cc: stable@vger.kernel.org +Link: http://lore.kernel.org/lkml/20200526155207.9172-1-adrian.hunter@intel.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/util/dso.c | 16 ++++++++++++++++ + tools/perf/util/dso.h | 1 + + tools/perf/util/probe-finder.c | 1 + + tools/perf/util/symbol.c | 2 ++ + 4 files changed, 20 insertions(+) + +--- a/tools/perf/util/dso.c ++++ b/tools/perf/util/dso.c +@@ -18,6 +18,7 @@ char dso__symtab_origin(const struct dso + [DSO_BINARY_TYPE__BUILD_ID_CACHE] = 'B', + [DSO_BINARY_TYPE__FEDORA_DEBUGINFO] = 'f', + [DSO_BINARY_TYPE__UBUNTU_DEBUGINFO] = 'u', ++ [DSO_BINARY_TYPE__MIXEDUP_UBUNTU_DEBUGINFO] = 'x', + [DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO] = 'o', + [DSO_BINARY_TYPE__BUILDID_DEBUGINFO] = 'b', + [DSO_BINARY_TYPE__SYSTEM_PATH_DSO] = 'd', +@@ -73,6 +74,21 @@ int dso__read_binary_type_filename(const + snprintf(filename + len, size - len, "%s", dso->long_name); + break; + ++ case DSO_BINARY_TYPE__MIXEDUP_UBUNTU_DEBUGINFO: ++ /* ++ * Ubuntu can mixup /usr/lib with /lib, putting debuginfo in ++ * /usr/lib/debug/lib when it is expected to be in ++ * /usr/lib/debug/usr/lib ++ */ ++ if (strlen(dso->long_name) < 9 || ++ strncmp(dso->long_name, "/usr/lib/", 9)) { ++ ret = -1; ++ break; ++ } ++ len = __symbol__join_symfs(filename, size, "/usr/lib/debug"); ++ snprintf(filename + len, size - len, "%s", dso->long_name + 4); ++ break; ++ + case DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO: + { + const char *last_slash; +--- a/tools/perf/util/dso.h ++++ b/tools/perf/util/dso.h +@@ -21,6 +21,7 @@ enum dso_binary_type { + DSO_BINARY_TYPE__BUILD_ID_CACHE, + DSO_BINARY_TYPE__FEDORA_DEBUGINFO, + DSO_BINARY_TYPE__UBUNTU_DEBUGINFO, ++ DSO_BINARY_TYPE__MIXEDUP_UBUNTU_DEBUGINFO, + DSO_BINARY_TYPE__BUILDID_DEBUGINFO, + DSO_BINARY_TYPE__SYSTEM_PATH_DSO, + DSO_BINARY_TYPE__GUEST_KMODULE, +--- a/tools/perf/util/probe-finder.c ++++ b/tools/perf/util/probe-finder.c +@@ -110,6 +110,7 @@ enum dso_binary_type distro_dwarf_types[ + DSO_BINARY_TYPE__UBUNTU_DEBUGINFO, + DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO, + DSO_BINARY_TYPE__BUILDID_DEBUGINFO, ++ DSO_BINARY_TYPE__MIXEDUP_UBUNTU_DEBUGINFO, + DSO_BINARY_TYPE__NOT_FOUND, + }; + +--- a/tools/perf/util/symbol.c ++++ b/tools/perf/util/symbol.c +@@ -56,6 +56,7 @@ static enum dso_binary_type binary_type_ + DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE, + DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP, + DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO, ++ DSO_BINARY_TYPE__MIXEDUP_UBUNTU_DEBUGINFO, + DSO_BINARY_TYPE__NOT_FOUND, + }; + +@@ -1363,6 +1364,7 @@ static bool dso__is_compatible_symtab_ty + case DSO_BINARY_TYPE__SYSTEM_PATH_DSO: + case DSO_BINARY_TYPE__FEDORA_DEBUGINFO: + case DSO_BINARY_TYPE__UBUNTU_DEBUGINFO: ++ case DSO_BINARY_TYPE__MIXEDUP_UBUNTU_DEBUGINFO: + case DSO_BINARY_TYPE__BUILDID_DEBUGINFO: + case DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO: + return !kmod && dso->kernel == DSO_TYPE_USER; diff --git a/queue-4.4/series b/queue-4.4/series index a3270c4d2e9..b4f66bf12d4 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -97,3 +97,5 @@ kbuild-force-to-build-vmlinux-if-config_modversion-y.patch sunrpc-svcauth_gss_register_pseudoflavor-must-reject-duplicate-registrations.patch sunrpc-clean-up-properly-in-gss_mech_unregister.patch w1-omap-hdq-cleanup-to-add-missing-newline-for-some-dev_dbg.patch +perf-probe-do-not-show-the-skipped-events.patch +perf-symbols-fix-debuginfo-search-for-ubuntu.patch