Skip to contentSkip to conversation

perf: Fix inheritance of aux_output groups

PATCH Applied Alexander Shishkin 3 participants 4 messages Oct 4, 2019 – Oct 7, 2019 perf events

lore
Share & tools
lore

Alexander Shishkin

author reviewer
#0 lore raw

PATCH 1/1 perf: Fix inheritance of aux_output groups

Commit

b43762ef010 ("perf: Allow normal events to output AUX data")

forgets to configure aux_output relation in the inherited groups, which results in child PEBS events forever failing to schedule.

Fix this by setting up the AUX output link in the inheritance path.

---
 kernel/events/core.c | 4 ++++
 1 file changed, 4 insertions(+)
kernel/events/core.c +4 -0
index f5bb2557d5f6..761995f21b30 100644
@@ -12024,6 +12024,10 @@ static int inherit_group(struct perf_event *parent_event,
 					    child, leader, child_ctx);
 		if (IS_ERR(child_ctr))
 			return PTR_ERR(child_ctr);
+
+		if (sub->aux_event == parent_event &&
+		    !perf_get_aux_event(child_ctr, leader))
+			return -EINVAL;
 	}
 	return 0;
 }
Signature · 1 line
2.23.0
#1 lore raw
Quoted 3 lines · Alexander Shishkin

Commit

b43762ef010 ("perf: Allow normal events to output AUX data")

Missing 'a', the proper SHA1 is:

ab43762ef010 ("perf: Allow normal events to output AUX data")

:-)

Quoted 15 lines

forgets to configure aux_output relation in the inherited groups, which results in child PEBS events forever failing to schedule.

Fix this by setting up the AUX output link in the inheritance path.

---
 kernel/events/core.c | 4 ++++
 1 file changed, 4 insertions(+)
kernel/events/core.c +0 -0
index f5bb2557d5f6..761995f21b30 100644

kernel/events/core.c static int inherit_group(struct perf_event *parent_event, · line 12030

Quoted 7 lines
kernel/events/core.c +4 -0
@@ -12024,6 +12024,10 @@ static int inherit_group(struct perf_event *parent_event,
 					    child, leader, child_ctx);
 		if (IS_ERR(child_ctr))
 			return PTR_ERR(child_ctr);
+
+		if (sub->aux_event == parent_event &&
+		    !perf_get_aux_event(child_ctr, leader))
+			return -EINVAL;

Could this explain weird 'perf top' failures I'm seeing on my desktop, which I was just about to debug and report?

Thanks,

Ingo

author reviewer
#2 lore raw
Quoted 11 lines · Ingo Molnar
Quoted 3 lines · Alexander Shishkin

Commit

b43762ef010 ("perf: Allow normal events to output AUX data")

Missing 'a', the proper SHA1 is:

ab43762ef010 ("perf: Allow normal events to output AUX data")

:-)

Ouch, sorry about that.

Quoted 2 lines

Could this explain weird 'perf top' failures I'm seeing on my desktop, which I was just about to debug and report?

Unlikely; to trigger the above you'd have to manually enable the aux_output thingy and that would require HW support to begin with.

Thanks,
--
Alex

#3 lore raw

[tip: perf/urgent] perf/core: Fix inheritance of aux_output groups

In reply to Alexander Shishkin
The following commit has been merged into the perf/urgent branch of tip:

The following commit has been merged into the perf/urgent branch of tip:

Commit-ID:     f733c6b508bcaa3441ba1eacf16efb9abd47489f
Gitweb:        https://git.kernel.org/tip/f733c6b508bcaa3441ba1eacf16efb9abd47489f
Author:        Alexander Shishkin <[email protected]>
AuthorDate:    Fri, 04 Oct 2019 15:57:29 +03:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Mon, 07 Oct 2019 16:50:42 +02:00

perf/core: Fix inheritance of aux_output groups

Commit:

ab43762ef010 ("perf: Allow normal events to output AUX data")

forgets to configure aux_output relation in the inherited groups, which results in child PEBS events forever failing to schedule.

Fix this by setting up the AUX output link in the inheritance path.

Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 kernel/events/core.c | 4 ++++
 1 file changed, 4 insertions(+)
kernel/events/core.c +4 -0
index 3f0cb82..f953dd1 100644
@@ -11862,6 +11862,10 @@ static int inherit_group(struct perf_event *parent_event,
 					    child, leader, child_ctx);
 		if (IS_ERR(child_ctr))
 			return PTR_ERR(child_ctr);
+
+		if (sub->aux_event == parent_event &&
+		    !perf_get_aux_event(child_ctr, leader))
+			return -EINVAL;
 	}
 	return 0;
 }