login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
November
»
23
Re: How about limiting refresh ioctl to sampling events ?
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Peter Zijlstra
Subject:
Re: How about limiting refresh ioctl to sampling events ?
Date: Tuesday, November 23, 2010 - 6:46 am
On Tue, 2010-11-23 at 14:19 +0100, Franck Bui-Huu wrote:
quoted text
> Peter Zijlstra <a.p.zijlstra@chello.nl> writes: > > > On Tue, 2010-11-23 at 14:01 +0100, Franck Bui-Huu wrote: > >> 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); > > > > Yes it does, please submit as a proper patch. > > Ok. > > I'm also wondering if you would accept a second patch which will > introduce: > > static inline bool is_sampling_event(struct perf_event *event) > { > return event->attr.sample_period != 0; > } > > That would make the code slighlty easier to read IMHO. >
Sure, Francis might want that too, he found another something like this. --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
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)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Jesse Barnes
Re: [stable] [BUG][PATCH] cpqphp: fix kernel NULL pointer dereference
Greg KH
[003/136] p54usb: add Zcomax XG-705A usbid
Magnus Damm
[PATCH 03/07] ARM: Use shared GIC entry macros on Realview
Oliver Neukum
Re: [Bug #13682] The webcam stopped working when upgrading from 2.6.29 to 2.6.30
Martin Schwidefsky
Re: [PATCH] optimized ktime_get[_ts] for GENERIC_TIME=y
git
:
Junio C Hamano