[Top] [All Lists]

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

To: Deng-Cheng Zhu <>
Subject: Re: [PATCH 3/3] MIPS: implement hardware perf event support
From: Wu Zhangjin <>
Date: Fri, 16 Apr 2010 01:47:16 +0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=gamma; h=domainkey-signature:received:received:subject:from:reply-to:to:cc :in-reply-to:references:content-type:organization:date:message-id :mime-version:x-mailer:content-transfer-encoding; bh=8oBco9Fc+/M5GnPTsgjek1RSvdpr5yWQ09oomFVSXdM=; b=u2PTJNlrUqVBNQwMVKwJDFw1gEQOI5OijIxIEm/bX2Q7n6XMt3B6S+1KBHDwHMNJmj hM0+RaeRe2HFT3vM+HhZMZKtFY4FrZV3D/39P7xxF1Y+Ij6zYQ9nR6myYnQO+68VAK+g NYoSBezMzzYbsv4jDNhs06+PyJPeGH1EWFv+w=
Domainkey-signature: a=rsa-sha1; c=nofws;; s=gamma; h=subject:from:reply-to:to:cc:in-reply-to:references:content-type :organization:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=ttj11XkB7PH4NqrocZxjLreb3G6v3521t3QrVnFe2u9RerizV2RhBVy9rO5j9TZ9pz NK20+DlqfpY+zzZCzy1GGFL8yGDMaaRVg5OhH0XgQ/ZEtzqeXAlK0DrTzgstQCisCHkw 65vl6kvOWHQDWj8hpmcy7/jaamA1sbjKq5RvU=
In-reply-to: <1271349557.7467.424.camel@fun-lab>
Organization: DSLab, Lanzhou University, China
Original-recipient: rfc822;
References: <1271349557.7467.424.camel@fun-lab>
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 <>
> ---
>  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

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

<Prev in Thread] Current Thread [Next in Thread>