Commit 3e6c5568 authored by Janosch Frank's avatar Janosch Frank Committed by Christian Borntraeger

KVM: s390: protvirt: Add UV debug trace

Let's have some debug traces which stay around for longer than the
guest.
Signed-off-by: default avatarJanosch Frank <frankja@linux.ibm.com>
Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
[borntraeger@de.ibm.com: patch merging, splitting, fixing]
Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
parent f6547066
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* hosting IBM Z kernel virtual machines (s390x) * hosting IBM Z kernel virtual machines (s390x)
* *
* Copyright IBM Corp. 2008, 2018 * Copyright IBM Corp. 2008, 2020
* *
* Author(s): Carsten Otte <cotte@de.ibm.com> * Author(s): Carsten Otte <cotte@de.ibm.com>
* Christian Borntraeger <borntraeger@de.ibm.com> * Christian Borntraeger <borntraeger@de.ibm.com>
...@@ -220,6 +220,7 @@ static struct kvm_s390_vm_cpu_subfunc kvm_s390_available_subfunc; ...@@ -220,6 +220,7 @@ static struct kvm_s390_vm_cpu_subfunc kvm_s390_available_subfunc;
static struct gmap_notifier gmap_notifier; static struct gmap_notifier gmap_notifier;
static struct gmap_notifier vsie_gmap_notifier; static struct gmap_notifier vsie_gmap_notifier;
debug_info_t *kvm_s390_dbf; debug_info_t *kvm_s390_dbf;
debug_info_t *kvm_s390_dbf_uv;
/* Section: not file related */ /* Section: not file related */
int kvm_arch_hardware_enable(void) int kvm_arch_hardware_enable(void)
...@@ -460,7 +461,12 @@ int kvm_arch_init(void *opaque) ...@@ -460,7 +461,12 @@ int kvm_arch_init(void *opaque)
if (!kvm_s390_dbf) if (!kvm_s390_dbf)
return -ENOMEM; return -ENOMEM;
if (debug_register_view(kvm_s390_dbf, &debug_sprintf_view)) kvm_s390_dbf_uv = debug_register("kvm-uv", 32, 1, 7 * sizeof(long));
if (!kvm_s390_dbf_uv)
goto out;
if (debug_register_view(kvm_s390_dbf, &debug_sprintf_view) ||
debug_register_view(kvm_s390_dbf_uv, &debug_sprintf_view))
goto out; goto out;
kvm_s390_cpu_feat_init(); kvm_s390_cpu_feat_init();
...@@ -487,6 +493,7 @@ void kvm_arch_exit(void) ...@@ -487,6 +493,7 @@ void kvm_arch_exit(void)
{ {
kvm_s390_gib_destroy(); kvm_s390_gib_destroy();
debug_unregister(kvm_s390_dbf); debug_unregister(kvm_s390_dbf);
debug_unregister(kvm_s390_dbf_uv);
} }
/* Section: device related */ /* Section: device related */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* definition for kvm on s390 * definition for kvm on s390
* *
* Copyright IBM Corp. 2008, 2009 * Copyright IBM Corp. 2008, 2020
* *
* Author(s): Carsten Otte <cotte@de.ibm.com> * Author(s): Carsten Otte <cotte@de.ibm.com>
* Christian Borntraeger <borntraeger@de.ibm.com> * Christian Borntraeger <borntraeger@de.ibm.com>
...@@ -25,6 +25,17 @@ ...@@ -25,6 +25,17 @@
#define IS_ITDB_VALID(vcpu) ((*(char *)vcpu->arch.sie_block->itdba == TDB_FORMAT1)) #define IS_ITDB_VALID(vcpu) ((*(char *)vcpu->arch.sie_block->itdba == TDB_FORMAT1))
extern debug_info_t *kvm_s390_dbf; extern debug_info_t *kvm_s390_dbf;
extern debug_info_t *kvm_s390_dbf_uv;
#define KVM_UV_EVENT(d_kvm, d_loglevel, d_string, d_args...)\
do { \
debug_sprintf_event((d_kvm)->arch.dbf, d_loglevel, d_string "\n", \
d_args); \
debug_sprintf_event(kvm_s390_dbf_uv, d_loglevel, \
"%d: " d_string "\n", (d_kvm)->userspace_pid, \
d_args); \
} while (0)
#define KVM_EVENT(d_loglevel, d_string, d_args...)\ #define KVM_EVENT(d_loglevel, d_string, d_args...)\
do { \ do { \
debug_sprintf_event(kvm_s390_dbf, d_loglevel, d_string "\n", \ debug_sprintf_event(kvm_s390_dbf, d_loglevel, d_string "\n", \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment