lkml.org 
[lkml]   [2016]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf core: Introduce new ioctl options to pause and resume ring buffer


On 2016/1/18 20:02, Peter Zijlstra wrote:
> On Mon, Jan 18, 2016 at 11:52:01AM +0000, Wang Nan wrote:
>
>> +#define PERF_EVENT_IOC_PAUSE_OUTPUT _IO ('$', 9)
>> +#define PERF_EVENT_IOC_RESUME_OUTPUT _IO ('$', 10)
> Would not a single IOCTL with a 'boolean' parameter make more sense?

Good suggestion.

>> +++ b/kernel/events/ring_buffer.c
>> @@ -125,7 +125,7 @@ int perf_output_begin(struct perf_output_handle *handle,
>> if (unlikely(!rb))
>> goto out;
>>
>> - if (unlikely(!rb->nr_pages))
>> + if (unlikely(rb->paused))
>> goto out;
> Should we increment rb->lost in this case?

Not sure about this. The ring buffer is paused deliberately, shall we
consider the
events we miss as losted events? However I'll try it in next version.

Thank you.


\
 
 \ /
  Last update: 2016-01-19 04:21    [W:0.344 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site