From: <gregkh@linuxfoundation.org>
To: acme@redhat.com, adrian.hunter@intel.com, bp@suse.de,
dsahern@gmail.com, eranian@google.com, fweisbec@gmail.com,
gregkh@linuxfoundation.org, jolsa@redhat.com,
masami.hiramatsu.pt@hitachi.com, namhyung@kernel.org,
wangnan0@huawei.com
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "perf probe: Use existing routine to look for a kernel module by dso->short_name" has been added to the 4.2-stable tree
Date: Tue, 13 Oct 2015 13:40:07 -0700 [thread overview]
Message-ID: <144476880717948@kroah.com> (raw)
This is a note to let you know that I've just added the patch titled
perf probe: Use existing routine to look for a kernel module by dso->short_name
to the 4.2-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
perf-probe-use-existing-routine-to-look-for-a-kernel-module-by-dso-short_name.patch
and it can be found in the queue-4.2 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 266fa2b22294909ddf6e7d2f8acfe07adf9fd978 Mon Sep 17 00:00:00 2001
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Thu, 24 Sep 2015 11:24:18 -0300
Subject: perf probe: Use existing routine to look for a kernel module by dso->short_name
From: Arnaldo Carvalho de Melo <acme@redhat.com>
commit 266fa2b22294909ddf6e7d2f8acfe07adf9fd978 upstream.
We have map_groups__find_by_name() to look at the list of modules that
are in place for a given machine, so use it instead of traversing the
machine dso list, which also includes DSOs for userspace.
When merging the user and kernel DSO lists a bug was introduced where
'perf probe' stopped being able to add probes to modules using its short
name:
# perf probe -m usbnet --add usbnet_start_xmit
usbnet_start_xmit is out of .text, skip it.
Error: Failed to add events.
#
With this fix it works again:
# perf probe -m usbnet --add usbnet_start_xmit
Added new event:
probe:usbnet_start_xmit (on usbnet_start_xmit in usbnet)
You can now use it in all perf tools, such as:
perf record -e probe:usbnet_start_xmit -aR sleep 1
#
Reported-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Fixes: 3d39ac538629 ("perf machine: No need to have two DSOs lists")
Link: http://lkml.kernel.org/r/20150924015008.GE1897@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/perf/util/probe-event.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -274,12 +274,13 @@ static int kernel_get_module_dso(const c
int ret = 0;
if (module) {
- list_for_each_entry(dso, &host_machine->dsos.head, node) {
- if (!dso->kernel)
- continue;
- if (strncmp(dso->short_name + 1, module,
- dso->short_name_len - 2) == 0)
- goto found;
+ char module_name[128];
+
+ snprintf(module_name, sizeof(module_name), "[%s]", module);
+ map = map_groups__find_by_name(&host_machine->kmaps, MAP__FUNCTION, module_name);
+ if (map) {
+ dso = map->dso;
+ goto found;
}
pr_debug("Failed to find module %s.\n", module);
return -ENOENT;
Patches currently in stable-queue which might be from acme@redhat.com are
queue-4.2/perf-tools-add-empty-build-files-for-architectures-lacking-them.patch
queue-4.2/perf-stat-get-correct-cpu-id-for-print_aggr.patch
queue-4.2/perf-probe-use-existing-routine-to-look-for-a-kernel-module-by-dso-short_name.patch
queue-4.2/perf-tools-add-missing-forward-declaration-of-struct-map-to-probe-event.h.patch
queue-4.2/perf-tools-fix-copying-of-proc-kcore.patch
queue-4.2/perf-hists-update-the-column-width-for-the-srcline-sort-key.patch
queue-4.2/perf-tools-fix-parse_events_add_pmu-caller.patch
queue-4.2/perf-header-fixup-reading-of-header_nrcpus-feature.patch
reply other threads:[~2015-10-13 20:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=144476880717948@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=bp@suse.de \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=namhyung@kernel.org \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).