1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
.\" Copyright, the authors of the Linux man-pages project
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
.TH PR_TASK_PERF_EVENTS_DISABLE 2const 2025-06-02 "Linux man-pages (unreleased)"
.SH NAME
PR_TASK_PERF_EVENTS_DISABLE,
PR_TASK_PERF_EVENTS_ENABLE
\-
disable or enable performance counters attached to the calling process
.SH LIBRARY
Standard C library
.RI ( libc ,\~ \-lc )
.SH SYNOPSIS
.nf
.BR "#include <linux/prctl.h>" " /* Definition of " PR_* " constants */"
.B #include <sys/prctl.h>
.P
.B int prctl(PR_TASK_PERF_EVENTS_DISABLE);
.B int prctl(PR_TASK_PERF_EVENTS_ENABLE);
.fi
.SH DESCRIPTION
.TP
.B PR_TASK_PERF_EVENTS_DISABLE
Disable all performance counters attached to the calling process,
regardless of whether the counters were created by
this process or another process.
Performance counters created by the calling process for other
processes are unaffected.
.TP
.B PR_TASK_PERF_EVENTS_ENABLE
The converse of
.BR PR_TASK_PERF_EVENTS_DISABLE ;
enable performance counters attached to the calling process.
.SH RETURN VALUE
On success,
0 is returned.
On error, \-1 is returned, and
.I errno
is set to indicate the error.
.SH STANDARDS
Linux.
.SH HISTORY
Linux 2.6.31.
.P
Originally called
.B PR_TASK_PERF_COUNTERS_DISABLE
and
.BR PR_TASK_PERF_COUNTERS_ENABLE ;
.\" commit 1d1c7ddbfab358445a542715551301b7fc363e28
renamed (retaining the same numerical value)
.\" commit cdd6c482c9ff9c55475ee7392ec8f672eddb7be6
in Linux 2.6.32.
.SH SEE ALSO
.BR prctl (2)
.P
For more information on performance counters, see the Linux kernel source file
.IR tools/\:perf/\:design.txt .
|