diff mbox

[1/2] perf_event_open.2: Document PERF_EVENT_IOC_PAUSE_OUTPUT

Message ID 1477049893-143199-1-git-send-email-wangnan0@huawei.com
State New
Headers show

Commit Message

Wang Nan Oct. 21, 2016, 11:38 a.m. UTC
Linux 4.7 (86e7972f690c1017fd086cdfe53d8524e68c661c) introduces
PERF_EVENT_IOC_PAUSE_OUTPUT feature. Document it.

Signed-off-by: Wang Nan <wangnan0@huawei.com>

Cc: Michael Kerrisk <mtk.manpages@gmail.com>
---
 man2/perf_event_open.2 | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

-- 
2.10.1

Comments

Vince Weaver Oct. 21, 2016, 9:16 p.m. UTC | #1
On Fri, 21 Oct 2016, Wang Nan wrote:


> -.SS Using prctl(2)

> +.SS Using prctl


why this change?

> +.BR PERF_EVENT_IOC_PAUSE_OUTPUT " (since Linux 4.7)"

> +.\" commit 86e7972f690c1017fd086cdfe53d8524e68c661c

> +This allows pausing and resuming the event's ring-buffer. A

> +paused ring-buffer does not prevent samples generation, but simply

> +discards them. The discarded samples are considered lost, causes

> +.BR PERF_RECORD_LOST

> +to be generated when possible.


I don't know if it's worth mentioning that the reason to add this is to 
allow reading the ring-buffer without having to worry about data being
overwritten.

There are a few odd wording choices (mostly plural nouns) but otherwise 
looks fine to me.

Reviewed-by: Vince Weaver <vincent.weaver@maine.edu>
Michael Kerrisk (man-pages) Oct. 22, 2016, 10 a.m. UTC | #2
On 10/21/2016 11:16 PM, Vince Weaver wrote:
> On Fri, 21 Oct 2016, Wang Nan wrote:

> 

> 

>> -.SS Using prctl(2)

>> +.SS Using prctl

> 

> why this change?


I suspect a diff against a slight stale version of the page, 
since I added the '(2)' just a few days ago. Wang Nan, please
do pull the latest version of the page :-).

>> +.BR PERF_EVENT_IOC_PAUSE_OUTPUT " (since Linux 4.7)"

>> +.\" commit 86e7972f690c1017fd086cdfe53d8524e68c661c

>> +This allows pausing and resuming the event's ring-buffer. A

>> +paused ring-buffer does not prevent samples generation, but simply

>> +discards them. The discarded samples are considered lost, causes

>> +.BR PERF_RECORD_LOST

>> +to be generated when possible.

> 

> I don't know if it's worth mentioning that the reason to add this is to 

> allow reading the ring-buffer without having to worry about data being

> overwritten.


Wang Nan, what do you you thing. Should this be added?

> There are a few odd wording choices (mostly plural nouns) but otherwise 

> looks fine to me.

> 

> Reviewed-by: Vince Weaver <vincent.weaver@maine.edu>


Wang Nan, I'll send a few wording corrections. Could you please include 
Vince's reviewed by tag on your next revision?

Thanks,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
Michael Kerrisk (man-pages) Oct. 22, 2016, 10:02 a.m. UTC | #3
Hello Wang Nan

Thanks for this patch! A few comments below.

On 10/21/2016 01:38 PM, Wang Nan wrote:
> Linux 4.7 (86e7972f690c1017fd086cdfe53d8524e68c661c) introduces

> PERF_EVENT_IOC_PAUSE_OUTPUT feature. Document it.

> 

> Signed-off-by: Wang Nan <wangnan0@huawei.com>

> Cc: Michael Kerrisk <mtk.manpages@gmail.com>

> ---

>  man2/perf_event_open.2 | 13 ++++++++++++-

>  1 file changed, 12 insertions(+), 1 deletion(-)

> 

> diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2

> index fade28c..2d3acad 100644

> --- a/man2/perf_event_open.2

> +++ b/man2/perf_event_open.2

> @@ -2865,7 +2865,18 @@ The argument is a BPF program file descriptor that was created by

>  a previous

>  .BR bpf (2)

>  system call.

> -.SS Using prctl(2)

> +.TP

> +.BR PERF_EVENT_IOC_PAUSE_OUTPUT " (since Linux 4.7)"

> +.\" commit 86e7972f690c1017fd086cdfe53d8524e68c661c

> +This allows pausing and resuming the event's ring-buffer. A

> +paused ring-buffer does not prevent samples generation, but simply


s/samples generation/generation of samples/

> +discards them. The discarded samples are considered lost, causes


s/them/the samples/

s/causes/causing/

> +.BR PERF_RECORD_LOST

> +to be generated when possible.

> +

> +The argument is an integer. Nonzero value pauses the ring-buffer,


s/Nonzero/a nonzero/

> +zero value resumes the ring-buffer.


s/zero value/zero/

> +.SS Using prctl


As noted by Vince, the change to this SS line should not be part of this patch.

>  A process can enable or disable all the event groups that are

>  attached to it using the

>  .BR prctl (2)


Thanks,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
diff mbox

Patch

diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2
index fade28c..2d3acad 100644
--- a/man2/perf_event_open.2
+++ b/man2/perf_event_open.2
@@ -2865,7 +2865,18 @@  The argument is a BPF program file descriptor that was created by
 a previous
 .BR bpf (2)
 system call.
-.SS Using prctl(2)
+.TP
+.BR PERF_EVENT_IOC_PAUSE_OUTPUT " (since Linux 4.7)"
+.\" commit 86e7972f690c1017fd086cdfe53d8524e68c661c
+This allows pausing and resuming the event's ring-buffer. A
+paused ring-buffer does not prevent samples generation, but simply
+discards them. The discarded samples are considered lost, causes
+.BR PERF_RECORD_LOST
+to be generated when possible.
+
+The argument is an integer. Nonzero value pauses the ring-buffer,
+zero value resumes the ring-buffer.
+.SS Using prctl
 A process can enable or disable all the event groups that are
 attached to it using the
 .BR prctl (2)