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

Message ID 20230612023523.3918618-1-changbin.du@huawei.com
State New
Headers
Series perf/doc: revise the description about PR_TASK_PERF_EVENTS_{ENABLE,DISABLE} |

Commit Message

Changbin Du June 12, 2023, 2:35 a.m. UTC
  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@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Changbin Du <changbin.du@huawei.com>
---
 tools/perf/design.txt | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
  

Comments

Changbin Du July 18, 2023, 1:42 a.m. UTC | #1
Hi Arnaldo,
Could you pick this? So I can update the prctl man pages as well.

On Mon, Jun 12, 2023 at 10:35:23AM +0800, Changbin Du wrote:
> 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@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Changbin Du <changbin.du@huawei.com>
> ---
>  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
>
  

Patch

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.