aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>2012-09-25 17:26:50 +0100
committerViresh Kumar <viresh.kumar@linaro.org>2013-02-11 10:37:55 +0530
commitae6b528c1da6671eb1a4cdbb4f4ca8f3b82e7c49 (patch)
tree648a1fa0e7813ff1a4016d5c1af1cd70e2da2770
parent7febd80699832e09e43f9a4089433fb709e98ea6 (diff)
downloadvexpress-lsk-ae6b528c1da6671eb1a4cdbb4f4ca8f3b82e7c49.tar.gz
ARM: perf: register CPU PMUs with idr types
In order to support multiple, heterogeneous CPU PMUs and distinguish them, they cannot be registered as PERF_TYPE_RAW type. Instead we can get perf core to allocate a new idr type id for each PMU. Userspace applications can refer sysfs entried to find a PMU's type, which can then be used in tracking events on individual PMUs. Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
-rw-r--r--arch/arm/kernel/perf_event.c3
-rw-r--r--arch/arm/kernel/perf_event_cpu.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index f9e8657dd24..e4e5bf458c5 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -81,6 +81,9 @@ armpmu_map_event(struct perf_event *event,
return armpmu_map_cache_event(cache_map, config);
case PERF_TYPE_RAW:
return armpmu_map_raw_event(raw_event_mask, config);
+ default:
+ if (event->attr.type >= PERF_TYPE_MAX)
+ return armpmu_map_raw_event(raw_event_mask, config);
}
return -ENOENT;
diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c
index 995ea539ade..024443f8d29 100644
--- a/arch/arm/kernel/perf_event_cpu.c
+++ b/arch/arm/kernel/perf_event_cpu.c
@@ -288,7 +288,7 @@ static int cpu_pmu_device_probe(struct platform_device *pdev)
pmu->plat_device = pdev;
cpu_pmu_init(pmu);
- armpmu_register(pmu, PERF_TYPE_RAW);
+ armpmu_register(pmu, -1);
return 0;
}