summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2013-02-26 13:59:39 +0000
committermav <mav@FreeBSD.org>2013-02-26 13:59:39 +0000
commitd9ff8818e59c14ea0e7fc65590570396d4fdec2a (patch)
treeeada01034cc6b569eb33762d18274c9e3b3bc3ca /sys/dev
parent40f8a2948b0c4e6acc784c63eeb5a3ac8a7c573b (diff)
downloadFreeBSD-src-d9ff8818e59c14ea0e7fc65590570396d4fdec2a.zip
FreeBSD-src-d9ff8818e59c14ea0e7fc65590570396d4fdec2a.tar.gz
Change the way how software PMC updates counters.
This at least fixes -n option of pmcstat. Reviewed by: fabient
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/hwpmc/hwpmc_soft.c8
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 :
OpenPOWER on IntegriCloud