Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753970Ab3CKLeY (ORCPT ); Mon, 11 Mar 2013 07:34:24 -0400 Received: from LGEMRELSE1Q.lge.com ([156.147.1.111]:61727 "EHLO LGEMRELSE1Q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753735Ab3CKLeX (ORCPT ); Mon, 11 Mar 2013 07:34:23 -0400 X-AuditID: 9c93016f-b7b46ae000000e4b-73-513dc13d121b From: Namhyung Kim To: Peter Zijlstra Cc: Arnaldo Carvalho de Melo , Paul Mackerras , Ingo Molnar , LKML , Stephane Eranian , Namhyung Kim , Jiri Olsa , Frederic Weisbecker Subject: Re: [PATCH 1/2] perf: Reset detached siblings' group_flags References: <1362629990-10053-1-git-send-email-namhyung@kernel.org> <1362995984.14933.0.camel@laptop> Date: Mon, 11 Mar 2013 20:34:21 +0900 In-Reply-To: <1362995984.14933.0.camel@laptop> (Peter Zijlstra's message of "Mon, 11 Mar 2013 10:59:44 +0100") Message-ID: <87a9qaqif6.fsf@sejong.aot.lge.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2049 Lines: 52 On Mon, 11 Mar 2013 10:59:44 +0100, Peter Zijlstra wrote: > On Thu, 2013-03-07 at 13:19 +0900, Namhyung Kim wrote: >> From: Namhyung Kim >> >> 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 >> Cc: Frederic Weisbecker >> Signed-off-by: Namhyung Kim >> --- >> 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; >> } > > > In such a case, does the event not continue to live on the hw pmu? That > is, after this patch we'll have a software event on the hardware pmu > list with PERF_GROUP_SOFTWARE set, right? Seems odd. Right. Just curious that dropping this one and applying just patch 2 will set the PERF_GROUP_MIXED for them and it'll fix the mixed group problem without migrating those events. What do you think about this approach? Thanks, Namhyung -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/