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> Git-commit: b916b785af99088916a122cb37de1bda3fa7f70e Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git [jgebben@codeaurora.org: minor merge conflict in arm_pmu.h] CRs-Fixed: 1008368 Change-Id: Ief4b49a866ec8b056b6552bbd1745be8f002a1da Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
This commit is contained in:
parent
b7bc440547
commit
1c02e6eda9
2 changed files with 6 additions and 11 deletions
|
@ -552,14 +552,6 @@ static void armpmu_init(struct arm_pmu *armpmu)
|
|||
};
|
||||
}
|
||||
|
||||
int armpmu_register(struct arm_pmu *armpmu, int type)
|
||||
{
|
||||
armpmu_init(armpmu);
|
||||
pr_info("enabled with %s PMU driver, %d counters available\n",
|
||||
armpmu->name, armpmu->num_events);
|
||||
return perf_pmu_register(&armpmu->pmu, armpmu->name, type);
|
||||
}
|
||||
|
||||
/* Set at runtime when we know what CPU type we are. */
|
||||
static struct arm_pmu *__oprofile_cpu_pmu;
|
||||
|
||||
|
@ -888,6 +880,8 @@ int arm_pmu_device_probe(struct platform_device *pdev,
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
armpmu_init(pmu);
|
||||
|
||||
if (!__oprofile_cpu_pmu)
|
||||
__oprofile_cpu_pmu = pmu;
|
||||
|
||||
|
@ -913,10 +907,13 @@ int arm_pmu_device_probe(struct platform_device *pdev,
|
|||
if (ret)
|
||||
goto out_free;
|
||||
|
||||
ret = armpmu_register(pmu, -1);
|
||||
ret = perf_pmu_register(&pmu->pmu, pmu->name, -1);
|
||||
if (ret)
|
||||
goto out_destroy;
|
||||
|
||||
pr_info("enabled with %s PMU driver, %d counters available\n",
|
||||
pmu->name, pmu->num_events);
|
||||
|
||||
return 0;
|
||||
|
||||
out_destroy:
|
||||
|
|
|
@ -116,8 +116,6 @@ extern const unsigned armv8_pmuv3_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
|
|||
[PERF_COUNT_HW_CACHE_OP_MAX]
|
||||
[PERF_COUNT_HW_CACHE_RESULT_MAX];
|
||||
|
||||
int armpmu_register(struct arm_pmu *armpmu, int type);
|
||||
|
||||
u64 armpmu_event_update(struct perf_event *event);
|
||||
|
||||
int armpmu_event_set_period(struct perf_event *event);
|
||||
|
|
Loading…
Add table
Reference in a new issue