diff options
-rw-r--r-- | tools/perf/builtin-top.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 375ed160d936..472f62790022 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -80,6 +80,7 @@ static bool use_tui, use_stdio; | |||
80 | 80 | ||
81 | static int default_interval = 0; | 81 | static int default_interval = 0; |
82 | 82 | ||
83 | static bool kptr_restrict_warned; | ||
83 | static bool inherit = false; | 84 | static bool inherit = false; |
84 | static int realtime_prio = 0; | 85 | static int realtime_prio = 0; |
85 | static bool group = false; | 86 | static bool group = false; |
@@ -738,6 +739,20 @@ static void perf_event__process_sample(const union perf_event *event, | |||
738 | al.filtered) | 739 | al.filtered) |
739 | return; | 740 | return; |
740 | 741 | ||
742 | if (!kptr_restrict_warned && | ||
743 | symbol_conf.kptr_restrict && | ||
744 | al.cpumode == PERF_RECORD_MISC_KERNEL) { | ||
745 | ui__warning( | ||
746 | "Kernel address maps (/proc/{kallsyms,modules}) are restricted.\n\n" | ||
747 | "Check /proc/sys/kernel/kptr_restrict.\n\n" | ||
748 | "Kernel%s samples will not be resolved.\n", | ||
749 | !RB_EMPTY_ROOT(&al.map->dso->symbols[MAP__FUNCTION]) ? | ||
750 | " modules" : ""); | ||
751 | if (use_browser <= 0) | ||
752 | sleep(5); | ||
753 | kptr_restrict_warned = true; | ||
754 | } | ||
755 | |||
741 | if (al.sym == NULL) { | 756 | if (al.sym == NULL) { |
742 | /* | 757 | /* |
743 | * As we do lazy loading of symtabs we only will know if the | 758 | * As we do lazy loading of symtabs we only will know if the |