As a matter of good programming style, stop PMCs before releasing
them.
This commit is contained in:
parent
85d421cbef
commit
9a63cf3a86
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user