perf report: Fix -T/--threads option to work again
[firefly-linux-kernel-4.4.55.git] / tools / perf / builtin-top.c
index 5fb8723c7128810d7fbb52f06389d97217bd32b7..6a4d5d41c671d0ce176deb13d318de35acee0161 100644 (file)
@@ -733,7 +733,7 @@ static void perf_event__process_sample(struct perf_tool *tool,
 "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]) ?
+                         al.map && !RB_EMPTY_ROOT(&al.map->dso->symbols[MAP__FUNCTION]) ?
                          " modules" : "");
                if (use_browser <= 0)
                        sleep(5);
@@ -757,8 +757,10 @@ static void perf_event__process_sample(struct perf_tool *tool,
                    al.map == machine->vmlinux_maps[MAP__FUNCTION] &&
                    RB_EMPTY_ROOT(&al.map->dso->symbols[MAP__FUNCTION])) {
                        if (symbol_conf.vmlinux_name) {
-                               ui__warning("The %s file can't be used.\n%s",
-                                           symbol_conf.vmlinux_name, msg);
+                               char serr[256];
+                               dso__strerror_load(al.map->dso, serr, sizeof(serr));
+                               ui__warning("The %s file can't be used: %s\n%s",
+                                           symbol_conf.vmlinux_name, serr, msg);
                        } else {
                                ui__warning("A vmlinux file was not found.\n%s",
                                            msg);