Date: Wed, 19 Nov 2008 02:22:34 +0000 (UTC) From: Joseph Koshy <jkoshy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r185079 - head/usr.sbin/pmcstat Message-ID: <200811190222.mAJ2MYoL000980@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jkoshy Date: Wed Nov 19 02:22:34 2008 New Revision: 185079 URL: http://svn.freebsd.org/changeset/base/185079 Log: As a matter of good programming style, stop PMCs before releasing them. Modified: head/usr.sbin/pmcstat/pmcstat.c Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Wed Nov 19 01:52:28 2008 (r185078) +++ head/usr.sbin/pmcstat/pmcstat.c Wed Nov 19 02:22:34 2008 (r185079) @@ -145,6 +145,9 @@ pmcstat_cleanup(struct pmcstat_args *a) /* release allocated PMCs. */ STAILQ_FOREACH_SAFE(ev, &a->pa_events, ev_next, tmp) if (ev->ev_pmcid != PMC_ID_INVALID) { + if (pmc_stop(ev->ev_pmcid) < 0) + err(EX_OSERR, "ERROR: cannot stop pmc 0x%x " + "\"%s\"", ev->ev_pmcid, ev->ev_name); if (pmc_release(ev->ev_pmcid) < 0) err(EX_OSERR, "ERROR: cannot release pmc " "0x%x \"%s\"", ev->ev_pmcid, ev->ev_name);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811190222.mAJ2MYoL000980>