From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/6] perf-events: export enable/disable event symbols to kernel modules
Date: Wed, 10 Mar 2010 10:41:28 +0000 [thread overview]
Message-ID: <1268217690-29712-5-git-send-email-will.deacon@arm.com> (raw)
In-Reply-To: <1268217690-29712-4-git-send-email-will.deacon@arm.com>
The perf_event_enable and perf_event_disable functions are used to
control the activation of perf-events for a given context or CPU.
This patch exports these symbols so that they can be used by kernel
modules. Without these symbols, an event must be destroyed and recreated
to disable or enable it respectively. The maximum number of perf-events
is also made available to modules via the perf_get_max_events function.
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
include/linux/perf_event.h | 1 +
kernel/perf_event.c | 8 ++++++++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index a177698..c28a0ee 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -741,6 +741,7 @@ struct perf_output_handle {
* Set by architecture code:
*/
extern int perf_max_events;
+extern int perf_get_max_events(void);
extern const struct pmu *hw_perf_event_init(struct perf_event *event);
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 2ae7409..0157033 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -39,6 +39,12 @@
static DEFINE_PER_CPU(struct perf_cpu_context, perf_cpu_context);
int perf_max_events __read_mostly = 1;
+int perf_get_max_events(void)
+{
+ return perf_max_events;
+}
+EXPORT_SYMBOL_GPL(perf_get_max_events);
+
static int perf_reserved_percpu __read_mostly;
static int perf_overcommit __read_mostly = 1;
@@ -604,6 +610,7 @@ void perf_event_disable(struct perf_event *event)
raw_spin_unlock_irq(&ctx->lock);
}
+EXPORT_SYMBOL_GPL(perf_event_disable);
static int
event_sched_in(struct perf_event *event,
@@ -1028,6 +1035,7 @@ void perf_event_enable(struct perf_event *event)
out:
raw_spin_unlock_irq(&ctx->lock);
}
+EXPORT_SYMBOL_GPL(perf_event_enable);
static int perf_event_refresh(struct perf_event *event, int refresh)
{
--
1.6.3.3
next prev parent reply other threads:[~2010-03-10 10:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-10 10:41 [PATCH 0/6] ARM: oprofile: use perf-events framework as backend [v2] Will Deacon
2010-03-10 10:41 ` [PATCH 1/6] ARM: perf-events: add Realview PMU IRQs to pmu.c Will Deacon
2010-03-10 10:41 ` [PATCH 2/6] ARM: perf-events: use numeric ID to identify PMU Will Deacon
2010-03-10 10:41 ` [PATCH 3/6] ARM: perf-events: add support for xscale PMUs Will Deacon
2010-03-10 10:41 ` Will Deacon [this message]
2010-03-10 10:41 ` [PATCH 5/6] ARM: oprofile: use perf-events framework as backend Will Deacon
2010-03-10 10:41 ` [PATCH 6/6] ARM: oprofile: remove old files and update KConfig Will Deacon
2010-03-10 10:56 ` [PATCH 4/6] perf-events: export enable/disable event symbols to kernel modules Peter Zijlstra
2010-03-10 11:47 ` Will Deacon
2010-03-10 14:30 ` Peter Zijlstra
2010-03-10 14:41 ` Will Deacon
2010-03-10 15:01 ` Robert Richter
2010-03-10 11:03 ` [PATCH 2/6] ARM: perf-events: use numeric ID to identify PMU Jamie Iles
2010-03-10 21:59 ` [PATCH 1/6] ARM: perf-events: add Realview PMU IRQs to pmu.c Tony Lindgren
2010-03-10 22:27 ` Albin Tonnerre
2010-03-10 22:34 ` Tony Lindgren
-- strict thread matches above, loose matches on Subject: below --
2010-02-25 18:56 [PATCH 0/6] ARM: oprofile: use perf-events framework as backend Will Deacon
2010-02-25 18:56 ` [PATCH 1/6] ARM: perf-events: add Realview PMU IRQs to pmu.c Will Deacon
2010-02-25 18:56 ` [PATCH 2/6] ARM: perf-events: use numeric ID to identify PMU Will Deacon
2010-02-25 18:56 ` [PATCH 3/6] ARM: perf-events: add support for xscale PMUs Will Deacon
2010-02-25 18:56 ` [PATCH 4/6] perf-events: export enable/disable event symbols to kernel modules Will Deacon
2010-02-26 8:23 ` Ingo Molnar
2010-02-26 9:53 ` Will Deacon
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=1268217690-29712-5-git-send-email-will.deacon@arm.com \
--to=will.deacon@arm.com \
--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).