Index: usr.sbin/pmcstat/pmcstat_log.c =================================================================== --- usr.sbin/pmcstat/pmcstat_log.c +++ usr.sbin/pmcstat/pmcstat_log.c @@ -966,22 +966,35 @@ char *funcname, size_t funcname_len) { static int addr2line_warn = 0; - unsigned l; char *sep, cmdline[PATH_MAX], imagepath[PATH_MAX]; + unsigned l; int fd; if (image->pi_addr2line == NULL) { - snprintf(imagepath, sizeof(imagepath), "%s%s.symbols", - args.pa_fsroot, - pmcstat_string_unintern(image->pi_fullpath)); + /* Try default debug file location. + */ + snprintf(imagepath, sizeof(imagepath), + "/usr/lib/debug/boot/kernel/%s.debug", + pmcstat_string_unintern(image->pi_name)); fd = open(imagepath, O_RDONLY); if (fd < 0) { - snprintf(imagepath, sizeof(imagepath), "%s%s", + /* Old kernel symbol path. + */ + snprintf(imagepath, sizeof(imagepath), "%s%s.symbols", args.pa_fsroot, pmcstat_string_unintern(image->pi_fullpath)); - } else + fd = open(imagepath, O_RDONLY); + if (fd < 0) { + snprintf(imagepath, sizeof(imagepath), "%s%s", + args.pa_fsroot, + pmcstat_string_unintern( + image->pi_fullpath)); + } + } + if (fd >= 0) close(fd); + /* * New addr2line support recursive inline function with -i * but the format does not add a marker when no more entries @@ -1008,6 +1021,7 @@ return (0); } +printf("pipe: %p\n", (void *)addr); fprintf(image->pi_addr2line, "%p\n", (void *)addr); if (fgets(funcname, funcname_len, image->pi_addr2line) == NULL) {