From: David Daney <david.s.daney@gmail.com>
To: Deng-Cheng Zhu <dengcheng.zhu@gmail.com>
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org,
a.p.zijlstra@chello.nl, paulus@samba.org, mingo@elte.hu,
acme@redhat.com, jamie.iles@picochip.com, will.deacon@arm.com
Subject: Re: [PATCH v5 01/12] MIPS/Oprofile: extract PMU defines/helper functions for sharing
Date: Thu, 27 May 2010 14:48:38 -0700 [thread overview]
Message-ID: <4BFEE8B6.6040605@gmail.com> (raw)
In-Reply-To: <1274965420-5091-2-git-send-email-dengcheng.zhu@gmail.com>
On 05/27/2010 06:03 AM, Deng-Cheng Zhu wrote:
[...]
>
> diff --git a/arch/mips/include/asm/pmu.h b/arch/mips/include/asm/pmu.h
[...]
> +
> +#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64) || \
> + defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_SB1)
> +
Why predicate the entire contents of the file?
In any event, if you keep it, it shold probably be something like:
#if defined(CONFIG_CPU_MIPSR1) || defined(CONFIG_CPU_MIPSR2)
> +#define M_CONFIG1_PC (1<< 4)
> +
> +#define M_PERFCTL_EXL (1UL<< 0)
> +#define M_PERFCTL_KERNEL (1UL<< 1)
> +#define M_PERFCTL_SUPERVISOR (1UL<< 2)
> +#define M_PERFCTL_USER (1UL<< 3)
> +#define M_PERFCTL_INTERRUPT_ENABLE (1UL<< 4)
> +#define M_PERFCTL_EVENT(event) (((event)& 0x3ff)<< 5)
> +#define M_PERFCTL_VPEID(vpe) ((vpe)<< 16)
> +#define M_PERFCTL_MT_EN(filter) ((filter)<< 20)
> +#define M_TC_EN_ALL M_PERFCTL_MT_EN(0)
> +#define M_TC_EN_VPE M_PERFCTL_MT_EN(1)
> +#define M_TC_EN_TC M_PERFCTL_MT_EN(2)
> +#define M_PERFCTL_TCID(tcid) ((tcid)<< 22)
> +#define M_PERFCTL_WIDE (1UL<< 30)
> +#define M_PERFCTL_MORE (1UL<< 31)
> +
> +#define M_COUNTER_OVERFLOW (1UL<< 31)
> +
Some or all of that should probably go in asm/mipsregs.h
[...]
> +
> +#define __define_perf_accessors(r, n, np) \
> + \
> +static inline unsigned int r_c0_ ## r ## n(void) \
> +{ \
> + unsigned int cpu = vpe_id(); \
> + \
> + switch (cpu) { \
> + case 0: \
> + return read_c0_ ## r ## n(); \
> + case 1: \
> + return read_c0_ ## r ## np(); \
> + default: \
Are 0 and 1 really the only conceivable values?
David Daney
next prev parent reply other threads:[~2010-05-27 21:48 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-27 13:03 [PATCH v5 00/12] MIPS performance event support v5 Deng-Cheng Zhu
2010-05-27 13:03 ` [PATCH v5 01/12] MIPS/Oprofile: extract PMU defines/helper functions for sharing Deng-Cheng Zhu
2010-05-27 21:48 ` David Daney [this message]
2010-05-29 3:06 ` Deng-Cheng Zhu
2010-05-29 3:06 ` Deng-Cheng Zhu
2010-05-29 18:20 ` David Daney
2010-05-27 13:03 ` [PATCH v5 02/12] MIPS: use generic atomic64 in non-64bit kernels Deng-Cheng Zhu
2010-05-27 21:55 ` David Daney
2010-05-27 13:03 ` [PATCH v5 03/12] MIPS: add support for software performance events Deng-Cheng Zhu
2010-05-27 22:15 ` David Daney
2010-05-27 13:03 ` [PATCH v5 04/12] MIPS: add support for hardware performance events (skeleton) Deng-Cheng Zhu
2010-05-27 22:33 ` David Daney
2010-05-29 3:08 ` Deng-Cheng Zhu
2010-05-29 3:08 ` Deng-Cheng Zhu
2010-05-27 13:03 ` [PATCH v5 05/12] MIPS/Perf-events: add callchain support Deng-Cheng Zhu
2010-05-27 22:39 ` David Daney
2010-05-27 13:03 ` [PATCH v5 06/12] MIPS: add support for hardware performance events (mipsxx) Deng-Cheng Zhu
2010-05-27 22:44 ` David Daney
2010-05-29 3:10 ` Deng-Cheng Zhu
2010-05-29 3:10 ` Deng-Cheng Zhu
2010-05-29 18:13 ` David Daney
2010-05-27 13:03 ` [PATCH v5 07/12] MIPS/Perf-events: add raw event support for mipsxx 24K/34K/74K/1004K Deng-Cheng Zhu
2010-05-27 22:48 ` David Daney
2010-05-29 3:10 ` Deng-Cheng Zhu
2010-05-29 3:10 ` Deng-Cheng Zhu
2010-05-27 13:03 ` [PATCH v5 08/12] MIPS: move mipsxx pmu helper functions to Perf-events Deng-Cheng Zhu
2010-05-27 22:52 ` David Daney
2010-05-29 3:12 ` Deng-Cheng Zhu
2010-05-29 3:12 ` Deng-Cheng Zhu
2010-05-27 13:03 ` [PATCH v5 09/12] MIPS/Perf-events: replace pmu names with numeric IDs Deng-Cheng Zhu
2010-05-27 23:10 ` David Daney
2010-05-29 3:13 ` Deng-Cheng Zhu
2010-05-29 3:13 ` Deng-Cheng Zhu
2010-05-27 13:03 ` [PATCH v5 10/12] MIPS/Perf-events: allow modules to get pmu number of counters Deng-Cheng Zhu
2010-05-27 23:16 ` David Daney
2010-05-29 3:14 ` Deng-Cheng Zhu
2010-05-29 3:14 ` Deng-Cheng Zhu
2010-05-27 13:03 ` [PATCH v5 11/12] MIPS/Oprofile: use Perf-events framework as backend Deng-Cheng Zhu
2010-05-27 23:24 ` David Daney
2010-05-29 3:15 ` Deng-Cheng Zhu
2010-05-29 3:15 ` Deng-Cheng Zhu
2010-05-27 13:03 ` [PATCH v5 12/12] MIPS/Oprofile: remove old files and update Kconfig/Makefile Deng-Cheng Zhu
2010-05-27 23:26 ` David Daney
2010-05-29 3:18 ` Deng-Cheng Zhu
2010-05-29 3:18 ` Deng-Cheng Zhu
2010-05-27 13:15 ` [PATCH v5 00/12] MIPS performance event support v5 Deng-Cheng Zhu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BFEE8B6.6040605@gmail.com \
--to=david.s.daney@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=dengcheng.zhu@gmail.com \
--cc=jamie.iles@picochip.com \
--cc=linux-mips@linux-mips.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=ralf@linux-mips.org \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.