public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] perf: Reset detached siblings' group_flags
@ 2013-03-07  4:19 Namhyung Kim
  2013-03-07  4:19 ` [PATCH 2/2] perf: Fix mixed hw/sw event group initialization Namhyung Kim
  2013-03-11  9:59 ` [PATCH 1/2] perf: Reset detached siblings' group_flags Peter Zijlstra
  0 siblings, 2 replies; 8+ messages in thread
From: Namhyung Kim @ 2013-03-07  4:19 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, LKML,
	Stephane Eranian, Namhyung Kim, Jiri Olsa, Frederic Weisbecker

From: Namhyung Kim <namhyung.kim@lge.com>

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@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-03-11 13:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-07  4:19 [PATCH 1/2] perf: Reset detached siblings' group_flags Namhyung Kim
2013-03-07  4:19 ` [PATCH 2/2] perf: Fix mixed hw/sw event group initialization Namhyung Kim
2013-03-11 10:01   ` Peter Zijlstra
2013-03-11 11:20     ` Namhyung Kim
2013-03-11 13:10   ` [PATCH] perf tests: Add automated test for mixed type event groups Jiri Olsa
2013-03-11  9:59 ` [PATCH 1/2] perf: Reset detached siblings' group_flags Peter Zijlstra
2013-03-11 11:34   ` Namhyung Kim
2013-03-11 11:51   ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox