ARM: 6069/1: perf-events: use numeric ID to identify PMU
authorWill Deacon <will.deacon@arm.com>
Fri, 30 Apr 2010 10:32:44 +0000 (11:32 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 17 May 2010 10:53:57 +0000 (11:53 +0100)
commit181193f398e7d8da6b1196138f0e219709621743
treeab633ad66a481a4acfb3fffcedeaef78a4a5803a
parent49c006b93769a86bec2b32b9234abf016ac0d50e
ARM: 6069/1: perf-events: use numeric ID to identify PMU

The ARM perf-events framework provides support for a number of different
PMUs using struct arm_pmu. The char *name field of this struct can be
used to identify the PMU, but this is cumbersome if used outside of perf.

This patch replaces the name string for a PMU with an enum, which holds
a unique ID for the PMU being represented. This ID can be used to index
an array of names within perf, so no functionality is lost. The presence
of the ID field, allows other kernel subsystems [currently oprofile] to
use their own mappings for the PMU name.

Cc: Jean Pihet <jpihet@mvista.com>
Acked-by: Jamie Iles <jamie.iles@picochip.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/perf_event.h
arch/arm/kernel/perf_event.c