linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Fleming <matt@console-pimps.org>
To: Robert Richter <robert.richter@amd.com>
Cc: Will Deacon <will.deacon@arm.com>,
	Paul Mundt <lethal@linux-sh.org>,
	Russell King <linux@arm.linux.org.uk>,
	linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	Deng-Cheng Zhu <dengcheng.zhu@gmail.com>,
	Grant Likely <grant.likely@secretlab.ca>
Subject: [PATCH 5/7] ARM: oprofile: Move non-ARM code into separate init/exit
Date: Sat, 09 Oct 2010 00:46:20 +0000	[thread overview]
Message-ID: <0de9eda11dbfe9c21348da07b57f04f35cd9effc.1286584677.git.matt@console-pimps.org> (raw)
In-Reply-To: <cover.1286584677.git.matt@console-pimps.org>

In preparation for moving the majority of this oprofile code into an
architecture-neutral place separate the architecture-independent code
into oprofile_perf_init() and oprofile_perf_exit().

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Tested-by: Will Deacon <will.deacon@arm.com>
---
 arch/arm/oprofile/common.c |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index fd6e323..8718311 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -349,7 +349,7 @@ static void arm_backtrace(struct pt_regs * const regs, unsigned int depth)
 		tail = user_backtrace(tail);
 }
 
-int __init oprofile_arch_init(struct oprofile_operations *ops)
+int __init oprofile_perf_init(struct oprofile_operations *ops)
 {
 	int cpu, ret = 0;
 
@@ -387,12 +387,11 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
 		}
 	}
 
-	ops->backtrace		= arm_backtrace;
-	ops->create_files	= op_arm_create_files;
-	ops->setup		= op_arm_setup;
-	ops->start		= op_arm_start;
-	ops->stop		= op_arm_stop;
-	ops->shutdown		= op_arm_stop;
+	ops->create_files	= oprofile_perf_create_files;
+	ops->setup		= oprofile_perf_setup;
+	ops->start		= oprofile_perf_start;
+	ops->stop		= oprofile_perf_stop;
+	ops->shutdown		= oprofile_perf_stop;
 	ops->cpu_type		= op_name_from_perf_id();
 
 	if (!ops->cpu_type)
@@ -410,7 +409,14 @@ out:
 	return ret;
 }
 
-void __exit oprofile_arch_exit(void)
+int __init oprofile_arch_init(struct oprofile_operations *ops)
+{
+	ops->backtrace		= arm_backtrace;
+
+	return oprofile_perf_init(ops);
+}
+
+void __exit oprofile_perf_exit(void)
 {
 	int cpu, id;
 	struct perf_event *event;
@@ -428,6 +434,11 @@ void __exit oprofile_arch_exit(void)
 	kfree(counter_config);
 	exit_driverfs();
 }
+
+void __exit oprofile_arch_exit(void)
+{
+	oprofile_perf_exit();
+}
 #else
 int __init oprofile_arch_init(struct oprofile_operations *ops)
 {
-- 
1.7.1


  parent reply	other threads:[~2010-10-09  0:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-09  0:46 [PATCH V5 0/7] Generalise ARM perf-events backend for oprofile Matt Fleming
2010-10-09  0:46 ` [PATCH 1/7] perf: Add helper function to return number of counters Matt Fleming
2010-10-09  0:46 ` [PATCH 2/7] perf: New helper function for pmu name Matt Fleming
2010-10-11  9:18   ` Robert Richter
2010-10-11  9:31     ` Peter Zijlstra
2010-10-11 15:31   ` Paul Mundt
2010-10-09  0:46 ` [PATCH 3/7] oprofile: Make op_name_from_perf_id() global Matt Fleming
2010-10-09  0:46 ` [PATCH 4/7] ARM: oprofile: Rename op_arm to oprofile_perf Matt Fleming
2010-10-09  0:46 ` Matt Fleming [this message]
2010-10-09  1:26   ` [PATCH 5/7] ARM: oprofile: Move non-ARM code into separate Robert Richter
2010-10-09  1:51     ` Robert Richter
2010-10-09 10:32     ` Matt Fleming
2010-10-09  0:46 ` [PATCH 6/7] oprofile: Abstract the perf-events backend Matt Fleming
2010-10-09  0:46 ` [PATCH 7/7] sh: oprofile: Use perf-events oprofile backend Matt Fleming
2010-10-11 11:06   ` Robert Richter
2010-10-11 11:09     ` Paul Mundt
2010-10-11 18:59 ` [PATCH V5 0/7] Generalise ARM perf-events backend for oprofile Robert Richter
2010-10-11 20:13   ` Matt Fleming

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=0de9eda11dbfe9c21348da07b57f04f35cd9effc.1286584677.git.matt@console-pimps.org \
    --to=matt@console-pimps.org \
    --cc=acme@redhat.com \
    --cc=dengcheng.zhu@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=grant.likely@secretlab.ca \
    --cc=lethal@linux-sh.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=robert.richter@amd.com \
    --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).