Re: [PATCH 3/3] MIPS: implement hardware perf event support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Deng-Cheng

Thanks very much for your Perf support of MIPS.

On Fri, 2010-04-16 at 00:39 +0800, Deng-Cheng Zhu wrote:
> This patch is the HW perf event support. To enable this feature, we can not
> choose the SMTC kernel; Oprofile should be disabled; kernel performance
> events be selected. Then we can enable it in the Kernel type menu.
> 
> Oprofile for MIPS platforms initializes irq at arch init time. Currently we
> do not change this logic to allow PMU reservation.
> 
> If a platform has EIC, we can use the irq base and perf counter irq
> offset defines for the interrupt controller in mipspmu_get_irq().
> 
> Signed-off-by: Deng-Cheng Zhu <dengcheng.zhu@xxxxxxxxx>
> ---
>  arch/mips/Kconfig             |    8 +
>  arch/mips/kernel/Makefile     |    2 +
>  arch/mips/kernel/perf_event.c | 1468 +++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 1478 insertions(+), 0 deletions(-)
>  create mode 100644 arch/mips/kernel/perf_event.c
[...]
> + * Copied from Oprofile -- BEGIN
> + */
[...]
> +/* Copied from Oprofile -- END */
> +

Seems you only copied the contents from
arch/mips/oprofile/op_model_mipsxx.c and handle the mipsxx, what about
rm9000(arch/mips/oprofile/op_model_rm9000.c) and
loongson2(arch/mips/oprofile/op_model_loongson2.c)? 

I think it will not work on rm9000 and loongson2 for their performance
counters are different from mipsxx. so suggest you only enable this for
mipsxxx(refer to arch/mips/oprofile/Makefile) via #ifdef and renaming
the current perf_event.c to perf_event_mipsxx.c.

And to reduce the source code duplication, perhaps we need a solution to
share the source code between Oprofile and Perf, and also among mipsxx,
rm9000 and loongson2.

Thanks & Regards,
	Wu Zhangjin



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux