1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

When generating profiles (-g) warn about shared objects that were

not found.
This commit is contained in:
Joseph Koshy 2005-12-25 05:11:29 +00:00
parent de75ecb5a6
commit f3c8200ef5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=153710

View File

@ -727,7 +727,7 @@ pmcstat_process_add_elf_image(struct pmcstat_process *pp, const char *path,
char *line;
uintmax_t libstart;
struct pmcstat_image *image, *rtldimage;
char libpath[PATH_MAX];
char libname[PATH_MAX], libpath[PATH_MAX];
char command[PATH_MAX + sizeof(PMCSTAT_LDD_COMMAND) + 1];
/* Look up path in the cache. */
@ -792,10 +792,18 @@ pmcstat_process_add_elf_image(struct pmcstat_process *pp, const char *path,
continue;
line[linelen-1] = '\0';
if (sscanf(line, "%s %jx",
libpath, &libstart) != 2)
libstart = 0;
libpath[0] = libname[0] = '\0';
if (sscanf(line, "%s \"%[^\"]\" %jx",
libname, libpath, &libstart) != 3)
continue;
if (libstart == 0) {
warnx("WARNING: object \"%s\" was not found "
"for program \"%s\".", libname, path);
continue;
}
image = pmcstat_image_from_path(
pmcstat_string_intern(libpath));
if (image == NULL)
@ -1281,7 +1289,7 @@ pmcstat_initialize_logging(struct pmcstat_args *a)
struct pmcstat_image *img;
/* use a convenient format for 'ldd' output */
if (setenv("LD_TRACE_LOADED_OBJECTS_FMT1","%p %x\n",1) != 0)
if (setenv("LD_TRACE_LOADED_OBJECTS_FMT1","%o \"%p\" %x\n",1) != 0)
goto error;
/* Initialize hash tables */