summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pmcstat
diff options
context:
space:
mode:
authorfabient <fabient@FreeBSD.org>2015-10-08 09:46:35 +0000
committerfabient <fabient@FreeBSD.org>2015-10-08 09:46:35 +0000
commitcd1975df2c640b24dd1195eb2918fd1f749a59a4 (patch)
tree8ab0baf22d2c375cbd7d04c005e2dc0a6a65a104 /usr.sbin/pmcstat
parent3bf524186ec926516e59e9c8fedc3712eb44d967 (diff)
downloadFreeBSD-src-cd1975df2c640b24dd1195eb2918fd1f749a59a4.zip
FreeBSD-src-cd1975df2c640b24dd1195eb2918fd1f749a59a4.tar.gz
Fix for r288176 changes related to debug symbols move.
Reviewed by: emaste Sponsored by: Stormshield
Diffstat (limited to 'usr.sbin/pmcstat')
-rw-r--r--usr.sbin/pmcstat/pmcstat_log.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/usr.sbin/pmcstat/pmcstat_log.c b/usr.sbin/pmcstat/pmcstat_log.c
index fbc358d..ea9b547 100644
--- a/usr.sbin/pmcstat/pmcstat_log.c
+++ b/usr.sbin/pmcstat/pmcstat_log.c
@@ -966,21 +966,32 @@ pmcstat_image_addr2line(struct pmcstat_image *image, uintfptr_t addr,
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",
+ /* Try default debug file location. */
+ snprintf(imagepath, sizeof(imagepath),
+ "/usr/lib/debug/%s%s.debug",
args.pa_fsroot,
pmcstat_string_unintern(image->pi_fullpath));
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
OpenPOWER on IntegriCloud