svn commit: r205965 - stable/8/usr.sbin/pmcstat

Fabien Thomas fabient at FreeBSD.org
Wed Mar 31 07:10:40 UTC 2010


Author: fabient
Date: Wed Mar 31 07:10:40 2010
New Revision: 205965
URL: http://svn.freebsd.org/changeset/base/205965

Log:
  MFC r205809:
  Wait for pmc name in the log before displaying data.
  This will solve an abort in case of low throughput PMCs.

Modified:
  stable/8/usr.sbin/pmcstat/pmcstat_log.c
Directory Properties:
  stable/8/usr.sbin/pmcstat/   (props changed)

Modified: stable/8/usr.sbin/pmcstat/pmcstat_log.c
==============================================================================
--- stable/8/usr.sbin/pmcstat/pmcstat_log.c	Wed Mar 31 06:50:25 2010	(r205964)
+++ stable/8/usr.sbin/pmcstat/pmcstat_log.c	Wed Mar 31 07:10:40 2010	(r205965)
@@ -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",


More information about the svn-src-stable-8 mailing list