From: Ingo Molnar Subject: Re: [PATCH v1 5/5] KVM: Expose a version 1 architectural PMU to guests Date: Wed, 18 May 2011 13:07:59 +0200 Message-ID: <20110518110759.GB16556@elte.hu> References: <1305129333-7456-1-git-send-email-avi@redhat.com> <1305129333-7456-6-git-send-email-avi@redhat.com> <20110517194117.GA26184@elte.hu> <4DD38B57.2070904@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Peter Zijlstra , Arnaldo Carvalho de Melo To: Avi Kivity Return-path: Received: from mx3.mail.elte.hu ([157.181.1.138]:49112 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932125Ab1ERLIM (ORCPT ); Wed, 18 May 2011 07:08:12 -0400 Content-Disposition: inline In-Reply-To: <4DD38B57.2070904@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: * Avi Kivity wrote: > >> - some combinations of INV and CMASK are not supported > > > > Could you please describe this better, where does this limit come from? If > > perf then this needs fixing. > > perf_event_attr does not support generic INV and CMASK at all. [...] It does through raw events - which are indeed model specific. > [...] I imagine you can get them through the model-specific hardware > configuration, but that means we have to encode model specific information > into kvm host code, which is (a) hard (b) counter to the spirit of perf. > > (INV and CMASK allow you to increment the counter only when > N or < > N events occur simultaneously, for example count when 2 or more > instructions are retired in a single clock). Peter, what do you think about adding a inv and cmask attribute that is applied to generic events automatically? I *think* it should work just out of box: we recognize the fixed-purpose counter events based on their raw value, so if one comes in with inv and cmask set it will just be scheduled on a generic hw counter. > > - we could do things like propagate guest side traces over to the host > > We support that already via 'perf kvm', no? [...] Not without usability issues, if you remember that flamewa^W thread! :-) > [...] This is more about the guest profiling itself without access to the > host (which is the more common scenario, IMO). Correct - so there would be interactions with virtio-perf. I think the two will just have to be made to mix well, that's all. > We're still missing tunnelling guest ftrace to the host, but a patch was > recently posted to do that. If you tunnel guest perf events then ftrace events are included automatically. That's the primary/unified event transport model we are working towards. Thanks, Ingo