Skip to content

Commit b916b78

Browse files
mrutland-armwildea01
authored andcommitted
drivers/perf: kill armpmu_register
Nothing outside of drivers/perf/arm_pmu.c should call armpmu_register any more, so it no longer needs to be in include/linux/perf/arm_pmu.h. Additionally, by folding it in to arm_pmu_device_probe we can allow drivers to override struct pmu fields without getting blatted by the armpmu code. This patch folds armpmu_register into arm_pmu_device_probe. The logging to the console is moved to after the PMU is successfully registered with the core perf code. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Suggested-by: Will Deacon <will.deacon@arm.com> Cc: Drew Richardson <drew.richardson@arm.com> Cc: Pawel Moll <pawel.moll@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent 8005c49 commit b916b78

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

‎drivers/perf/arm_pmu.c‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -551,14 +551,6 @@ static void armpmu_init(struct arm_pmu *armpmu)
551551
};
552552
}
553553

554-
int armpmu_register(struct arm_pmu *armpmu, int type)
555-
{
556-
armpmu_init(armpmu);
557-
pr_info("enabled with %s PMU driver, %d counters available\n",
558-
armpmu->name, armpmu->num_events);
559-
return perf_pmu_register(&armpmu->pmu, armpmu->name, type);
560-
}
561-
562554
/* Set at runtime when we know what CPU type we are. */
563555
static struct arm_pmu *__oprofile_cpu_pmu;
564556

@@ -887,6 +879,8 @@ int arm_pmu_device_probe(struct platform_device *pdev,
887879
return -ENOMEM;
888880
}
889881

882+
armpmu_init(pmu);
883+
890884
if (!__oprofile_cpu_pmu)
891885
__oprofile_cpu_pmu = pmu;
892886

@@ -912,10 +906,13 @@ int arm_pmu_device_probe(struct platform_device *pdev,
912906
if (ret)
913907
goto out_free;
914908

915-
ret = armpmu_register(pmu, -1);
909+
ret = perf_pmu_register(&pmu->pmu, pmu->name, -1);
916910
if (ret)
917911
goto out_destroy;
918912

913+
pr_info("enabled with %s PMU driver, %d counters available\n",
914+
pmu->name, pmu->num_events);
915+
919916
return 0;
920917

921918
out_destroy:

‎include/linux/perf/arm_pmu.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ struct arm_pmu {
111111

112112
#define to_arm_pmu(p) (container_of(p, struct arm_pmu, pmu))
113113

114-
int armpmu_register(struct arm_pmu *armpmu, int type);
115-
116114
u64 armpmu_event_update(struct perf_event *event);
117115

118116
int armpmu_event_set_period(struct perf_event *event);

0 commit comments

Comments
 (0)