linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: matt@console-pimps.org (Matt Fleming)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/7] oprofile: Make op_name_from_perf_id() global
Date: Sat,  9 Oct 2010 01:46:18 +0100	[thread overview]
Message-ID: <7b803da1bb48b15e29c966ff925cfb21f9015e6c.1286584677.git.matt@console-pimps.org> (raw)
In-Reply-To: <cover.1286584677.git.matt@console-pimps.org>

Make op_name_from_perf_id() global so that we have a way for each
architecture to construct an oprofile name for op->cpu_type. We need to
remove the argument from the function prototype so that we can hide all
implementation details inside the function.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
---
 arch/arm/oprofile/common.c |    6 ++++--
 include/linux/oprofile.h   |    4 ++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index 1e971a7..4f67cfa 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -155,8 +155,10 @@ static void op_perf_stop(void)
 }
 
 
-static char *op_name_from_perf_id(enum arm_perf_pmu_ids id)
+char *op_name_from_perf_id(void)
 {
+	enum arm_perf_pmu_ids id = armpmu_get_pmu_id();
+
 	switch (id) {
 	case ARM_PERF_PMU_ID_XSCALE1:
 		return "arm/xscale1";
@@ -391,7 +393,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
 	ops->start		= op_arm_start;
 	ops->stop		= op_arm_stop;
 	ops->shutdown		= op_arm_stop;
-	ops->cpu_type		= op_name_from_perf_id(armpmu_get_pmu_id());
+	ops->cpu_type		= op_name_from_perf_id();
 
 	if (!ops->cpu_type)
 		ret = -ENODEV;
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 5171639..1574d4a 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -185,4 +185,8 @@ int oprofile_add_data(struct op_entry *entry, unsigned long val);
 int oprofile_add_data64(struct op_entry *entry, u64 val);
 int oprofile_write_commit(struct op_entry *entry);
 
+#ifdef CONFIG_PERF_EVENTS
+char *op_name_from_perf_id(void);
+#endif /* CONFIG_PERF_EVENTS */
+
 #endif /* OPROFILE_H */
-- 
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 ` Matt Fleming [this message]
2010-10-09  0:46 ` [PATCH 4/7] ARM: oprofile: Rename op_arm to oprofile_perf Matt Fleming
2010-10-09  0:46 ` [PATCH 5/7] ARM: oprofile: Move non-ARM code into separate init/exit Matt Fleming
2010-10-09  1:26   ` 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=7b803da1bb48b15e29c966ff925cfb21f9015e6c.1286584677.git.matt@console-pimps.org \
    --to=matt@console-pimps.org \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).