diff options
author | obrien <obrien@FreeBSD.org> | 2011-11-15 06:44:07 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2011-11-15 06:44:07 +0000 |
commit | 645c15928a6a22d853a33666471d09218dd355ca (patch) | |
tree | cbd8ed43ef703bf724c052cbf7053975612ec9cc /usr.sbin/pmcstat/pmcstat_log.c | |
parent | 5509fbb6318be0fa4bcd3ca15c669f0ba0231d8a (diff) | |
download | FreeBSD-src-645c15928a6a22d853a33666471d09218dd355ca.zip FreeBSD-src-645c15928a6a22d853a33666471d09218dd355ca.tar.gz |
Improve the chances of matching an outputted string with the line of code.
Diffstat (limited to 'usr.sbin/pmcstat/pmcstat_log.c')
-rw-r--r-- | usr.sbin/pmcstat/pmcstat_log.c | 71 |
1 files changed, 38 insertions, 33 deletions
diff --git a/usr.sbin/pmcstat/pmcstat_log.c b/usr.sbin/pmcstat/pmcstat_log.c index 6d0403f..13db169 100644 --- a/usr.sbin/pmcstat/pmcstat_log.c +++ b/usr.sbin/pmcstat/pmcstat_log.c @@ -421,8 +421,8 @@ pmcstat_image_get_aout_params(struct pmcstat_image *image) assert(path != NULL); if (image->pi_iskernelmodule) - errx(EX_SOFTWARE, "ERROR: a.out kernel modules are " - "unsupported \"%s\"", path); + errx(EX_SOFTWARE, + "ERROR: a.out kernel modules are unsupported \"%s\"", path); (void) snprintf(buffer, sizeof(buffer), "%s%s", args.pa_fsroot, path); @@ -645,8 +645,9 @@ pmcstat_image_get_elf_params(struct pmcstat_image *image) } if (gelf_getehdr(e, &eh) != &eh) { - warnx("WARNING: Cannot retrieve the ELF Header for " - "\"%s\": %s.", buffer, elf_errmsg(-1)); + warnx( + "WARNING: Cannot retrieve the ELF Header for \"%s\": %s.", + buffer, elf_errmsg(-1)); goto done; } @@ -667,16 +668,17 @@ pmcstat_image_get_elf_params(struct pmcstat_image *image) */ if (eh.e_type == ET_EXEC) { if (elf_getphnum(e, &nph) == 0) { - warnx("WARNING: Could not determine the number of " - "program headers in \"%s\": %s.", buffer, + warnx( +"WARNING: Could not determine the number of program headers in \"%s\": %s.", + buffer, elf_errmsg(-1)); goto done; } for (i = 0; i < eh.e_phnum; i++) { if (gelf_getphdr(e, i, &ph) != &ph) { - warnx("WARNING: Retrieval of PHDR entry #%ju " - "in \"%s\" failed: %s.", (uintmax_t) i, - buffer, elf_errmsg(-1)); + warnx( +"WARNING: Retrieval of PHDR entry #%ju in \"%s\" failed: %s.", + (uintmax_t) i, buffer, elf_errmsg(-1)); goto done; } switch (ph.p_type) { @@ -685,8 +687,8 @@ pmcstat_image_get_elf_params(struct pmcstat_image *image) break; case PT_INTERP: if ((elfbase = elf_rawfile(e, NULL)) == NULL) { - warnx("WARNING: Cannot retrieve the " - "interpreter for \"%s\": %s.", + warnx( +"WARNING: Cannot retrieve the interpreter for \"%s\": %s.", buffer, elf_errmsg(-1)); goto done; } @@ -706,17 +708,18 @@ pmcstat_image_get_elf_params(struct pmcstat_image *image) * Get the min and max VA associated with this ELF object. */ if (elf_getshnum(e, &nsh) == 0) { - warnx("WARNING: Could not determine the number of sections " - "for \"%s\": %s.", buffer, elf_errmsg(-1)); + warnx( +"WARNING: Could not determine the number of sections for \"%s\": %s.", + buffer, elf_errmsg(-1)); goto done; } for (i = 0; i < nsh; i++) { if ((scn = elf_getscn(e, i)) == NULL || gelf_getshdr(scn, &sh) != &sh) { - warnx("WARNING: Could not retrieve section header " - "#%ju in \"%s\": %s.", (uintmax_t) i, buffer, - elf_errmsg(-1)); + warnx( +"WARNING: Could not retrieve section header #%ju in \"%s\": %s.", + (uintmax_t) i, buffer, elf_errmsg(-1)); goto done; } if (sh.sh_flags & SHF_EXECINSTR) { @@ -912,8 +915,8 @@ pmcstat_image_unmap(struct pmcstat_process *pp, uintfptr_t start, * the new one at [end]. */ if ((pcmnew = malloc(sizeof(*pcmnew))) == NULL) - err(EX_OSERR, "ERROR: Cannot split a map " - "entry"); + err(EX_OSERR, + "ERROR: Cannot split a map entry"); pcmnew->ppm_image = pcm->ppm_image; @@ -964,8 +967,9 @@ pmcstat_image_addr2line(struct pmcstat_image *image, uintfptr_t addr, if (image->pi_addr2line == NULL) { if (!addr2line_warn) { addr2line_warn = 1; - warnx("WARNING: addr2line is needed" - "for source code information."); + warnx( +"WARNING: addr2line is needed for source code information." + ); } return (0); } @@ -1283,8 +1287,9 @@ pmcstat_process_exec(struct pmcstat_process *pp, break; default: - err(EX_SOFTWARE, "ERROR: Unsupported executable type for " - "\"%s\"", pmcstat_string_unintern(path)); + err(EX_SOFTWARE, + "ERROR: Unsupported executable type for \"%s\"", + pmcstat_string_unintern(path)); } } @@ -1338,10 +1343,9 @@ pmcstat_analyze_log(void) case PMCLOG_TYPE_INITIALIZE: if ((ev.pl_u.pl_i.pl_version & 0xFF000000) != PMC_VERSION_MAJOR << 24 && args.pa_verbosity > 0) - warnx("WARNING: Log version 0x%x does not " - "match compiled version 0x%x.", - ev.pl_u.pl_i.pl_version, - PMC_VERSION_MAJOR); + warnx( +"WARNING: Log version 0x%x does not match compiled version 0x%x.", + ev.pl_u.pl_i.pl_version, PMC_VERSION_MAJOR); break; case PMCLOG_TYPE_MAP_IN: @@ -1556,8 +1560,9 @@ pmcstat_analyze_log(void) else if (ev.pl_state == PMCLOG_REQUIRE_DATA) return (PMCSTAT_RUNNING); - err(EX_DATAERR, "ERROR: event parsing failed (record %jd, " - "offset 0x%jx)", (uintmax_t) ev.pl_count + 1, ev.pl_offset); + err(EX_DATAERR, + "ERROR: event parsing failed (record %jd, offset 0x%jx)", + (uintmax_t) ev.pl_count + 1, ev.pl_offset); } /* @@ -1597,9 +1602,9 @@ pmcstat_print_log(void) pmc_name_of_cputype(ev.pl_u.pl_i.pl_arch)); if ((ev.pl_u.pl_i.pl_version & 0xFF000000) != PMC_VERSION_MAJOR << 24 && args.pa_verbosity > 0) - warnx("WARNING: Log version 0x%x != expected " - "version 0x%x.", ev.pl_u.pl_i.pl_version, - PMC_VERSION); + warnx( +"WARNING: Log version 0x%x != expected version 0x%x.", + ev.pl_u.pl_i.pl_version, PMC_VERSION); break; case PMCLOG_TYPE_MAP_IN: PMCSTAT_PRINT_ENTRY("map-in","%d %p \"%s\"", @@ -1680,8 +1685,8 @@ pmcstat_print_log(void) else if (ev.pl_state == PMCLOG_REQUIRE_DATA) return (PMCSTAT_RUNNING); - errx(EX_DATAERR, "ERROR: event parsing failed " - "(record %jd, offset 0x%jx).", + errx(EX_DATAERR, + "ERROR: event parsing failed (record %jd, offset 0x%jx).", (uintmax_t) ev.pl_count + 1, ev.pl_offset); /*NOTREACHED*/ } |