From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwokT-0006qx-Rb for qemu-devel@nongnu.org; Tue, 17 Jun 2014 04:28:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwokM-0005VX-UO for qemu-devel@nongnu.org; Tue, 17 Jun 2014 04:28:09 -0400 Received: from cantor2.suse.de ([195.135.220.15]:53539 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwokM-0005Um-J5 for qemu-devel@nongnu.org; Tue, 17 Jun 2014 04:28:02 -0400 Message-ID: <539FFC0C.6060105@suse.de> Date: Tue, 17 Jun 2014 10:27:56 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1402991675-24905-1-git-send-email-mpe@ellerman.id.au> <1402991675-24905-6-git-send-email-mpe@ellerman.id.au> In-Reply-To: <1402991675-24905-6-git-send-email-mpe@ellerman.id.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 6/6] kvm_stat: Add powerpc support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Ellerman , qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, aik@ozlabs.ru, jan.kiszka@siemens.com, jfrei@linux.vnet.ibm.com, alfs@linux.vnet.ibm.com, pbonzini@redhat.com On 17.06.14 09:54, Michael Ellerman wrote: > Add support for powerpc platforms. We use uname -m, which allows us to > detect ppc, ppc64 and ppc64le/el. > > Signed-off-by: Michael Ellerman Could you please add support for PR KVM tracepoints along the way? There we do know the exit reason for every single guest <-> host transition. I would like to move to a similar model with HV in the future, so we can hopefully just reuse this by then. Alex > --- > scripts/kvm/kvm_stat | 18 ++++++++++++++++-- > 1 file changed, 16 insertions(+), 2 deletions(-) > > diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat > index 2e0f5ed..db867fe 100755 > --- a/scripts/kvm/kvm_stat > +++ b/scripts/kvm/kvm_stat > @@ -12,7 +12,7 @@ > # the COPYING file in the top-level directory. > > import curses > -import sys, os, time, optparse > +import sys, os, time, optparse, ctypes > > class DebugfsProvider(object): > def __init__(self): > @@ -199,7 +199,21 @@ def s390_init(): > 'sc_perf_evt_open' : 331, > }) > > +def ppc_init(): > + globals().update({ > + 'sc_perf_evt_open' : 319, > + 'ioctl_numbers' : { > + 'SET_FILTER' : 0x80002406 | (ctypes.sizeof(ctypes.c_char_p) << 16), > + 'ENABLE' : 0x20002400, > + 'DISABLE' : 0x20002401, > + } > + }) > + > def detect_platform(): > + if os.uname()[4].startswith('ppc'): > + ppc_init() > + return > + > for line in file('/proc/cpuinfo').readlines(): > if line.startswith('flags'): > for flag in line.split(): > @@ -220,7 +234,7 @@ def invert(d): > for f in filters: > filters[f] = (filters[f][0], invert(filters[f][1])) > > -import ctypes, struct, array > +import struct, array > > libc = ctypes.CDLL('libc.so.6') > syscall = libc.syscall