lkml.org 
[lkml]   [2010]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC][PATCH 4/5] sh: Add support for sampling counters
Date
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


\
 
 \ /
  Last update: 2010-08-30 14:17    [W:0.073 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site