From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: KVM PMU virtualization Date: Mon, 1 Mar 2010 09:58:38 +0100 Message-ID: <20100301085838.GD19879@8bytes.org> References: <4B87987A.2020302@redhat.com> <20100226104437.GB7463@elte.hu> <4B87AF44.9090702@redhat.com> <20100226114217.GI7463@elte.hu> <4B87C354.9020209@redhat.com> <20100226130656.GA2518@elte.hu> <4B87CCF5.6000209@redhat.com> <20100226134400.GB23422@elte.hu> <20100228161142.GA19879@8bytes.org> <20100301083904.GE19395@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , Jes Sorensen , KVM General , Peter Zijlstra , Zachary Amsden , Gleb Natapov , ming.m.lin@intel.com, "Zhang, Yanmin" , Peter Zijlstra , Thomas Gleixner , "H. Peter Anvin" , Arjan van de Ven , Fr??d??ric Weisbecker , Arnaldo Carvalho de Melo To: Ingo Molnar Return-path: Received: from 8bytes.org ([88.198.83.132]:59883 "EHLO 8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750804Ab0CAI6j (ORCPT ); Mon, 1 Mar 2010 03:58:39 -0500 Content-Disposition: inline In-Reply-To: <20100301083904.GE19395@elte.hu> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Mar 01, 2010 at 09:39:04AM +0100, Ingo Molnar wrote: > > What do you mean by software events? > > Things like: > > aldebaran:~> perf stat -a sleep 1 > > Performance counter stats for 'sleep 1': > > 15995.719133 task-clock-msecs # 15.981 CPUs > 5787 context-switches # 0.000 M/sec > 210 CPU-migrations # 0.000 M/sec > 193909 page-faults # 0.012 M/sec > 28704833507 cycles # 1794.532 M/sec (scaled from 78.69%) > 14387445668 instructions # 0.501 IPC (scaled from 90.71%) > 736644616 branches # 46.053 M/sec (scaled from 90.52%) > 695884659 branch-misses # 94.467 % (scaled from 90.70%) > 727070678 cache-references # 45.454 M/sec (scaled from 88.11%) > 1305560420 cache-misses # 81.619 M/sec (scaled from 52.00%) > > 1.000942399 seconds time elapsed > > These lines: > > 15995.719133 task-clock-msecs # 15.981 CPUs > 5787 context-switches # 0.000 M/sec > 210 CPU-migrations # 0.000 M/sec > 193909 page-faults # 0.012 M/sec > > Are software events of the host - a subset of which could be transparently > exposed to the guest. Same for tracepoints, probes, etc. Those are not exposed > by the hardware PMU. So by doing a 'soft' PMU (or even better: a paravirt > channel to perf events) we gain a lot more than just raw PMU functionality. > > 'performance events' are about a lot more than just the PMU, it's a coherent > system health / system events / structured logging framework. Yeah I know. But these event should be available in the guest already, no? They don't need any kind of hardware support from the pmu. A paravirt perf channel from the guest to the host would be definitly a win. It would be a powerful tool for kvm/linux-guest analysis (e.g. trace host-kvm and guest-events together on the host) Joerg