aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/builtin-top.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 472f62790022..f2f3f4937aa2 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -81,6 +81,7 @@ static bool use_tui, use_stdio;
81static int default_interval = 0; 81static int default_interval = 0;
82 82
83static bool kptr_restrict_warned; 83static bool kptr_restrict_warned;
84static bool vmlinux_warned;
84static bool inherit = false; 85static bool inherit = false;
85static int realtime_prio = 0; 86static int realtime_prio = 0;
86static bool group = false; 87static bool group = false;
@@ -754,6 +755,7 @@ static void perf_event__process_sample(const union perf_event *event,
754 } 755 }
755 756
756 if (al.sym == NULL) { 757 if (al.sym == NULL) {
758 const char *msg = "Kernel samples will not be resolved.\n";
757 /* 759 /*
758 * As we do lazy loading of symtabs we only will know if the 760 * As we do lazy loading of symtabs we only will know if the
759 * specified vmlinux file is invalid when we actually have a 761 * specified vmlinux file is invalid when we actually have a
@@ -765,12 +767,20 @@ static void perf_event__process_sample(const union perf_event *event,
765 * --hide-kernel-symbols, even if the user specifies an 767 * --hide-kernel-symbols, even if the user specifies an
766 * invalid --vmlinux ;-) 768 * invalid --vmlinux ;-)
767 */ 769 */
768 if (al.map == machine->vmlinux_maps[MAP__FUNCTION] && 770 if (!kptr_restrict_warned && !vmlinux_warned &&
771 al.map == machine->vmlinux_maps[MAP__FUNCTION] &&
769 RB_EMPTY_ROOT(&al.map->dso->symbols[MAP__FUNCTION])) { 772 RB_EMPTY_ROOT(&al.map->dso->symbols[MAP__FUNCTION])) {
770 ui__warning("The %s file can't be used\n", 773 if (symbol_conf.vmlinux_name) {
771 symbol_conf.vmlinux_name); 774 ui__warning("The %s file can't be used.\n%s",
772 exit_browser(0); 775 symbol_conf.vmlinux_name, msg);
773 exit(1); 776 } else {
777 ui__warning("A vmlinux file was not found.\n%s",
778 msg);
779 }
780
781 if (use_browser <= 0)
782 sleep(5);
783 vmlinux_warned = true;
774 } 784 }
775 785
776 return; 786 return;