mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Vince Weaver <vincent.weaver@maine.edu>
Cc: Chad Paradis <chad.paradis@umit.maine.edu>,
	Peter Zijlstra <peterz@infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Stephane Eranian <eranian@gmail.com>
Subject: Re: [patch/rfc] perf on raspberry-pi without overflow interrupt
Date: Wed, 15 Jan 2014 18:38:22 +0000	[thread overview]
Message-ID: <20140115183822.GC28782@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1401132331290.20155@vincent-weaver-1.um.maine.edu>

Hi Vince,

On Tue, Jan 14, 2014 at 04:42:13AM +0000, Vince Weaver wrote:
> On Fri, 10 Jan 2014, Will Deacon wrote:
> > In the absence of a core change, I think I'd rather have something like your
> > second patch, but without the extra no_overflow_irq field (you can check the
> > platform device, as I mentioned previously).
> 
> Something like the following?  It works on my rasp-pi, still waiting for
> the compile to finish on the pandaboard so I haven't verified that the
> has-working-interrupt case still works.

[...]

> diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
> index bc3f2ef..e2c4aa2 100644
> --- a/arch/arm/kernel/perf_event.c
> +++ b/arch/arm/kernel/perf_event.c
> @@ -397,7 +397,7 @@ __hw_perf_event_init(struct perf_event *event)
>  	 */
>  	hwc->config_base	    |= (unsigned long)mapping;
>  
> -	if (!hwc->sample_period) {
> +	if (!is_sampling_event(event)) {
>  		/*
>  		 * For non-sampling runs, limit the sample_period to half
>  		 * of the counter width. That way, the new counter value
> @@ -407,6 +407,14 @@ __hw_perf_event_init(struct perf_event *event)
>  		hwc->sample_period  = armpmu->max_period >> 1;
>  		hwc->last_period    = hwc->sample_period;
>  		local64_set(&hwc->period_left, hwc->sample_period);
> +	} else {
> +
> +		/*
> +		 * If we have no PMU interrupt we cannot sample.
> +		 */
> +		if (platform_get_irq(armpmu->plat_device, 0) < 0)
> +			return -EOPNOTSUPP;

I think this should be <= 0, but apart from that this looks alright to me in
the absence of a core change.

Will

  reply	other threads:[~2014-01-15 18:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-08 21:28 Vince Weaver
2014-01-08 22:23 ` Stephane Eranian
2014-01-08 22:53 ` Peter Zijlstra
2014-01-09  3:47   ` Vince Weaver
2014-01-09 10:19     ` Will Deacon
2014-01-10  4:08       ` Vince Weaver
2014-01-10  9:40         ` Peter Zijlstra
2014-01-14  4:55           ` Vince Weaver
2014-01-14 10:57             ` Peter Zijlstra
2014-01-16 17:13               ` Vince Weaver
2014-01-16 17:31                 ` Peter Zijlstra
2014-01-17  5:45                   ` Vince Weaver
2014-02-24 10:46                     ` Will Deacon
2014-02-24 15:37                       ` Vince Weaver
2014-05-07 17:29                         ` Will Deacon
2014-05-07 21:21                           ` Vince Weaver
2014-05-07 21:23                             ` Will Deacon
2014-01-10 10:08         ` Will Deacon
2014-01-10 10:43           ` Stephane Eranian
2014-01-10 13:54             ` Vince Weaver
2014-01-14  4:42           ` Vince Weaver
2014-01-15 18:38             ` Will Deacon [this message]
2014-01-16 16:13               ` Vince Weaver

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=20140115183822.GC28782@mudshark.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=acme@ghostprotocols.net \
    --cc=chad.paradis@umit.maine.edu \
    --cc=eranian@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=vincent.weaver@maine.edu \
    /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

all inboxes | Powered by JetHome®