From e8b942a9002cb7bcba52401faec0c05f68af2e74 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 27 May 2011 11:53:28 -0300 Subject: [PATCH] --- yaml --- r: 252665 b: refs/heads/master c: 5f6f55809758e106eca72c6e01402c8080a88ee8 h: refs/heads/master i: 252663: 02226666a5e28e359e5ca66228e9a6454dcebe3e v: v3 --- [refs] | 2 +- trunk/tools/perf/builtin-top.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index f631e6a0a9e2..3edd21df6e94 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 59fb1ee95e74e8e0777289c44300cbe812aca836 +refs/heads/master: 5f6f55809758e106eca72c6e01402c8080a88ee8 diff --git a/trunk/tools/perf/builtin-top.c b/trunk/tools/perf/builtin-top.c index 375ed160d936..472f62790022 100644 --- a/trunk/tools/perf/builtin-top.c +++ b/trunk/tools/perf/builtin-top.c @@ -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; @@ -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