perf report: Ignore kptr_restrict when not sampling the kernel
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 14 Nov 2017 14:12:11 +0000 (11:12 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 16 Nov 2017 17:50:01 +0000 (14:50 -0300)
If none of the evsels has attr.exclude_kernel set to zero, no kernel
samples, so no point in warning the user about problems in processing
kernel samples, as there will be none.

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-7dn926v3at8txxkky92aesz2@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-report.c

index 1394cd8d96f7bb8d132e2a5cf892090690a19920..af5dd038195e3f6e3a6877d5884efda263e46843 100644 (file)
@@ -441,6 +441,9 @@ static void report__warn_kptr_restrict(const struct report *rep)
        struct map *kernel_map = machine__kernel_map(&rep->session->machines.host);
        struct kmap *kernel_kmap = kernel_map ? map__kmap(kernel_map) : NULL;
 
+       if (perf_evlist__exclude_kernel(rep->session->evlist))
+               return;
+
        if (kernel_map == NULL ||
            (kernel_map->dso->hit &&
             (kernel_kmap->ref_reloc_sym == NULL ||