* perf_event_open() -- update PERF_IOC_FLAG_GROUP info
@ 2013-07-12 21:22 Vince Weaver
[not found] ` <alpine.DEB.2.10.1307121718200.28192-6xBS8L8d439fDsnSvq7Uq4Se7xf15W0s1dQoKJhdanU@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Vince Weaver @ 2013-07-12 21:22 UTC (permalink / raw)
To: Michael Kerrisk; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA
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.
Signed-off-by: Vince Weaver <vincent.weaver-e7X0jjDqjFGHXe+LvDLADg@public.gmane.org>
diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2
index 504e801..ff7e4af 100644
--- a/man2/perf_event_open.2
+++ b/man2/perf_event_open.2
@@ -1803,7 +1803,8 @@ file descriptor argument.
If the
.B PERF_IOC_FLAG_GROUP
bit is set in the ioctl argument, then all events in a group are
-enabled, even if the event specified is not the group leader.
+enabled, even if the event specified is not the group leader
+(note this flag was broken until Linux 3.4).
.TP
.B PERF_EVENT_IOC_DISABLE
Disables the individual counter or event group specified by the
@@ -1819,7 +1820,8 @@ stops that counter from counting but doesn't affect any other counter.
If the
.B PERF_IOC_FLAG_GROUP
bit is set in the ioctl argument, then all events in a group are
-disabled, even if the event specified is not the group leader.
+disabled, even if the event specified is not the group leader
+(note this flag was broken until Linux 3.4).
.TP
.B PERF_EVENT_IOC_REFRESH
Non-inherited overflow counters can use this
@@ -1848,14 +1850,9 @@ values.
If the
.B PERF_IOC_FLAG_GROUP
bit is set in the ioctl argument, then all events in a group are
-reset, even if the event specified is not the group leader.
+reset, even if the event specified is not the group leader
+(note this flag was broken until Linux 3.4).
-If the
-.B PERF_IOC_FLAG_GROUP
-bit is not set, then the behavior is somwhat unexpected:
-when sent to a group leader only the leader is reset
-(children are left alone);
-when sent to a child all events in a group are reset.
.TP
.B PERF_EVENT_IOC_PERIOD
IOC_PERIOD is the command to update the period; it
@@ -2042,6 +2039,12 @@ Linux 2.6.36 and Linux 3.0 that ignores the
was chosen if the union has a
non-zero value in it.
+From Linux 2.6.31 to Linux 3.4 the
+.B PERF_IOC_FLAG_GROUP
+ioctl argument was broken and would repeatedly operate
+on the event specified rather than iterating across
+all sibling events in a group.
+
Always double-check your results!
Various generalized events have had wrong values.
For example, retired branches measured
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-07-16 8:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-12 21:22 perf_event_open() -- update PERF_IOC_FLAG_GROUP info Vince Weaver
[not found] ` <alpine.DEB.2.10.1307121718200.28192-6xBS8L8d439fDsnSvq7Uq4Se7xf15W0s1dQoKJhdanU@public.gmane.org>
2013-07-16 8:08 ` Michael Kerrisk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).