Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/pmcstat/pmcstat_log.c
Context not available. | |||||
char *funcname, size_t funcname_len) | char *funcname, size_t funcname_len) | ||||
{ | { | ||||
static int addr2line_warn = 0; | static int addr2line_warn = 0; | ||||
unsigned l; | |||||
char *sep, cmdline[PATH_MAX], imagepath[PATH_MAX]; | char *sep, cmdline[PATH_MAX], imagepath[PATH_MAX]; | ||||
unsigned l; | |||||
int fd; | int fd; | ||||
if (image->pi_addr2line == NULL) { | if (image->pi_addr2line == NULL) { | ||||
snprintf(imagepath, sizeof(imagepath), "%s%s.symbols", | /* Try default debug file location. | ||||
emaste: style(9) on the comment:
`/* Try default debug file location. */` | |||||
args.pa_fsroot, | */ | ||||
pmcstat_string_unintern(image->pi_fullpath)); | snprintf(imagepath, sizeof(imagepath), | ||||
"/usr/lib/debug/boot/kernel/%s.debug", | |||||
pmcstat_string_unintern(image->pi_name)); | |||||
emasteUnsubmitted Not Done Inline ActionsIt should still use pi_fullpath -- the scheme is that debug data is stored in the same path under /usr/lib/debug/. So for example /boot/test-kernel/ will have debug data in /usr/lib/debug/boot/test-kernel/ emaste: It should still use pi_fullpath -- the scheme is that debug data is stored in the same path… | |||||
fabientAuthorUnsubmitted Not Done Inline ActionsGood catch. :) fabient: Good catch. :) | |||||
fd = open(imagepath, O_RDONLY); | fd = open(imagepath, O_RDONLY); | ||||
if (fd < 0) { | if (fd < 0) { | ||||
snprintf(imagepath, sizeof(imagepath), "%s%s", | /* Old kernel symbol path. | ||||
*/ | |||||
Not Done Inline Actionsstyle(9) emaste: style(9) | |||||
snprintf(imagepath, sizeof(imagepath), "%s%s.symbols", | |||||
args.pa_fsroot, | args.pa_fsroot, | ||||
pmcstat_string_unintern(image->pi_fullpath)); | 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); | close(fd); | ||||
emasteUnsubmitted Not Done Inline Actionswhitespace change? emaste: whitespace change? | |||||
/* | /* | ||||
* New addr2line support recursive inline function with -i | * New addr2line support recursive inline function with -i | ||||
* but the format does not add a marker when no more entries | * but the format does not add a marker when no more entries | ||||
Context not available. | |||||
return (0); | return (0); | ||||
} | } | ||||
printf("pipe: %p\n", (void *)addr); | |||||
emasteUnsubmitted Not Done Inline Actionsremove this before checkin :) emaste: remove this before checkin :) | |||||
fprintf(image->pi_addr2line, "%p\n", (void *)addr); | fprintf(image->pi_addr2line, "%p\n", (void *)addr); | ||||
if (fgets(funcname, funcname_len, image->pi_addr2line) == NULL) { | if (fgets(funcname, funcname_len, image->pi_addr2line) == NULL) { | ||||
Context not available. |
style(9) on the comment:
/* Try default debug file location. */