Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Matt Fleming <matt@console-pimps.org>
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
Subject: Re: [PATCH v6 4/7] MIPS: add support for hardware performance events (skeleton)
Date: Fri, 24 Sep 2010 09:36:38 +0100	[thread overview]
Message-ID: <20100924083638.GA7503@console-pimps.org> (raw)
In-Reply-To: <AANLkTinq+2LHgycDGyPgrEfkp3PSYxqagV1TfbjcQTwO@mail.gmail.com>

On Thu, Sep 23, 2010 at 03:39:51PM +0800, Deng-Cheng Zhu wrote:
> 2010/9/22 Matt Fleming <matt@console-pimps.org>:
> > I'm probably just being stupid but I can't figure out what this snippet
> > of code is doing. You're checking to see if the counter has overflowed,
> > and if it has then you just clear the overflow bit? I would have
> > expected you to reset the counter to 0.
> [DC]: Maybe my original code comment for the member msbs of the struct
> cpu_hw_events is too simple. And here is more: Unlike the perf counters in
> some other architectures, a 32bit MIPS perf counter, for example, will
> generate an interrupt after 0x7fffffff. But we want the operation to look
> like: 0x0 -> 0xffffffff -> interrupt. So there's a "pseudo" signal halfway.
> Please also note that the counter value will be brought back to 0 soon
> after it reaches 0x80000000 *each time*.

Ah OK, thanks.

> > Having conditional code like this is a pretty sure sign that you haven't
> > separated support for the various performance hardware properly. Have
> > you had a look at how SH uses a registration interface to register
> > sh_pmus?  Ideally all the internals for each type of perfcounter
> > hardware should be in their own file.
> [DC]: It does look ugly. It should be easy to put conditional code into
> perf_event_[mipsxx|loongson2|rm9000].c. I'll post a patch to fix it when
> the whole thing is accepted.

The potential problem with doing a cleanup patch after this series has
been merged is that it will modify most of the code in this patch
series - essentially rewriting it. I don't have a strong opinion
either way but Ralf may.

> > SH also has this problem that it doesn't have any sort of performance
> > counter interrupt and so can't check for overflow. This lack of
> > interrupt really needs to be solved generically in perf as it's a
> > problem that effects quite a few architectures. I suspect that using a
> > hrtimer instead of piggy-backing the timer interrupt would make the core
> > perf guys happier. Writing support for this is on my ever-growing list
> > of things todo. I've already started on some patches for the perf tool
> > so that it's possible to sample counters even though there is no
> > periodic interrupt (but that's a different problem).
> [DC]: Please add me into your post list when your patches are ready :-)
> Finally, thanks for your time to review the code.

Sure, I will do. No problem!

  reply	other threads:[~2010-09-24  8:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-09  4:35 [PATCH v6 0/7] MIPS performance event support v6 Deng-Cheng Zhu
2010-06-09  4:35 ` [PATCH v6 1/7] MIPS/Oprofile: extract PMU defines/helper functions for sharing Deng-Cheng Zhu
2010-06-09  4:35 ` [PATCH v6 2/7] MIPS: use generic atomic64 in non-64bit kernels Deng-Cheng Zhu
2010-06-09 16:58   ` David Daney
2010-08-06 16:45   ` Ralf Baechle
2010-06-09  4:35 ` [PATCH v6 3/7] MIPS: add support for software performance events Deng-Cheng Zhu
2010-09-22 11:38   ` Matt Fleming
2010-06-09  4:35 ` [PATCH v6 4/7] MIPS: add support for hardware performance events (skeleton) Deng-Cheng Zhu
2010-09-22 12:27   ` Matt Fleming
2010-09-23  7:39     ` Deng-Cheng Zhu
2010-09-24  8:36       ` Matt Fleming [this message]
2010-09-25  2:53         ` Deng-Cheng Zhu
2010-06-09  4:35 ` [PATCH v6 5/7] MIPS/Perf-events: add callchain support Deng-Cheng Zhu
2010-06-09  4:35 ` [PATCH v6 6/7] MIPS: add support for hardware performance events (mipsxx) Deng-Cheng Zhu
2010-06-09  4:35 ` [PATCH v6 7/7] MIPS: define local_xchg from xchg_local to atomic_long_xchg Deng-Cheng Zhu
2010-09-22 12:32   ` Matt Fleming
2010-09-23  7:56     ` 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=20100924083638.GA7503@console-pimps.org \
    --to=matt@console-pimps.org \
    --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 \
    /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