aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikołaj Kołek <kolek.mikolaj@gmail.com>2024-07-02 21:19:28 +0200
committerAlejandro Colomar <alx@kernel.org>2024-07-09 14:28:13 +0200
commit0f1f2327069d0c0ebb1f090ca1a183ca51de75f2 (patch)
tree092e6d2904e0f649fff763e0976cb2bbd2482250
parent346bb648cc963bd9f2c8b16d984cb49030faa05b (diff)
downloadman-pages-0f1f2327069d0c0ebb1f090ca1a183ca51de75f2.tar.gz
perf_event_open.2: Document combining inherit and cpus = -1 preventing the use of mmap
After calling perf_event_open() with cpus == -1 and the inherit bit, using mmap on the perf file descriptor to create a ring-buffer fails with EINVAL. This behavior wasn't previously documented in the man page and is caused by the following lines in the perf_mmap function in <kernel/events/core.c>: /* * Don't allow mmap() of inherited per-task counters. This would * create a performance issue due to all children writing to the * same rb. */ if (event->cpu == -1 && event->attr.inherit) return -EINVAL; Signed-off-by: Mikołaj Kołek <kolek.mikolaj@gmail.com> Message-ID: <CAHGiy6-nx0PwBi6xwoG8PN5qND-krGh_rvpfmVc31-QSv04C6g@mail.gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--man/man2/perf_event_open.24
1 files changed, 4 insertions, 0 deletions
diff --git a/man/man2/perf_event_open.2 b/man/man2/perf_event_open.2
index 15411027d7..72d8fd7971 100644
--- a/man/man2/perf_event_open.2
+++ b/man/man2/perf_event_open.2
@@ -1027,6 +1027,10 @@ Inherit does not work for some combinations of
.I read_format
values, such as
.BR PERF_FORMAT_GROUP .
+Additionally, using it together with
+.I cpu == \-1
+prevents the creation of the mmap ring-buffer used for
+logging asynchronous events in sampled mode.
.TP
.I pinned
The