qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 6/6] kvm_stat: Add powerpc support


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 6/6] kvm_stat: Add powerpc support
Date: Fri, 31 Oct 2014 16:36:46 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

Thanks, applied the series at last.

Paolo

On 17/06/2014 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 <address@hidden>
> ---
>  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
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]