summaryrefslogtreecommitdiffstats
path: root/sys/dev/hwpmc
diff options
context:
space:
mode:
authorjkoshy <jkoshy@FreeBSD.org>2008-12-16 11:04:02 +0000
committerjkoshy <jkoshy@FreeBSD.org>2008-12-16 11:04:02 +0000
commit6fc1cf03480aa00f98c4aecbcd23ca5822e79193 (patch)
treea804dcabc70cd33d581fa850b1beaf9e65d52ca2 /sys/dev/hwpmc
parent8c8136db7eadb49c1f947b7040db101f9f7663e7 (diff)
downloadFreeBSD-src-6fc1cf03480aa00f98c4aecbcd23ca5822e79193.zip
FreeBSD-src-6fc1cf03480aa00f98c4aecbcd23ca5822e79193.tar.gz
Bug fixes:
- Initialize variables before use. - Remove a KASSERT() that could falsely trigger if there are other sources of NMIs in the system. Efficiency tweak: - When checking PMCs that overflowed, ignore PMCs that were not configured for sampling.
Diffstat (limited to 'sys/dev/hwpmc')
-rw-r--r--sys/dev/hwpmc/hwpmc_core.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/dev/hwpmc/hwpmc_core.c b/sys/dev/hwpmc/hwpmc_core.c
index c34a969..8d17679 100644
--- a/sys/dev/hwpmc/hwpmc_core.c
+++ b/sys/dev/hwpmc/hwpmc_core.c
@@ -1491,17 +1491,18 @@ core_intr(int cpu, struct trapframe *tf)
PMCDBG(MDP,INT, 1, "cpu=%d tf=0x%p um=%d", cpu, (void *) tf,
TRAPF_USERMODE(tf));
+ found_interrupt = 0;
cc = core_pcpu[cpu];
for (ri = 0; ri < core_iap_npmc; ri++) {
- if (!iap_pmc_has_overflowed(ri))
- continue;
-
if ((pm = cc->pc_corepmcs[ri].phw_pmc) == NULL ||
!PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)))
continue;
+ if (!iap_pmc_has_overflowed(ri))
+ continue;
+
found_interrupt = 1;
if (pm->pm_state != PMC_STATE_RUNNING)
@@ -1560,7 +1561,9 @@ core2_intr(int cpu, struct trapframe *tf)
PMCDBG(MDP,INT, 1, "cpu=%d intrstatus=%jx", cpu,
(uintmax_t) intrstatus);
+ found_interrupt = 0;
cc = core_pcpu[cpu];
+
KASSERT(cc != NULL, ("[core,%d] null pcpu", __LINE__));
cc->pc_globalctrl &= ~intrenable;
@@ -1574,7 +1577,6 @@ core2_intr(int cpu, struct trapframe *tf)
IA_GLOBAL_STATUS_FLAG_OVFBUF |
IA_GLOBAL_STATUS_FLAG_CONDCHG);
-
/*
* Look for interrupts from fixed function PMCs.
*/
@@ -1634,9 +1636,6 @@ core2_intr(int cpu, struct trapframe *tf)
wrmsr(IAP_PMC0 + n, v);
}
- KASSERT(found_interrupt,
- ("[core,%d] no interrupting PMCs were found", __LINE__));
-
/*
* Reenable all non-stalled PMCs.
*/
OpenPOWER on IntegriCloud