All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Michael Ellerman <mpe@ellerman.id.au>, qemu-devel@nongnu.org
Cc: kvm@vger.kernel.org, alfs@linux.vnet.ibm.com,
	jfrei@linux.vnet.ibm.com, jan.kiszka@siemens.com,
	pbonzini@redhat.com, aik@ozlabs.ru
Subject: Re: [PATCH 6/6] kvm_stat: Add powerpc support
Date: Tue, 17 Jun 2014 10:27:56 +0200	[thread overview]
Message-ID: <539FFC0C.6060105@suse.de> (raw)
In-Reply-To: <1402991675-24905-6-git-send-email-mpe@ellerman.id.au>


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 <mpe@ellerman.id.au>

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


WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de>
To: Michael Ellerman <mpe@ellerman.id.au>, 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
Subject: Re: [Qemu-devel] [PATCH 6/6] kvm_stat: Add powerpc support
Date: Tue, 17 Jun 2014 10:27:56 +0200	[thread overview]
Message-ID: <539FFC0C.6060105@suse.de> (raw)
In-Reply-To: <1402991675-24905-6-git-send-email-mpe@ellerman.id.au>


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 <mpe@ellerman.id.au>

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

  reply	other threads:[~2014-06-17  8:28 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17  7:54 [PATCH 1/6] kvm_stat: Only consider online cpus Michael Ellerman
2014-06-17  7:54 ` [Qemu-devel] " Michael Ellerman
2014-06-17  7:54 ` [PATCH 2/6] kvm_stat: Fix the non-x86 exit reasons Michael Ellerman
2014-06-17  7:54   ` [Qemu-devel] " Michael Ellerman
2014-10-31 15:49   ` Paolo Bonzini
2014-10-31 15:49     ` [Qemu-devel] " Paolo Bonzini
2014-06-17  7:54 ` [PATCH 3/6] kvm_stat: Rework platform detection Michael Ellerman
2014-06-17  7:54   ` [Qemu-devel] " Michael Ellerman
2014-06-17  7:54 ` [PATCH 4/6] kvm_stat: Fix tracepoint filter definition for s390 Michael Ellerman
2014-06-17  7:54   ` [Qemu-devel] " Michael Ellerman
2014-06-17  7:54 ` [PATCH 5/6] kvm_stat: Abstract ioctl numbers Michael Ellerman
2014-06-17  7:54   ` [Qemu-devel] " Michael Ellerman
2014-06-17  7:54 ` [PATCH 6/6] kvm_stat: Add powerpc support Michael Ellerman
2014-06-17  7:54   ` [Qemu-devel] " Michael Ellerman
2014-06-17  8:27   ` Alexander Graf [this message]
2014-06-17  8:27     ` Alexander Graf
2014-06-18  0:50     ` Michael Ellerman
2014-06-18  0:50       ` [Qemu-devel] " Michael Ellerman
2014-06-18  0:59       ` Alexander Graf
2014-06-18  0:59         ` [Qemu-devel] " Alexander Graf
2014-06-18  1:37         ` Michael Ellerman
2014-06-18  1:37           ` [Qemu-devel] " Michael Ellerman
2014-06-18  1:54           ` Alexander Graf
2014-06-18  1:54             ` [Qemu-devel] " Alexander Graf
2014-10-31 15:36   ` Paolo Bonzini
2014-10-31 15:36     ` [Qemu-devel] " Paolo Bonzini
2014-11-03  0:40     ` Michael Ellerman
2014-11-03  0:40       ` [Qemu-devel] " Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=539FFC0C.6060105@suse.de \
    --to=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=alfs@linux.vnet.ibm.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.