summaryrefslogtreecommitdiff
path: root/kern/perfmon.c
diff options
context:
space:
mode:
Diffstat (limited to 'kern/perfmon.c')
-rw-r--r--kern/perfmon.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kern/perfmon.c b/kern/perfmon.c
index 4da95fb..4bedd99 100644
--- a/kern/perfmon.c
+++ b/kern/perfmon.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 Remy Noel.
+ * Copyright (c) 2014-2018 Remy Noel.
* Copyright (c) 2014-2015 Richard Braun.
*
* This program is free software: you can redistribute it and/or modify
@@ -45,6 +45,7 @@
#include <kern/thread.h>
#include <kern/xcall.h>
#include <machine/cpu.h>
+#include <machine/pmu.h>
#include <machine/trap.h>
/*
@@ -564,8 +565,8 @@ INIT_OP_DEFINE(perfmon_setup,
INIT_OP_DEP(panic_setup, true),
INIT_OP_DEP(percpu_setup, true),
INIT_OP_DEP(perfmon_bootstrap, true),
- INIT_OP_DEP(pmu_intel_setup, false),
INIT_OP_DEP(pmu_amd_setup, false),
+ INIT_OP_DEP(pmu_intel_setup, false),
INIT_OP_DEP(spinlock_setup, true),
INIT_OP_DEP(thread_setup, true),
INIT_OP_DEP(trap_setup, true));
@@ -646,14 +647,13 @@ perfmon_event_sync(struct perfmon_cpu_pmu *cpu_pmu,
struct perfmon_pmc *pmc;
struct perfmon_cpu_pmc *cpu_pmc;
uint64_t count;
+ int diff;
pmc = perfmon_pmc_from_index(event->pmc_index);
cpu_pmc = &cpu_pmu->pmcs[event->pmc_index];
count = pmu_driver.read(pmc->id);
if (unlikely(event->overflow_id != cpu_pmc->overflow_id)) {
- int diff;
-
assert(cpu_pmc->overflow_id > event->overflow_id);
diff = cpu_pmc->overflow_id > event->overflow_id;
@@ -1272,7 +1272,7 @@ perfmon_thread_load(struct thread *thread)
assert(!cpu_intr_enabled());
assert(!thread_preempt_enabled());
- grouplist =thread->perfmon_groups;
+ grouplist = thread->perfmon_groups;
spinlock_lock(&grouplist->lock);