diff options
author | Fabien Thomas <fabient@FreeBSD.org> | 2010-03-28 22:46:56 +0000 |
---|---|---|
committer | Fabien Thomas <fabient@FreeBSD.org> | 2010-03-28 22:46:56 +0000 |
commit | 9ba84a88b868c2a33cf7b339f715c00bc7e55415 (patch) | |
tree | 034692b2e080d32b69b8bd266b1fbd950907341d /usr.sbin/pmcstat | |
parent | b4eb1a01cf5bd711af517a411bab4de83e468115 (diff) | |
download | src-9ba84a88b868c2a33cf7b339f715c00bc7e55415.tar.gz src-9ba84a88b868c2a33cf7b339f715c00bc7e55415.zip |
Wait for pmc name in the log before displaying data.
This will solve an abort in case of low throughput PMCs.
MFC after: 3days
Notes
Notes:
svn path=/head/; revision=205809
Diffstat (limited to 'usr.sbin/pmcstat')
-rw-r--r-- | usr.sbin/pmcstat/pmcstat_log.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.sbin/pmcstat/pmcstat_log.c b/usr.sbin/pmcstat/pmcstat_log.c index fc26001a592b..9b524ff72750 100644 --- a/usr.sbin/pmcstat/pmcstat_log.c +++ b/usr.sbin/pmcstat/pmcstat_log.c @@ -1049,7 +1049,6 @@ pmcstat_pmcindex_to_name(int pmcin) if (pr->pr_pmcin == pmcin) return pmcstat_string_unintern(pr->pr_pmcname); - err(EX_SOFTWARE, "ERROR: cannot find pmcid name"); return NULL; } @@ -1789,19 +1788,23 @@ static void pmcstat_refresh_top(void) { char pmcname[40]; + const char *s; /* If in pause mode do not refresh display. */ if (pmcstat_pause) return; + /* Wait until PMC pop in the log. */ + s = pmcstat_pmcindex_to_name(pmcstat_pmcinfilter); + if (s == NULL) + return; + /* Format PMC name. */ if (pmcstat_mergepmc) - snprintf(pmcname, sizeof(pmcname), "[%s]", - pmcstat_pmcindex_to_name(pmcstat_pmcinfilter)); + snprintf(pmcname, sizeof(pmcname), "[%s]", s); else snprintf(pmcname, sizeof(pmcname), "%s.%d", - pmcstat_pmcindex_to_name(pmcstat_pmcinfilter), - pmcstat_pmcinfilter); + s, pmcstat_pmcinfilter); PMCSTAT_PRINTBEGIN(); PMCSTAT_PRINTW("PMC: %s Samples: %u processed, %u invalid\n\n", |