Messages in this thread Patch in this message | | | From | Matt Fleming <> | Subject | [RFC][PATCH 4/5] sh: Add support for sampling counters | Date | Mon, 30 Aug 2010 13:13:46 +0100 |
| |
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@console-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
| |