From: Li Huafei
maillist inclusion
category: bugfix
issue: #I4LRGQ
Reference: https://lkml.org/lkml/2021/7/26/406
--------------------------------
When users use the perf annotate feature on unsupported machines, error
logs should be printed for user feedback.
Signed-off-by: Li Huafei
Reviewed-by: James Clark
Signed-off-by: Li Huafei
Reviewed-by: Kuohai Xu
Signed-off-by: Chen Jun
Signed-off-by: Zheng Zengkai
Signed-off-by: Yu Changchun
---
tools/perf/util/annotate.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 308189454788..4aaaf23b4878 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -2178,8 +2178,10 @@ int symbol__annotate(struct map_symbol *ms, struct evsel *evsel,
return errno;
args.arch = arch = arch__find(arch_name);
- if (arch == NULL)
+ if (arch == NULL) {
+ pr_err("%s: unsupported arch %s\n", __func__, arch_name);
return ENOTSUP;
+ }
if (parch)
*parch = arch;
--
2.25.1