linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/6] metag,perf: Use common PMU interrupt disabled code
@ 2014-06-15  6:03 Vince Weaver
  2014-06-16 14:56 ` James Hogan
  2014-06-19 12:37 ` [tip:perf/core] metag, perf: " tip-bot for Vince Weaver
  0 siblings, 2 replies; 3+ messages in thread
From: Vince Weaver @ 2014-06-15  6:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Peter Zijlstra, Ingo Molnar, James Hogan


Transition to using the new generic PERF_PMU_CAP_NO_INTERRUPT method for
failing a sampling event when no PMU interrupt is available.

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>

diff --git a/arch/metag/kernel/perf/perf_event.c b/arch/metag/kernel/perf/perf_event.c
index 5cc4d4d..02c0873 100644
--- a/arch/metag/kernel/perf/perf_event.c
+++ b/arch/metag/kernel/perf/perf_event.c
@@ -568,16 +568,6 @@ static int _hw_perf_event_init(struct perf_event *event)
 		return -EINVAL;
 
 	/*
-	 * Early cores have "limited" counters - they have no overflow
-	 * interrupts - and so are unable to do sampling without extra work
-	 * and timer assistance.
-	 */
-	if (metag_pmu->max_period == 0) {
-		if (hwc->sample_period)
-			return -EINVAL;
-	}
-
-	/*
 	 * Don't assign an index until the event is placed into the hardware.
 	 * -1 signifies that we're still deciding where to put it. On SMP
 	 * systems each core has its own set of counters, so we can't do any
@@ -866,6 +856,15 @@ static int __init init_hw_perf_events(void)
 	pr_info("enabled with %s PMU driver, %d counters available\n",
 			metag_pmu->name, metag_pmu->max_events);
 
+	/*
+	 * Early cores have "limited" counters - they have no overflow
+	 * interrupts - and so are unable to do sampling without extra work
+	 * and timer assistance.
+	 */
+	if (metag_pmu->max_period == 0) {
+		metag_pmu->pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT;
+	}
+
 	/* Initialise the active events and reservation mutex */
 	atomic_set(&metag_pmu->active_events, 0);
 	mutex_init(&metag_pmu->reserve_mutex);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/6] metag,perf: Use common PMU interrupt disabled code
  2014-06-15  6:03 [PATCH 3/6] metag,perf: Use common PMU interrupt disabled code Vince Weaver
@ 2014-06-16 14:56 ` James Hogan
  2014-06-19 12:37 ` [tip:perf/core] metag, perf: " tip-bot for Vince Weaver
  1 sibling, 0 replies; 3+ messages in thread
From: James Hogan @ 2014-06-16 14:56 UTC (permalink / raw)
  To: Vince Weaver, linux-kernel; +Cc: Peter Zijlstra, Ingo Molnar

Hi Vince,

On 15/06/14 07:03, Vince Weaver wrote:
> 
> Transition to using the new generic PERF_PMU_CAP_NO_INTERRUPT method for
> failing a sampling event when no PMU interrupt is available.
> 
> Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>


> @@ -866,6 +856,15 @@ static int __init init_hw_perf_events(void)
>  	pr_info("enabled with %s PMU driver, %d counters available\n",
>  			metag_pmu->name, metag_pmu->max_events);
>  
> +	/*
> +	 * Early cores have "limited" counters - they have no overflow
> +	 * interrupts - and so are unable to do sampling without extra work
> +	 * and timer assistance.
> +	 */
> +	if (metag_pmu->max_period == 0) {
> +		metag_pmu->pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT;
> +	}

The braces could be dropped.

Otherwise looks good to me,

Acked-by: James Hogan <james.hogan@imgtec.com>

Cheers
James

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/core] metag, perf: Use common PMU interrupt disabled code
  2014-06-15  6:03 [PATCH 3/6] metag,perf: Use common PMU interrupt disabled code Vince Weaver
  2014-06-16 14:56 ` James Hogan
@ 2014-06-19 12:37 ` tip-bot for Vince Weaver
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Vince Weaver @ 2014-06-19 12:37 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, paulus, hpa, mingo, james.hogan, peterz, acme,
	vincent.weaver, tglx

Commit-ID:  1b92722fafe2003e49ec904f33c0020ade36bd16
Gitweb:     http://git.kernel.org/tip/1b92722fafe2003e49ec904f33c0020ade36bd16
Author:     Vince Weaver <vincent.weaver@maine.edu>
AuthorDate: Sun, 15 Jun 2014 02:03:13 -0400
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 18 Jun 2014 18:43:45 +0200

metag, perf: Use common PMU interrupt disabled code

Transition to using the new generic PERF_PMU_CAP_NO_INTERRUPT method for
failing a sampling event when no PMU interrupt is available.

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linux-metag@vger.kernel.org
Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1406150202050.16738@vincent-weaver-1.umelst.maine.edu
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/metag/kernel/perf/perf_event.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/arch/metag/kernel/perf/perf_event.c b/arch/metag/kernel/perf/perf_event.c
index 5cc4d4d..02c0873 100644
--- a/arch/metag/kernel/perf/perf_event.c
+++ b/arch/metag/kernel/perf/perf_event.c
@@ -568,16 +568,6 @@ static int _hw_perf_event_init(struct perf_event *event)
 		return -EINVAL;
 
 	/*
-	 * Early cores have "limited" counters - they have no overflow
-	 * interrupts - and so are unable to do sampling without extra work
-	 * and timer assistance.
-	 */
-	if (metag_pmu->max_period == 0) {
-		if (hwc->sample_period)
-			return -EINVAL;
-	}
-
-	/*
 	 * Don't assign an index until the event is placed into the hardware.
 	 * -1 signifies that we're still deciding where to put it. On SMP
 	 * systems each core has its own set of counters, so we can't do any
@@ -866,6 +856,15 @@ static int __init init_hw_perf_events(void)
 	pr_info("enabled with %s PMU driver, %d counters available\n",
 			metag_pmu->name, metag_pmu->max_events);
 
+	/*
+	 * Early cores have "limited" counters - they have no overflow
+	 * interrupts - and so are unable to do sampling without extra work
+	 * and timer assistance.
+	 */
+	if (metag_pmu->max_period == 0) {
+		metag_pmu->pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT;
+	}
+
 	/* Initialise the active events and reservation mutex */
 	atomic_set(&metag_pmu->active_events, 0);
 	mutex_init(&metag_pmu->reserve_mutex);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-19 12:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-15  6:03 [PATCH 3/6] metag,perf: Use common PMU interrupt disabled code Vince Weaver
2014-06-16 14:56 ` James Hogan
2014-06-19 12:37 ` [tip:perf/core] metag, perf: " tip-bot for Vince Weaver

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).