Skip to content

Commit 5a6c9d9

Browse files
kliang2Ingo Molnar
authored andcommitted
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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 0f519f0 commit 5a6c9d9

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

arch/x86/events/intel/uncore.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ static int uncore_assign_events(struct intel_uncore_box *box, int assign[], int
451451
return ret ? -EINVAL : 0;
452452
}
453453

454-
static void uncore_pmu_event_start(struct perf_event *event, int flags)
454+
void uncore_pmu_event_start(struct perf_event *event, int flags)
455455
{
456456
struct intel_uncore_box *box = uncore_event_to_box(event);
457457
int idx = event->hw.idx;
@@ -491,7 +491,7 @@ static void uncore_pmu_event_start(struct perf_event *event, int flags)
491491
}
492492
}
493493

494-
static void uncore_pmu_event_stop(struct perf_event *event, int flags)
494+
void uncore_pmu_event_stop(struct perf_event *event, int flags)
495495
{
496496
struct intel_uncore_box *box = uncore_event_to_box(event);
497497
struct hw_perf_event *hwc = &event->hw;
@@ -528,7 +528,7 @@ static void uncore_pmu_event_stop(struct perf_event *event, int flags)
528528
}
529529
}
530530

531-
static int uncore_pmu_event_add(struct perf_event *event, int flags)
531+
int uncore_pmu_event_add(struct perf_event *event, int flags)
532532
{
533533
struct intel_uncore_box *box = uncore_event_to_box(event);
534534
struct hw_perf_event *hwc = &event->hw;
@@ -600,7 +600,7 @@ static int uncore_pmu_event_add(struct perf_event *event, int flags)
600600
return 0;
601601
}
602602

603-
static void uncore_pmu_event_del(struct perf_event *event, int flags)
603+
void uncore_pmu_event_del(struct perf_event *event, int flags)
604604
{
605605
struct intel_uncore_box *box = uncore_event_to_box(event);
606606
int i;

arch/x86/events/intel/uncore.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,10 @@ struct intel_uncore_box *uncore_pmu_to_box(struct intel_uncore_pmu *pmu, int cpu
467467
u64 uncore_msr_read_counter(struct intel_uncore_box *box, struct perf_event *event);
468468
void uncore_pmu_start_hrtimer(struct intel_uncore_box *box);
469469
void uncore_pmu_cancel_hrtimer(struct intel_uncore_box *box);
470+
void uncore_pmu_event_start(struct perf_event *event, int flags);
471+
void uncore_pmu_event_stop(struct perf_event *event, int flags);
472+
int uncore_pmu_event_add(struct perf_event *event, int flags);
473+
void uncore_pmu_event_del(struct perf_event *event, int flags);
470474
void uncore_pmu_event_read(struct perf_event *event);
471475
void uncore_perf_event_update(struct intel_uncore_box *box, struct perf_event *event);
472476
struct event_constraint *

0 commit comments

Comments
 (0)