diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-11-14 11:30:19 -0500 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-11-28 12:26:49 -0500 |
| commit | df7ccfa21ef343c602ae4aa1eb7893da4408b219 (patch) | |
| tree | 98fbecc552a3635653d2adbb2f80629a1b24a391 | |
| parent | b0ebd811af889721d3fbef3657092cf028c16b7c (diff) | |
perf top: Ignore kptr_restrict when not sampling the kernel
If all events have attr.exclude_kernel set, no need to look at
kptr_restrict.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-yegpzg5bf2im69g0tfizqaqz@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
| -rw-r--r-- | tools/perf/builtin-top.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 477a8699f0b5..1b01c277bab9 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
| @@ -732,14 +732,16 @@ static void perf_event__process_sample(struct perf_tool *tool, | |||
| 732 | if (!machine->kptr_restrict_warned && | 732 | if (!machine->kptr_restrict_warned && |
| 733 | symbol_conf.kptr_restrict && | 733 | symbol_conf.kptr_restrict && |
| 734 | al.cpumode == PERF_RECORD_MISC_KERNEL) { | 734 | al.cpumode == PERF_RECORD_MISC_KERNEL) { |
| 735 | ui__warning( | 735 | if (!perf_evlist__exclude_kernel(top->session->evlist)) { |
| 736 | ui__warning( | ||
| 736 | "Kernel address maps (/proc/{kallsyms,modules}) are restricted.\n\n" | 737 | "Kernel address maps (/proc/{kallsyms,modules}) are restricted.\n\n" |
| 737 | "Check /proc/sys/kernel/kptr_restrict.\n\n" | 738 | "Check /proc/sys/kernel/kptr_restrict.\n\n" |
| 738 | "Kernel%s samples will not be resolved.\n", | 739 | "Kernel%s samples will not be resolved.\n", |
| 739 | al.map && !RB_EMPTY_ROOT(&al.map->dso->symbols[MAP__FUNCTION]) ? | 740 | al.map && !RB_EMPTY_ROOT(&al.map->dso->symbols[MAP__FUNCTION]) ? |
| 740 | " modules" : ""); | 741 | " modules" : ""); |
| 741 | if (use_browser <= 0) | 742 | if (use_browser <= 0) |
| 742 | sleep(5); | 743 | sleep(5); |
| 744 | } | ||
| 743 | machine->kptr_restrict_warned = true; | 745 | machine->kptr_restrict_warned = true; |
| 744 | } | 746 | } |
| 745 | 747 | ||
