summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pmcstat
diff options
context:
space:
mode:
authorjkoshy <jkoshy@FreeBSD.org>2008-11-19 02:22:34 +0000
committerjkoshy <jkoshy@FreeBSD.org>2008-11-19 02:22:34 +0000
commit9a63cf3a862cafec1824a6d8ccd4eb07747d71ab (patch)
tree9359cebdf35a1537aa0298f2db916fff3b285a44 /usr.sbin/pmcstat
parent85d421cbefb294dbd93200ad024122ba039e36a8 (diff)
downloadFreeBSD-src-9a63cf3a862cafec1824a6d8ccd4eb07747d71ab.zip
FreeBSD-src-9a63cf3a862cafec1824a6d8ccd4eb07747d71ab.tar.gz
As a matter of good programming style, stop PMCs before releasing
them.
Diffstat (limited to 'usr.sbin/pmcstat')
-rw-r--r--usr.sbin/pmcstat/pmcstat.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c
index 8cbe55b..228c78d 100644
--- a/usr.sbin/pmcstat/pmcstat.c
+++ b/usr.sbin/pmcstat/pmcstat.c
@@ -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);
OpenPOWER on IntegriCloud