From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH 3/3] perf, tools: Add support for guest/host-only profiling Date: Tue, 10 May 2011 17:25:14 +0200 Message-ID: <1305041114.2914.105.camel@laptop> References: <1305038132-5080-1-git-send-email-joerg.roedel@amd.com> <1305038132-5080-4-git-send-email-joerg.roedel@amd.com> <1305039008.2914.98.camel@laptop> <20110510150821.GC30996@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Paul Mackerras , Ingo Molnar , Arnaldo Carvalho de Melo , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" To: "Roedel, Joerg" Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:53111 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932833Ab1EJPWP (ORCPT ); Tue, 10 May 2011 11:22:15 -0400 Received: from canuck.infradead.org ([2001:4978:20e::1]) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1QJolK-00089U-QA for kvm@vger.kernel.org; Tue, 10 May 2011 15:22:15 +0000 Received: from j77219.upc-j.chello.nl ([24.132.77.219] helo=dyad.programming.kicks-ass.net) by canuck.infradead.org with esmtpsa (Exim 4.72 #1 (Red Hat Linux)) id 1QJolJ-0002Gz-4K for kvm@vger.kernel.org; Tue, 10 May 2011 15:22:13 +0000 In-Reply-To: <20110510150821.GC30996@amd.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, 2011-05-10 at 17:08 +0200, Roedel, Joerg wrote: > On Tue, May 10, 2011 at 10:50:08AM -0400, Peter Zijlstra wrote: > > On Tue, 2011-05-10 at 16:35 +0200, Joerg Roedel wrote: > > > @@ -740,6 +740,12 @@ parse_event_modifier(const char **strp, struct perf_event_attr *attr) > > > if (!exclude) > > > exclude = eu = ek = eh = 1; > > > eh = 0; > > > + } else if (*str == 'G') { > > > + eg = 0; > > > + ehst = 1; > > > + } else if (*str == 'H') { > > > + eg = 1; > > > + ehst = 0; > > > > This doesn't match the existing exclude logic, also eH and eG come to > > mind. > > OK, eH and eG seems like a better choice. Regarding the logic I > explictly decided to do it this way. The reason is that guest/host > counting is orthogonal to user/kernel/hv counting. You can decide to > only count guest-kernel for example. And if a user just specifies > -e cycles:G this would automatically exlucde user and kernel counting. > This didn't make sense to me so I decided to keep the logic seperate for > guest/host exclusions. OK, so the changelog lacked that bit of information ;-) How about you do something like: + } else if (*str == 'G') { + if (!excl_GH) + excl_GH = eH = eG = 1; + eG = 0; + } else if (*str == 'H') { + if (!excl_GH) + excl_GH = eH = eG = 1; + eH = 0; Which mirrors the existing logic but keeps it orthogonal? Hmm,. does this nicely integrate with exclude_hv? that seems to want to be grouped with G/H.