sh: oprofile: Fix up and extend op_name_from_perf_id().
authorPaul Mundt <lethal@linux-sh.org>
Tue, 12 Oct 2010 18:46:25 +0000 (03:46 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Wed, 27 Oct 2010 07:51:33 +0000 (16:51 +0900)
commit2e4f17d230d84579fef07836fb5f69bf1a0a47ad
tree552b861fccfd34c7664f097293ce10014cf6134d
parent667b279baa529a1b5bd120d4ce3df643a5749263
sh: oprofile: Fix up and extend op_name_from_perf_id().

op_name_from_perf_id() currently returns a local variable, which isn't
terribly productive. As we only handle a single PMU case for now, simply
allocate and free the string from the arch init/exit context and have
op_name_from_perf_id() hand back the cached string.

This also takes UTS_MACHINE in to account, given that we build for
multiple architectures.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/kernel/cpu/sh4/perf_event.c
arch/sh/kernel/cpu/sh4a/perf_event.c
arch/sh/oprofile/Makefile
arch/sh/oprofile/common.c