Commit 9d0fcba6 authored by Robert Richter's avatar Robert Richter Committed by Ingo Molnar

perf, x86: Call x86_setup_perfctr() from .hw_config()

The perfctr setup calls are in the corresponding .hw_config()
functions now. This makes it possible to introduce config functions
for other pmu events that are not perfctr specific.

Also, all of a sudden the code looks much nicer.
Signed-off-by: default avatarRobert Richter <>
Signed-off-by: default avatarPeter Zijlstra <>
LKML-Reference: <>
Signed-off-by: default avatarIngo Molnar <>
parent c1726f34
......@@ -505,7 +505,7 @@ static int x86_pmu_hw_config(struct perf_event *event)
if (event->attr.type == PERF_TYPE_RAW)
event->hw.config |= event->attr.config & X86_RAW_EVENT_MASK;
return 0;
return x86_setup_perfctr(event);
......@@ -543,12 +543,7 @@ static int __hw_perf_event_init(struct perf_event *event)
event->hw.last_cpu = -1;
event->hw.last_tag = ~0ULL;
/* Processor specifics */
err = x86_pmu.hw_config(event);
if (err)
return err;
return x86_setup_perfctr(event);
return x86_pmu.hw_config(event);
static void x86_pmu_disable_all(void)
......@@ -455,7 +455,7 @@ static int p4_hw_config(struct perf_event *event)
(p4_config_pack_escr(P4_ESCR_MASK_HT) |
return 0;
return x86_setup_perfctr(event);
static inline void p4_pmu_clear_cccr_ovf(struct hw_perf_event *hwc)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment