Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3be8e2a0 authored by Alexander Yarygin's avatar Alexander Yarygin Committed by Arnaldo Carvalho de Melo
Browse files

perf kvm: Add stat support on s390



On s390, the vmexit event has a tree-like structure: between
exit_event_begin and exit_event_end several other events may happen and
with each of them refining the previous ones.

This patch adds a decoder for such events to the generic code and also
the files <asm/kvm_perf.h> and kvm-stat.c for s390.

Commands 'perf kvm stat record', 'report' and 'live' are supported.

Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarAlexander Yarygin <yarygin@linux.vnet.ibm.com>
Acked-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1404397747-20939-5-git-send-email-yarygin@linux.vnet.ibm.com


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 54c801ff
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ header-y += ioctls.h
header-y += ipcbuf.h
header-y += kvm.h
header-y += kvm_para.h
header-y += kvm_perf.h
header-y += kvm_virtio.h
header-y += mman.h
header-y += monwriter.h
+25 −0
Original line number Diff line number Diff line
/*
 * Definitions for perf-kvm on s390
 *
 * Copyright 2014 IBM Corp.
 * Author(s): Alexander Yarygin <yarygin@linux.vnet.ibm.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License (version 2 only)
 * as published by the Free Software Foundation.
 */

#ifndef __LINUX_KVM_PERF_S390_H
#define __LINUX_KVM_PERF_S390_H

#include <asm/sie.h>

#define DECODE_STR_LEN 40

#define VCPU_ID "id"

#define KVM_ENTRY_TRACE "kvm:kvm_s390_sie_enter"
#define KVM_EXIT_TRACE "kvm:kvm_s390_sie_exit"
#define KVM_EXIT_REASON "icptcode"

#endif
+9 −7
Original line number Diff line number Diff line
@@ -51,9 +51,9 @@ There are a couple of variants of perf kvm:
  'perf kvm stat <command>' to run a command and gather performance counter
  statistics.
  Especially, perf 'kvm stat record/report' generates a statistical analysis
  of KVM events. Currently, vmexit, mmio and ioport events are supported.
  'perf kvm stat record <command>' records kvm events and the events between
  start and end <command>.
  of KVM events. Currently, vmexit, mmio (x86 only) and ioport (x86 only)
  events are supported. 'perf kvm stat record <command>' records kvm events
  and the events between start and end <command>.
  And this command produces a file which contains tracing results of kvm
  events.

@@ -103,8 +103,8 @@ STAT REPORT OPTIONS
       analyze events which occures on this vcpu. (default: all vcpus)

--event=<value>::
       event to be analyzed. Possible values: vmexit, mmio, ioport.
       (default: vmexit)
       event to be analyzed. Possible values: vmexit, mmio (x86 only),
       ioport (x86 only). (default: vmexit)
-k::
--key=<value>::
       Sorting key. Possible values: sample (default, sort by samples
@@ -138,7 +138,8 @@ STAT LIVE OPTIONS


--event=<value>::
       event to be analyzed. Possible values: vmexit, mmio, ioport.
       event to be analyzed. Possible values: vmexit,
       mmio (x86 only), ioport (x86 only).
       (default: vmexit)

-k::
@@ -147,7 +148,8 @@ STAT LIVE OPTIONS
       number), time (sort by average time).

--duration=<value>::
       Show events other than HLT that take longer than duration usecs.
       Show events other than HLT (x86 only) or Wait state (s390 only)
       that take longer than duration usecs.

SEE ALSO
--------
+2 −0
Original line number Diff line number Diff line
@@ -38,3 +38,5 @@ arch/x86/include/uapi/asm/svm.h
arch/x86/include/uapi/asm/vmx.h
arch/x86/include/uapi/asm/kvm.h
arch/x86/include/uapi/asm/kvm_perf.h
arch/s390/include/uapi/asm/sie.h
arch/s390/include/uapi/asm/kvm_perf.h
+2 −0
Original line number Diff line number Diff line
@@ -3,3 +3,5 @@ PERF_HAVE_DWARF_REGS := 1
LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
endif
LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/header.o
HAVE_KVM_STAT_SUPPORT := 1
LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/kvm-stat.o
Loading