The following patch adds descriptions of the new perf_event_open.2
PERF_SAMPLE_TRANSACTION sample type as added in Linux 3.13.
The descriptions are based on information provided by Andi Kleen,
both in the e-mail
[PATCH 1/6] perf, core: Add generic transaction flags v5
sent to the linux-kernel list as well as an e-mail
[PATCH] Document transaction flags in perf_event_open manpage
sent to the linux-man list.
The implementation is based heavily on the Intel Haswell
processor. Documentation can be found at this page:
http://software.intel.com/en-us/blogs/2013/05/03/intelr-transactional-synchronization-extensions-intelr-tsx-profiling-with-linux-0
as well as in section 18.11.5.1 of volume 3 of the
Intel 64 and IA-32 Architecture Software Developer's Manual.
Also, someone with better manpage formatting skills than I have
should probably investigate why I can't get the last line of
the change to properly tab-align with the .I transaction
heading.
Cowritten-by: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Clarify the perf_event_open behavior with respect to the disabled
bit and creating event groups.
Reported-by: Sudhanshu Goswami <Sudhanshu.Goswami@emc.com>
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Warn that using the perf_event_open "exclusive" bit, while it might seem
like a good idea, might lead to all 0 results in some common usage cases.
Reported-by: Sudhanshu Goswami <Sudhanshu.Goswami@emc.com>
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Here's an updated version of [David Ahern's] patch that
expands the "mmap" definition as well as that of "mmap_data".
Also some manpage related formatting improvements from the
original patch.
Link: https://lkml.org/lkml/2013/11/11/505
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This patch attempts to clarify the pid and cpu options to
perf_event_open().
It does two things:
1. Tries to make clear that the "pid" argument can mean
process *or* thread. This is made confusing by
how Linux uses the terms mostly interchangeably.
2. The cpu/pid documentation was confusing because of
how the parameters are interdependent. Since there
are only 6 possible combinations I broke out the
possibilities into a table.
Reported-by: Manuel Selva <selva.manuel@gmail.com>
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
It turns out that the perf_event mmap page rdpmc/time setting was
broken, dating back to the introduction of the feature. Due
to a mistake with a bitfield, two different values mapped to
the same feature bit.
A new somewhat backwards compatible interface was introduced
in Linux 3.12. A much longer report on the issue can be found
here:
https://lwn.net/Articles/567894/
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
A new perf_event related ioctl, PERF_EVENT_IOC_ID, was added
in Linux 3.12.
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
A new PERF_SAMPLE_IDENTIFIER sample type was added in Linux 3.12.
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Support for the PERF_COUNT_SW_DUMMY event type was added in
Linux 3.12.
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
The PERF_EVENT_IOC_PERIOD ioctl was broken until 2.6.36,
and it turns out that the ARM architecture has some
differing behavior too.
Reported-by: Andreas Sandberg <andreas.sandberg@it.uu.se>
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
The following documents the E2BIG error return for
perf_event_open().
I actually ran into this error the hard way and it took me
half a day to figure out why my ->size value was changing.
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This started out as just adding the new perf_event_open features
from Linux 3.11 (which was the addition of transactional memory
defines for PERF_SAMPLE_BRANCH_STACK samples) but turned into a
general cleanup of the PERF_SAMPLE_BRANCH_STACK documentation.
The main clarification is that at least one of the non-privilege values
must be set or else perf_event_open will return an EINVAL error.
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
The indentation of the MMAP layout section wasn't quite right.
I think this improves things but I admit I'm not an expert at the
low-level indentation directives.
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This improves the documentation of the various
perf_event_open()-related sysfs files.
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
It turns out PERF_IOC_FLAG_GROUP was broken from 75f937f24bd9
(in Linux 2.6.31, the initial perf_event release) until
724b6daa1 (Linux 3.4).
I've done some extensive kernel source code digging plus
running tests of various kernels and I hope the info
presented is accurate now.
(Patch edited somewhat by mtk.)
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This patch updates the perf_event_open() documentation to include
new interfaces added in the 3.10 kernel.
It also documents a few [To be documented] instances left over
from the 3.7 kernel.
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>