summaryrefslogtreecommitdiffstats
path: root/sys/dev/hwpmc/hwpmc_amd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/hwpmc/hwpmc_amd.c')
-rw-r--r--sys/dev/hwpmc/hwpmc_amd.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/sys/dev/hwpmc/hwpmc_amd.c b/sys/dev/hwpmc/hwpmc_amd.c
index 7e3719f..268904b 100644
--- a/sys/dev/hwpmc/hwpmc_amd.c
+++ b/sys/dev/hwpmc/hwpmc_amd.c
@@ -632,7 +632,6 @@ amd_intr(int cpu, struct trapframe *tf)
uint32_t config, evsel, perfctr;
struct pmc *pm;
struct amd_cpu *pac;
- struct pmc_hw *phw;
pmc_value_t v;
KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
@@ -660,21 +659,19 @@ amd_intr(int cpu, struct trapframe *tf)
for (i = 0; retval == 0 && i < AMD_NPMCS; i++) {
- if (!AMD_PMC_HAS_OVERFLOWED(i))
- continue;
-
- phw = &pac->pc_amdpmcs[i];
-
- KASSERT(phw != NULL, ("[amd,%d] null PHW pointer", __LINE__));
-
- if ((pm = phw->phw_pmc) == NULL ||
- pm->pm_state != PMC_STATE_RUNNING ||
+ if ((pm = pac->pc_amdpmcs[i].phw_pmc) == NULL ||
!PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) {
continue;
}
+ if (!AMD_PMC_HAS_OVERFLOWED(i))
+ continue;
+
retval = 1; /* Found an interrupting PMC. */
+ if (pm->pm_state != PMC_STATE_RUNNING)
+ continue;
+
/* Stop the PMC, reload count. */
evsel = AMD_PMC_EVSEL_0 + i;
perfctr = AMD_PMC_PERFCTR_0 + i;
OpenPOWER on IntegriCloud