diff options
Diffstat (limited to 'sys/dev/hwpmc/hwpmc_soft.c')
-rw-r--r-- | sys/dev/hwpmc/hwpmc_soft.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/hwpmc/hwpmc_soft.c b/sys/dev/hwpmc/hwpmc_soft.c index dac3612..0ed2262 100644 --- a/sys/dev/hwpmc/hwpmc_soft.c +++ b/sys/dev/hwpmc/hwpmc_soft.c @@ -408,8 +408,11 @@ pmc_soft_intr(struct pmckern_soft *ks) } processed = 1; - pc->soft_values[ri]++; if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) { + if ((pc->soft_values[ri]--) <= 0) + pc->soft_values[ri] += pm->pm_sc.pm_reloadcount; + else + continue; user_mode = TRAPF_USERMODE(ks->pm_tf); error = pmc_process_interrupt(ks->pm_cpu, PMC_SR, pm, ks->pm_tf, user_mode); @@ -424,7 +427,8 @@ pmc_soft_intr(struct pmckern_soft *ks) */ curthread->td_flags |= TDF_ASTPENDING; } - } + } else + pc->soft_values[ri]++; } atomic_add_int(processed ? &pmc_stats.pm_intr_processed : |