Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1446072
| From | tip-bot for Masami Hiramatsu <tipbot@zytor.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [tip:perf/core] perf probe: Warn unmatched function filter correctly |
| Date | 2016-07-19 09:00 +0200 |
| Message-ID | <rWxax-FB-5@gated-at.bofh.it> (permalink) |
| References | <rWjqW-8vS-27@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Commit-ID: e70493429bb1acaad829caae01c61dd7056fe671
Gitweb: http://git.kernel.org/tip/e70493429bb1acaad829caae01c61dd7056fe671
Author: Masami Hiramatsu <mhiramat@kernel.org>
AuthorDate: Tue, 19 Jul 2016 01:12:41 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 18 Jul 2016 19:46:34 -0300
perf probe: Warn unmatched function filter correctly
Warn unmatched function filter correctly instead of warning
"symbol-loading error", since that can be a filter issue.
From the technical point of view, this adds a filter chech in map__load
and if there is a filter, it returns -2 (filter-out), instead of -1
(error), and perf-probe checks it and change message.
E.g. without this fix:
# perf probe -F rt_sp*
no symbols found in [kernel.kallsyms], maybe install a debug package?
Failed to load symbols in kernel
With this fix:
# perf probe -F rt_sp*
no symbols passed the given filter.
Failed to find symbols matched to "rt_sp*"
Error: Failed to show functions.
Reported-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/146885835596.16106.2293540792775552481.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/map.c | 3 +++
tools/perf/util/probe-event.c | 12 ++++++++++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index b39b12a..728129a 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -312,6 +312,9 @@ int map__load(struct map *map, symbol_filter_t filter)
pr_warning("%.*s was updated (is prelink enabled?). "
"Restart the long running apps that use it!\n",
(int)real_len, name);
+ } else if (filter) {
+ pr_warning("no symbols passed the given filter.\n");
+ return -2; /* Empty but maybe by the filter */
} else {
pr_warning("no symbols found in %s, maybe install "
"a debug package?\n", name);
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index d4f8835..953dc1a 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -3312,8 +3312,16 @@ int show_available_funcs(const char *target, struct strfilter *_filter,
/* Load symbols with given filter */
available_func_filter = _filter;
- if (map__load(map, filter_available_functions)) {
- pr_err("Failed to load symbols in %s\n", (target) ? : "kernel");
+ ret = map__load(map, filter_available_functions);
+ if (ret) {
+ if (ret == -2) {
+ char *str = strfilter__string(_filter);
+ pr_err("Failed to find symbols matched to \"%s\"\n",
+ str);
+ free(str);
+ } else
+ pr_err("Failed to load symbols in %s\n",
+ (target) ? : "kernel");
goto end;
}
if (!dso__sorted_by_name(map->dso, map->type))
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
perf probe -F with wildcards Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-15 02:20 +0200
Re: perf probe -F with wildcards Masami Hiramatsu <mhiramat@kernel.org> - 2016-07-15 09:20 +0200
Re: perf probe -F with wildcards Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-15 15:20 +0200
[PATCH] [BUGFIX] perf-probe: Warn unmatched function filter correctly Masami Hiramatsu <mhiramat@kernel.org> - 2016-07-18 18:20 +0200
[tip:perf/core] perf probe: Warn unmatched function filter correctly tip-bot for Masami Hiramatsu <tipbot@zytor.com> - 2016-07-19 09:00 +0200
csiph-web