public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Stephane Eranian <eranian@google.com>,
	Namhyung Kim <namhyung.kim@lge.com>, Jiri Olsa <jolsa@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH 1/2] perf: Reset detached siblings' group_flags
Date: Mon, 11 Mar 2013 20:51:31 +0900	[thread overview]
Message-ID: <87620yqhmk.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <1362995984.14933.0.camel@laptop> (Peter Zijlstra's message of "Mon, 11 Mar 2013 10:59:44 +0100")

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:

      parent reply	other threads:[~2013-03-11 11:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87620yqhmk.fsf@sejong.aot.lge.com \
    --to=namhyung@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox