[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <b8f8fabb61505b10360b358016e97283ba8a621f.1283123521.git.matt@console-pimps.org>
Date: Mon, 30 Aug 2010 13:13:46 +0100
From: Matt Fleming <matt@...sole-pimps.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Zhang Rui <rui.zhang@...el.com>, linux-kernel@...r.kernel.org,
Ingo Molnar <mingo@...e.hu>,
Frederic Weisbecker <fweisbec@...il.com>,
Robert Richter <robert.richter@....com>,
Lin Ming <ming.m.lin@...el.com>,
Paul Mackerras <paulus@...ba.org>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Don Zickus <dzickus@...hat.com>,
Cyrill Gorcunov <gorcunov@...il.com>,
Len Brown <lenb@...nel.org>,
Matthew Garrett <mjg59@...f.ucam.org>
Subject: [RFC][PATCH 4/5] sh: Add support for sampling counters
SH performance counters cannot generate any form of interrupt and so
require hrtimer assistance for sampling counter values. Event groups
periodically sample counters when a hrtimer fires which allows the use
of sampling counters on SH.
Signed-off-by: Matt Fleming <matt@...sole-pimps.org>
---
arch/sh/kernel/perf_event.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/sh/kernel/perf_event.c b/arch/sh/kernel/perf_event.c
index 7a3dc35..1f77de6 100644
--- a/arch/sh/kernel/perf_event.c
+++ b/arch/sh/kernel/perf_event.c
@@ -114,7 +114,8 @@ static int __hw_perf_event_init(struct perf_event *event)
* no interrupts, and are therefore unable to do sampling without
* further work and timer assistance.
*/
- if (hwc->sample_period)
+ if (!(attr->read_format & PERF_FORMAT_GROUP) &&
+ hwc->sample_period && event->group_leader == event)
return -EINVAL;
/*
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists