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

From: Namhyung Kim
Date: Mon Mar 11 2013 - 07:51:38 EST


While looking at the code again, I found that the detached siblings
should call perf_event__header_size() for themselves in the loop since
after moving them to the list the previous leader will have empty
sibling_list. Something like below is needed IMHO:


diff --git a/kernel/events/core.c b/kernel/events/core.c
index dc96fee942a6..53ac21cc4012 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1100,6 +1100,13 @@ static void perf_group_detach(struct perf_event *event)

/* Inherit group flags from the previous leader */
sibling->group_flags = event->group_flags;
+
+ /*
+ * The leader will forget about siblings from now on.
+ * So below loop to update header size of each sibling won't
+ * work for this case. Do it directly.
+ */
+ perf_event__header_size(sibling);
}

out:
--
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/