mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wang Nan <wangnan0@huawei.com>
To: <mtk.manpages@gmail.com>, <vincent.weaver@maine.edu>
Cc: <pi3orama@163.com>, <linux-kernel@vger.kernel.org>,
	<lizefan@huawei.com>, <linux-man@vger.kernel.org>,
	Wang Nan <wangnan0@huawei.com>
Subject: [PATCH v3][manpages 1/2] perf_event_open.2: Document PERF_EVENT_IOC_PAUSE_OUTPUT
Date: Mon, 24 Oct 2016 06:52:55 +0000	[thread overview]
Message-ID: <20161024065256.160703-2-wangnan0@huawei.com> (raw)
In-Reply-To: <20161024065256.160703-1-wangnan0@huawei.com>

Linux 4.7 (86e7972f690c1017fd086cdfe53d8524e68c661c) introduces
PERF_EVENT_IOC_PAUSE_OUTPUT feature. Document it.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Reviewed-by: Vince Weaver <vincent.weaver@maine.edu>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
---
 man2/perf_event_open.2 | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2
index fade28c..561331c 100644
--- a/man2/perf_event_open.2
+++ b/man2/perf_event_open.2
@@ -1687,6 +1687,15 @@ the
 .I data_tail
 value should be written by user space to reflect the last read data.
 In this case, the kernel will not overwrite unread data.
+
+When the mapping is read only (without
+.BR PROT_WRITE ),
+setting .I data_tail is not allowed.
+In this case, the kernel will overwrite data when sample coming, unless
+the ring buffer is paused by a
+.BR PERF_EVENT_IOC_PAUSE_OUTPUT
+.BR ioctl (2)
+system call before reading.
 .TP
 .IR data_offset " (since Linux 4.1)"
 .\" commit e8c6deac69629c0cb97c3d3272f8631ef17f8f0f
@@ -2865,6 +2874,21 @@ The argument is a BPF program file descriptor that was created by
 a previous
 .BR bpf (2)
 system call.
+.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 generation of samples, but simply
+discards the samples. The discarded samples are considered lost,
+causing
+.BR PERF_RECORD_LOST
+to be generated when possible.
+
+The argument is an integer. A nonzero value pauses the ring-buffer,
+zero resumes the ring-buffer.
+
+Pausing a read only ring buffer before reading from it without having
+to worry about data being overwritten.
 .SS Using prctl(2)
 A process can enable or disable all the event groups that are
 attached to it using the
-- 
2.10.1

  reply	other threads:[~2016-10-24  6:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24  6:52 [PATCH v3][manpages 0/2] Document new feature in perf_event_open Wang Nan
2016-10-24  6:52 ` Wang Nan [this message]
2016-11-09 13:26   ` [PATCH v3][manpages 1/2] perf_event_open.2: Document PERF_EVENT_IOC_PAUSE_OUTPUT Michael Kerrisk (man-pages)
2018-08-13 16:39   ` Michael Kerrisk (man-opages)
2016-10-24  6:52 ` [PATCH v3][manpages 2/2] perf_event_open.2: Document write_backward Wang Nan
2016-11-09 13:30   ` Michael Kerrisk (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161024065256.160703-2-wangnan0@huawei.com \
    --to=wangnan0@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mtk.manpages@gmail.com \
    --cc=pi3orama@163.com \
    --cc=vincent.weaver@maine.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome