How about limiting refresh ioctl to sampling events ?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Franck Bui-Huu
Date: Tuesday, November 23, 2010 - 6:01 am

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
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
How about limiting refresh ioctl to sampling events ?, Franck Bui-Huu, (Tue Nov 23, 6:01 am)
Re: How about limiting refresh ioctl to sampling events ?, Peter Zijlstra, (Tue Nov 23, 6:07 am)
Re: How about limiting refresh ioctl to sampling events ?, Franck Bui-Huu, (Tue Nov 23, 6:19 am)
Re: How about limiting refresh ioctl to sampling events ?, Peter Zijlstra, (Tue Nov 23, 6:46 am)
Re: How about limiting refresh ioctl to sampling events ?, Francis Moreau, (Wed Nov 24, 3:19 am)