perf top: Handle kptr_restrict

Reported-by: default avatarIngo Molnar <mingo@elte.hu>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
Link: http://lkml.kernel.org/n/tip-cyl5zmi1nu35vyu7l5im2pyv@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 59fb1ee9
...@@ -80,6 +80,7 @@ static bool use_tui, use_stdio; ...@@ -80,6 +80,7 @@ static bool use_tui, use_stdio;
static int default_interval = 0; static int default_interval = 0;
static bool kptr_restrict_warned;
static bool inherit = false; static bool inherit = false;
static int realtime_prio = 0; static int realtime_prio = 0;
static bool group = false; static bool group = false;
...@@ -738,6 +739,20 @@ static void perf_event__process_sample(const union perf_event *event, ...@@ -738,6 +739,20 @@ static void perf_event__process_sample(const union perf_event *event,
al.filtered) al.filtered)
return; return;
if (!kptr_restrict_warned &&
symbol_conf.kptr_restrict &&
al.cpumode == PERF_RECORD_MISC_KERNEL) {
ui__warning(
"Kernel address maps (/proc/{kallsyms,modules}) are restricted.\n\n"
"Check /proc/sys/kernel/kptr_restrict.\n\n"
"Kernel%s samples will not be resolved.\n",
!RB_EMPTY_ROOT(&al.map->dso->symbols[MAP__FUNCTION]) ?
" modules" : "");
if (use_browser <= 0)
sleep(5);
kptr_restrict_warned = true;
}
if (al.sym == NULL) { if (al.sym == NULL) {
/* /*
* As we do lazy loading of symtabs we only will know if the * As we do lazy loading of symtabs we only will know if the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment