aboutsummaryrefslogtreecommitdiff
path: root/kernel/perf_counter.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-03-13 12:21:34 +0100
committerIngo Molnar <mingo@elte.hu>2009-04-06 09:29:40 +0200
commitac17dc8e58f3069ea895cfff963adf98ff3cf6b2 (patch)
treefe07b13dd100fd1f650d8437296f5c6908e9adea /kernel/perf_counter.c
parent7dd1fcc258b65da718f01e4684a7b9244501a9fb (diff)
perf_counter: provide major/minor page fault software events
Provide separate sw counters for major and minor page faults. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/perf_counter.c')
-rw-r--r--kernel/perf_counter.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index 1773c5d7427..68950a3a52b 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -1503,6 +1503,12 @@ static void perf_swcounter_disable(struct perf_counter *counter)
perf_swcounter_update(counter);
}
+static const struct hw_perf_counter_ops perf_ops_generic = {
+ .enable = perf_swcounter_enable,
+ .disable = perf_swcounter_disable,
+ .read = perf_swcounter_read,
+};
+
/*
* Software counter: cpu wall time clock
*/
@@ -1604,16 +1610,6 @@ static const struct hw_perf_counter_ops perf_ops_task_clock = {
};
/*
- * Software counter: page faults
- */
-
-static const struct hw_perf_counter_ops perf_ops_page_faults = {
- .enable = perf_swcounter_enable,
- .disable = perf_swcounter_disable,
- .read = perf_swcounter_read,
-};
-
-/*
* Software counter: context switches
*/
@@ -1753,9 +1749,9 @@ sw_perf_counter_init(struct perf_counter *counter)
hw_ops = &perf_ops_cpu_clock;
break;
case PERF_COUNT_PAGE_FAULTS:
- if (!(counter->hw_event.exclude_user ||
- counter->hw_event.exclude_kernel))
- hw_ops = &perf_ops_page_faults;
+ case PERF_COUNT_PAGE_FAULTS_MIN:
+ case PERF_COUNT_PAGE_FAULTS_MAJ:
+ hw_ops = &perf_ops_generic;
break;
case PERF_COUNT_CONTEXT_SWITCHES:
if (!counter->hw_event.exclude_kernel)