From d134c429711132b5bc0e2216bc7d6ddf8c1004af Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Mon, 11 Jun 2018 13:26:52 -0400 Subject: [PATCH] perf_event_open.2: Fix prctl behavior description Some discussion on the linux-perf-users list has turned up that the perf_event_open.2 description of how PR_TASK_PERF_EVENTS_ENABLE / PR_TASK_PERF_EVENTS_DISABLE prctl() works is misleading. The descriptions were based on the tools/perf/design.txt document which describes behavior that was removed in 082ff5a2767a06 (prior to 2.6.31, the first release with perf_event_open support). I have written some tests in my perf_event_tests testsuite that verifies the behavior of prctl() in this case. Signed-off-by: Vince Weaver Signed-off-by: Michael Kerrisk --- man2/perf_event_open.2 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2 index 2a70582e0..ce733bb03 100644 --- a/man2/perf_event_open.2 +++ b/man2/perf_event_open.2 @@ -2927,18 +2927,18 @@ a previous .BR bpf (2) system call. .SS Using prctl(2) -A process can enable or disable all the event groups that are -attached to it using the +A process can enable or disable all currently open event groups +using the .BR prctl (2) .B PR_TASK_PERF_EVENTS_ENABLE and .B PR_TASK_PERF_EVENTS_DISABLE operations. -This applies to all counters on the calling process, whether created by -this process or by another, and does not affect any counters that this -process has created on other processes. -It enables or disables only -the group leaders, not any other members in the groups. +This applies only to events created locally by the calling process. +This does not apply to events created by other processes attached +to the calling process or inherited events from a parent process. +Only group leaders are enabled and disabled, +not any other members of the groups. .SS perf_event related configuration files .PP Files in