linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: Sat, 29 May 2010 11:20:08 -0700	[thread overview]
Message-ID: <4C015AD8.3020408@gmail.com> (raw)
In-Reply-To: <AANLkTilx-yMwFE0cj3jQu1BZEx_XW2_sj-lRAfzNO88o@mail.gmail.com>

On 05/28/2010 08:06 PM, Deng-Cheng Zhu wrote:
> Hi, David
>
>
> Thanks for your comments! I'm replying to you in the patch order. If my
> comments are wrong or are bad ideas, please point out.
>
>
> 2010/5/28 David Daney<david.s.daney@gmail.com>:
>    
>> 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)
>>      
> [DC]:
> 1) This line is not for the "entire" contents of the file, other CPUs
> LOONGSON2 and RM9000 are here.
>    

In any event I think you want defined(CONFIG_CPU_MIPSR1) || 
defined(CONFIG_CPU_MIPSR2) instead of what you had.

> 2) The CONFIG_CPU* came from the Makefile of oprofile. If other CPUs are
> newly supported, we can add into the #if #elif.
>    

TOO_MANY_#IF == BAD.  You are rewriting the code here, you can take the 
opportunity to improve it.

> 3) The perf counter helper functions are special to mipsxx/loongson2/rm9000
> espcially the reset_counter() will be implemented respectively. Although
> they will be moved to perf_event_$cpu.c when Oprofile uses Perf-events as
> backend, they are currently shared by Oprofile and Perf-events to reduce
> code copying.
>
>
>    
>> Some or all of that should probably go in asm/mipsregs.h
>>      
> [DC]: Now that we create pmu.h and these #define's are originally in
> op_model_$cpu.c not in mipsregs.h, how about keeping them here? BTW, after
> making Oprofile use Perf-events as backend (patches 8~12 do this), pmu.h
> will only contain register definitions (no static function definitions),
> then we can consider deleting pmu.h and moving its contents to mipsregs.h,
> is it OK?
>
>    

I don't have super strong preferences for where the bit definitions for 
cop0 registers go.  To date most are in mipsregs.h.  Perhaps Ralf has a 
preference.
>> Are 0 and 1 really the only conceivable values?
>>      
> [DC]: This is also from Oprofile. If we use:
> #define vpe_id()       (cpu_has_mipsmt_pertccounters ? \
>                         0 : cpu_data[smp_processor_id()].vpe_id)
> The possible return value is supposed to be 0 or 1.
>    

I haven't read the architecture specification for the multithread ASE.  
Is it really true that exactly two VPEs is all that is allowed?  If so 
this seems fine, otherwise it should reflect the full range of allowed 
values.

David Daney

  parent reply	other threads:[~2010-05-29 18:20 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
2010-05-29  3:06     ` Deng-Cheng Zhu
2010-05-29  3:06       ` Deng-Cheng Zhu
2010-05-29 18:20       ` David Daney [this message]
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=4C015AD8.3020408@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).