summaryrefslogtreecommitdiff
path: root/arch/x86/machine/pmu_intel.c
diff options
context:
space:
mode:
authorRemy Noel <mocramis@gmail.com>2018-05-04 01:18:12 +0200
committerRemy Noel <mocramis@gmail.com>2018-05-04 01:18:12 +0200
commitdbf7c70e04a4f05f90d99d466eaad1932b0e0460 (patch)
tree0818a1c49c8706acb7b97fb893ea71a8ba233b25 /arch/x86/machine/pmu_intel.c
parent58c17bd912ec450f8132597cdba6afd300a63586 (diff)
pmu: fix driver initialization.
Diffstat (limited to 'arch/x86/machine/pmu_intel.c')
-rw-r--r--arch/x86/machine/pmu_intel.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/machine/pmu_intel.c b/arch/x86/machine/pmu_intel.c
index 6fbdbae..8b2f309 100644
--- a/arch/x86/machine/pmu_intel.c
+++ b/arch/x86/machine/pmu_intel.c
@@ -354,6 +354,7 @@ pmu_intel_setup(void)
pmu->events = ~ebx & ((1U << ev_len) - 1);
+ memset(&pmu_driver, 0, sizeof(pmu_driver));
pmu_driver.pmc_width = pmu->pmc_width;
pmu_driver.ops.info = pmu_intel_info;
pmu_driver.ops.translate = pmu_intel_translate;
@@ -366,10 +367,8 @@ pmu_intel_setup(void)
if (pmu->version >= 2) {
pmu_driver.ops.handle_of_intr = pmu_intel_handle_of_intr_v2;
- pmu_driver.of_max_ticks = 0;
} else {
/* Set max_tick to half the number of instruction per seconds. */
- pmu_driver.ops.handle_of_intr = NULL;
pmu_driver.of_max_ticks =
(1ULL << (pmu_driver.pmc_width - 1)) / (cpu_get_freq() / CLOCK_FREQ);
}