perf_event_open.2: Minor grammar, formatting, wording, and typo fixes

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2014-04-17 08:44:50 +02:00
parent d2c3d8a829
commit ce88f77b91
1 changed files with 86 additions and 73 deletions

View File

@ -97,13 +97,13 @@ when running on the specified CPU.
.TP
.BR "pid == \-1" " and " "cpu >= 0"
This measures all processes/threads on the specified CPU.
Measurements such as this require the
This requires
.B CAP_SYS_ADMIN
capability or a
.I /proc/sys/kernel/perf_event_paranoid
value of less than 1.
.TP
.BR pid==\-1 " and " cpu==\-1
.BR "pid == \-1" " and " "cpu == \-1"
This setting is invalid and will return an error.
.P
The
@ -124,7 +124,7 @@ An event group is scheduled onto the CPU as a unit: it will
be put onto the CPU only if all of the events in the group can be put onto
the CPU.
This means that the values of the member events can be
meaningfully compared, added, divided (to get ratios), and so on, with each
meaningfully compared\(emadded, divided (to get ratios), and so on\(emwith each
other, since they have counted events for the same set of executed
instructions.
.P
@ -161,7 +161,7 @@ This flag reroutes the output from an event to the group leader.
.BR PERF_FLAG_PID_CGROUP " (since Linux 2.6.39)."
This flag activates per-container system-wide monitoring.
A container
is an abstraction that isolates a set of resources for finer grain
is an abstraction that isolates a set of resources for finer-grained
control (CPUs, memory, etc.).
In this mode, the event is measured
only if the thread running on the monitored CPU belongs to the designated
@ -1262,7 +1262,7 @@ struct perf_event_mmap_page {
.fi
.in
The following looks at the fields in the
The following list describes the fields in the
.I perf_event_mmap_page
structure in more detail:
.TP
@ -1432,13 +1432,16 @@ If
is set, then the hardware clock (the TSC timestamp counter on x86)
can be calculated from the
.IR time_zero ", " time_mult ", and " time_shift " values:"
.nf
time = timestamp - time_zero;
quot = time / time_mult;
rem = time % time_mult;
cyc = (quot << time_shift) + (rem << time_shift) / time_mult;
.fi
And vice versa:
.nf
quot = cyc >> time_shift;
rem = cyc & ((1 << time_shift) - 1);
@ -1452,7 +1455,9 @@ The value continuously increases, it does not wrap.
The value needs to be manually wrapped by the size of the mmap buffer
before accessing the samples.
On SMP-capable platforms, after reading the data_head value,
On SMP-capable platforms, after reading the
.I data_head
value,
user space should issue an rmb().
.TP
.I data_tail
@ -2146,10 +2151,10 @@ to calculate event values can be found in that section.
.PP
Various ioctls act on
.BR perf_event_open ()
file descriptors
file descriptors:
.TP
.B PERF_EVENT_IOC_ENABLE
Enables the individual event or event group specified by the
This enables the individual event or event group specified by the
file descriptor argument.
If the
@ -2159,7 +2164,7 @@ enabled, even if the event specified is not the group leader
(but see BUGS).
.TP
.B PERF_EVENT_IOC_DISABLE
Disables the individual counter or event group specified by the
This disables the individual counter or event group specified by the
file descriptor argument.
Enabling or disabling the leader of a group enables or disables the
@ -2234,7 +2239,7 @@ This adds an ftrace filter to this event.
The argument is a pointer to the desired ftrace filter.
.TP
.BR PERF_EVENT_IOC_ID " (since Linux 3.12)"
Returns the event ID value for the given event fd.
This returns the event ID value for the given event fd.
The argument is a pointer to a 64-bit unsigned integer
to hold the result.
@ -2288,14 +2293,15 @@ The default value is
.TP
.I /proc/sys/kernel/perf_event_mlock_kb
Maximum number of pages an unprivileged user can mlock (2) .
Maximum number of pages an unprivileged user can
.BR mlock (2).
The default is 516 (kB).
.RE
Files in
.I /sys/bus/event_source/devices/
.RS 4
Since Linux 2.6.34 the kernel supports having multiple PMUs
Since Linux 2.6.34, the kernel supports having multiple PMUs
available for monitoring.
Information on how to program these PMUs can be found under
.IR /sys/bus/event_source/devices/ .
@ -2304,7 +2310,9 @@ Each subdirectory corresponds to a different PMU.
.IR /sys/bus/event_source/devices/*/type " (since Linux 2.6.38)"
This contains an integer that can be used in the
.I type
field of perf_event_attr to indicate you wish to use this PMU.
field of
.I perf_event_attr
to indicate that you wish to use this PMU.
.TP
.IR /sys/bus/event_source/devices/*/rdpmc " (since Linux 3.4)"
If this file is 1, then direct user-space access to the
@ -2315,7 +2323,9 @@ This can be disabled by echoing 0 to the file.
This subdirectory contains information on the architecture-specific
subfields available for programming the various
.I config
fields in the perf_event_attr struct.
fields in the
.I perf_event_attr
struct.
The content of each file is the name of the config field, followed
by a colon, followed by a series of integer bit ranges separated by
@ -2325,7 +2335,8 @@ For example, the file
may contain the value
.I config1:1,6-10,44
which indicates that event is an attribute that occupies bits 1,6-10, and 44
of perf_event_attr::config1.
of
.IR perf_event_attr::config1 .
.TP
.IR /sys/bus/event_source/devices/*/events/ " (since Linux 3.4)"
This subdirectory contains files with predefined events.
@ -2370,7 +2381,8 @@ can be inconsistent, and may
vary across processor architectures and performance monitoring units.
.TP
.B E2BIG
Returned if the perf_event_attr
Returned if the
.I perf_event_attr
.I size
value is too small
(smaller than
@ -2379,7 +2391,8 @@ too big (larger than the page size),
or larger than the kernel supports and the extra bytes are not zero.
When
.B E2BIG
is returned, the perf_event_attr
is returned, the
.I perf_event_attr
.I size
field is overwritten by the kernel to be the size of the structure
it was expecting.
@ -2522,7 +2535,7 @@ option to
is needed to properly get overflow signals in threads.
This was introduced in Linux 2.6.32.
Prior to Linux 2.6.33 (at least for x86) the kernel did not check
Prior to Linux 2.6.33 (at least for x86), the kernel did not check
if events could be scheduled together until read time.
The same happens on all known kernels if the NMI watchdog is enabled.
This means to see if a given set of events works you have to
@ -2530,11 +2543,11 @@ This means to see if a given set of events works you have to
start, then read before you know for sure you
can get valid measurements.
Prior to Linux 2.6.34 event constraints were not enforced by the kernel.
Prior to Linux 2.6.34, event constraints were not enforced by the kernel.
In that case, some events would silently return "0" if the kernel
scheduled them in an improper counter slot.
Prior to Linux 2.6.34 there was a bug when multiplexing where the
Prior to Linux 2.6.34, there was a bug when multiplexing where the
wrong results could be returned.
Kernels from Linux 2.6.35 to Linux 2.6.39 can quickly crash the kernel if