Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/pmcstat/pmcstat_log.c
Show First 20 Lines • Show All 640 Lines • ▼ Show 20 Lines | pmcstat_image_get_elf_params(struct pmcstat_image *image) | ||||
path = pmcstat_string_unintern(image->pi_execpath); | path = pmcstat_string_unintern(image->pi_execpath); | ||||
assert(path != NULL); | assert(path != NULL); | ||||
/* | /* | ||||
* Look for kernel modules under FSROOT/KERNELPATH/NAME, | * Look for kernel modules under FSROOT/KERNELPATH/NAME, | ||||
* and user mode executable objects under FSROOT/PATHNAME. | * and user mode executable objects under FSROOT/PATHNAME. | ||||
*/ | */ | ||||
if (image->pi_iskernelmodule) | if (image->pi_iskernelmodule && path[0] != '/') | ||||
(void) snprintf(buffer, sizeof(buffer), "%s%s/%s", | (void) snprintf(buffer, sizeof(buffer), "%s%s/%s", | ||||
args.pa_fsroot, args.pa_kernel, path); | args.pa_fsroot, args.pa_kernel, path); | ||||
else | else | ||||
(void) snprintf(buffer, sizeof(buffer), "%s%s", | (void) snprintf(buffer, sizeof(buffer), "%s%s", | ||||
args.pa_fsroot, path); | args.pa_fsroot, path); | ||||
e = NULL; | e = NULL; | ||||
if ((fd = open(buffer, O_RDONLY, 0)) < 0 || | if ((fd = open(buffer, O_RDONLY, 0)) < 0 || | ||||
▲ Show 20 Lines • Show All 1,581 Lines • Show Last 20 Lines |