[PATCH] perf/doc: revise the description about PR_TASK_PERF_EVENTS_{ENABLE,DISABLE}

From: Changbin Du
Date: Sun Jun 11 2023 - 22:35:55 EST


The behavior of PR_TASK_PERF_EVENTS_{ENABLE,DISABLE} has been changed
since v2.6.30, commit 082ff5a2767a ("perf_counter: Change pctrl()
behaviour").

This patch revises the documentation about these two prctl options to match
the real behavior. The linux man pages should also be updated.

Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Signed-off-by: Changbin Du <changbin.du@xxxxxxxxxx>
---
tools/perf/design.txt | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/tools/perf/design.txt b/tools/perf/design.txt
index aa8cfeabb743..cc9a2716d5ec 100644
--- a/tools/perf/design.txt
+++ b/tools/perf/design.txt
@@ -439,16 +439,15 @@ Additionally, non-inherited overflow counters can use

to enable a counter for 'nr' events, after which it gets disabled again.

-A process can enable or disable all the counter groups that are
-attached to it, using prctl:
+A thread can enable or disable all the counter groups that are
+created by itself, using prctl:

prctl(PR_TASK_PERF_EVENTS_ENABLE);

prctl(PR_TASK_PERF_EVENTS_DISABLE);

-This applies to all counters on the current process, whether created
-by this process or by another, and doesn't affect any counters that
-this process has created on other processes. It only enables or
+This applies to all counters created by this thread, and doesn't affect any
+counters that created by other processes or threads. It only enables or
disables the group leaders, not any other members in the groups.


--
2.25.1