[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <m3zkt05h3w.fsf@gmail.com>
Date: Tue, 23 Nov 2010 14:01:23 +0100
From: Franck Bui-Huu <vagabon.xyz@...il.com>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: lkml <linux-kernel@...r.kernel.org>
Subject: How about limiting refresh ioctl to sampling events ?
Hello Peter,
I'm looking at the perf event stuff and wondering if
perf_event_refresh() should be limited to sampling events.
Does the following make sense ?
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 3b105e0..1a90a6c 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -1072,7 +1072,7 @@ static int perf_event_refresh(struct perf_event *event, int refresh)
/*
* not supported on inherited events
*/
- if (event->attr.inherit)
+ if (event->attr.inherit || !event->attr.sample_period)
return -EINVAL;
atomic_add(refresh, &event->event_limit);
Thanks
--
Franck
--
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