Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH V2 01/14] MIPS: make oprofile use cp0_perfcount_irq if it is set
@ 2012-05-02 12:27 John Crispin
  2012-05-02 12:27 ` [PATCH V2 02/14] MIPS: pci: parse memory ranges from devicetree John Crispin
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: John Crispin @ 2012-05-02 12:27 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips@linux-mips.org, Felix Fietkau, John Crispin

From: Felix Fietkau <nbd@openwrt.org>

Make the oprofile code use the performance counters irq.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John Crispin <blogic@openwrt.org>

---
Changes in V2
* set Author to Felix

 arch/mips/oprofile/op_model_mipsxx.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c
index 54759f1..86cf234 100644
--- a/arch/mips/oprofile/op_model_mipsxx.c
+++ b/arch/mips/oprofile/op_model_mipsxx.c
@@ -298,6 +298,11 @@ static void reset_counters(void *arg)
 	}
 }
 
+static irqreturn_t mipsxx_perfcount_int(int irq, void *dev_id)
+{
+	return mipsxx_perfcount_handler();
+}
+
 static int __init mipsxx_init(void)
 {
 	int counters;
@@ -374,6 +379,10 @@ static int __init mipsxx_init(void)
 	save_perf_irq = perf_irq;
 	perf_irq = mipsxx_perfcount_handler;
 
+	if (cp0_perfcount_irq >= 0)
+		return request_irq(cp0_perfcount_irq, mipsxx_perfcount_int,
+			IRQF_SHARED, "Perfcounter", save_perf_irq);
+
 	return 0;
 }
 
@@ -381,6 +390,9 @@ static void mipsxx_exit(void)
 {
 	int counters = op_model_mipsxx_ops.num_counters;
 
+	if (cp0_perfcount_irq >= 0)
+		free_irq(cp0_perfcount_irq, save_perf_irq);
+
 	counters = counters_per_cpu_to_total(counters);
 	on_each_cpu(reset_counters, (void *)(long)counters, 1);
 
-- 
1.7.9.1

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

end of thread, other threads:[~2012-05-02 18:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-02 12:27 [PATCH V2 01/14] MIPS: make oprofile use cp0_perfcount_irq if it is set John Crispin
2012-05-02 12:27 ` [PATCH V2 02/14] MIPS: pci: parse memory ranges from devicetree John Crispin
2012-05-02 18:12   ` Sergei Shtylyov
2012-05-02 12:27 ` [PATCH V2 04/14] MIPS: Add helper function to allow platforms to point at a DTB John Crispin
2012-05-02 12:27 ` [PATCH V2 05/14] MIPS: parse chosen node on boot John Crispin
2012-05-02 12:27 ` [PATCH V2 08/14] MIPS: lantiq: clear all irqs properly " John Crispin
2012-05-02 12:27 ` [PATCH V2 09/14] MIPS: lantiq: enable oprofile support on lantiq targets John Crispin
2012-05-02 12:27 ` [PATCH V2 11/14] MIPS: lantiq: fix early printk John Crispin
2012-05-02 12:27 ` [PATCH V2 12/14] MIPS: lantiq: fix cmdline parsing John Crispin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox