aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKan Liang <kan.liang@intel.com>2018-05-03 14:25:12 -0400
committerIngo Molnar <mingo@kernel.org>2018-05-31 06:36:28 -0400
commit5a6c9d94e9ed7410142bc6fcb638a4db1895aa0c (patch)
treeba92b2f92f92183e08c3474a27051add30e23880
parent0f519f0352e37e7d71bdce5559517c74a35f6e33 (diff)
perf/x86/intel/uncore: Expose uncore_pmu_event*() functions
Some uncores have customized PMU. For customized PMU, it does not need to customize everything. For example, it only needs to customize init() function for client IMC uncore. Other functions like add()/del()/start()/stop()/read() can use generic code. Expose the uncore_pmu_event_add/del/start/stop() functions. Signed-off-by: Kan Liang <kan.liang@intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: acme@kernel.org Cc: eranian@google.com Link: http://lkml.kernel.org/r/1525371913-10597-7-git-send-email-kan.liang@intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/events/intel/uncore.c8
-rw-r--r--arch/x86/events/intel/uncore.h4
2 files changed, 8 insertions, 4 deletions
diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c
index 0a6f6973690b..15b07379e72d 100644
--- a/arch/x86/events/intel/uncore.c
+++ b/arch/x86/events/intel/uncore.c
@@ -451,7 +451,7 @@ static int uncore_assign_events(struct intel_uncore_box *box, int assign[], int
451 return ret ? -EINVAL : 0; 451 return ret ? -EINVAL : 0;
452} 452}
453 453
454static void uncore_pmu_event_start(struct perf_event *event, int flags) 454void uncore_pmu_event_start(struct perf_event *event, int flags)
455{ 455{
456 struct intel_uncore_box *box = uncore_event_to_box(event); 456 struct intel_uncore_box *box = uncore_event_to_box(event);
457 int idx = event->hw.idx; 457 int idx = event->hw.idx;
@@ -491,7 +491,7 @@ static void uncore_pmu_event_start(struct perf_event *event, int flags)
491 } 491 }
492} 492}
493 493
494static void uncore_pmu_event_stop(struct perf_event *event, int flags) 494void uncore_pmu_event_stop(struct perf_event *event, int flags)
495{ 495{
496 struct intel_uncore_box *box = uncore_event_to_box(event); 496 struct intel_uncore_box *box = uncore_event_to_box(event);
497 struct hw_perf_event *hwc = &event->hw; 497 struct hw_perf_event *hwc = &event->hw;
@@ -528,7 +528,7 @@ static void uncore_pmu_event_stop(struct perf_event *event, int flags)
528 } 528 }
529} 529}
530 530
531static int uncore_pmu_event_add(struct perf_event *event, int flags) 531int uncore_pmu_event_add(struct perf_event *event, int flags)
532{ 532{
533 struct intel_uncore_box *box = uncore_event_to_box(event); 533 struct intel_uncore_box *box = uncore_event_to_box(event);
534 struct hw_perf_event *hwc = &event->hw; 534 struct hw_perf_event *hwc = &event->hw;
@@ -600,7 +600,7 @@ static int uncore_pmu_event_add(struct perf_event *event, int flags)
600 return 0; 600 return 0;
601} 601}
602 602
603static void uncore_pmu_event_del(struct perf_event *event, int flags) 603void uncore_pmu_event_del(struct perf_event *event, int flags)
604{ 604{
605 struct intel_uncore_box *box = uncore_event_to_box(event); 605 struct intel_uncore_box *box = uncore_event_to_box(event);
606 int i; 606 int i;
diff --git a/arch/x86/events/intel/uncore.h b/arch/x86/events/intel/uncore.h
index eb0265359019..c9e1e0bef3c3 100644
--- a/arch/x86/events/intel/uncore.h
+++ b/arch/x86/events/intel/uncore.h
@@ -467,6 +467,10 @@ struct intel_uncore_box *uncore_pmu_to_box(struct intel_uncore_pmu *pmu, int cpu
467u64 uncore_msr_read_counter(struct intel_uncore_box *box, struct perf_event *event); 467u64 uncore_msr_read_counter(struct intel_uncore_box *box, struct perf_event *event);
468void uncore_pmu_start_hrtimer(struct intel_uncore_box *box); 468void uncore_pmu_start_hrtimer(struct intel_uncore_box *box);
469void uncore_pmu_cancel_hrtimer(struct intel_uncore_box *box); 469void uncore_pmu_cancel_hrtimer(struct intel_uncore_box *box);
470void uncore_pmu_event_start(struct perf_event *event, int flags);
471void uncore_pmu_event_stop(struct perf_event *event, int flags);
472int uncore_pmu_event_add(struct perf_event *event, int flags);
473void uncore_pmu_event_del(struct perf_event *event, int flags);
470void uncore_pmu_event_read(struct perf_event *event); 474void uncore_pmu_event_read(struct perf_event *event);
471void uncore_perf_event_update(struct intel_uncore_box *box, struct perf_event *event); 475void uncore_perf_event_update(struct intel_uncore_box *box, struct perf_event *event);
472struct event_constraint * 476struct event_constraint *