[PATCH 1/2] perf: Reset detached siblings' group_flags

From: Namhyung Kim
Date: Wed Mar 06 2013 - 23:20:21 EST


From: Namhyung Kim <namhyung.kim@xxxxxxx>

Currently if a group_leader event is deleted, the sibling events are
upgraded to singleton events of a same group list. At this time, the
siblings inherit the leader's group_flags.

However, if the group has mixed hw/sw events the leader's group_flag
does not contain PERF_GROUP_SOFTWARE so sibling sw events will miss
the flag also. Fix it.

Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
---
kernel/events/core.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 5c75791d7269..007dfe846d4d 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1107,8 +1107,9 @@ static void perf_group_detach(struct perf_event *event)
list_move_tail(&sibling->group_entry, list);
sibling->group_leader = sibling;

- /* Inherit group flags from the previous leader */
- sibling->group_flags = event->group_flags;
+ /* Reset group flags for each siblings */
+ sibling->group_flags = is_software_event(sibling) ?
+ PERF_GROUP_SOFTWARE : 0;
}

out:
--
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/