Skip to content

Commit

Permalink
perf top: Handle kptr_restrict
Browse files Browse the repository at this point in the history
Reported-by: Ingo Molnar <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Tom Zanussi <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
acmel committed May 27, 2011
1 parent 59fb1ee commit 5f6f558
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ static bool use_tui, use_stdio;

static int default_interval = 0;

static bool kptr_restrict_warned;
static bool inherit = false;
static int realtime_prio = 0;
static bool group = false;
Expand Down Expand Up @@ -738,6 +739,20 @@ static void perf_event__process_sample(const union perf_event *event,
al.filtered)
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) {
/*
* As we do lazy loading of symtabs we only will know if the
Expand Down

0 comments on commit 5f6f558

Please sign in to comment.