From: Nico Boehr <nrb@linux.ibm.com>
To: borntraeger@linux.ibm.com, frankja@linux.ibm.com,
imbrenda@linux.ibm.com, david@redhat.com
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: [PATCH v1 3/3] KVM: s390: add tracepoint in gmap notifier
Date: Tue, 9 May 2023 13:12:02 +0200 [thread overview]
Message-ID: <20230509111202.333714-4-nrb@linux.ibm.com> (raw)
In-Reply-To: <20230509111202.333714-1-nrb@linux.ibm.com>
The gmap notifier is called whenever something in the gmap structures
changes. To diagnose performance issues, it can be useful to see what
causes certain changes in the gmap.
Hence, add a tracepoint in the gmap notifier.
Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
---
arch/s390/kvm/kvm-s390.c | 2 ++
arch/s390/kvm/trace-s390.h | 23 +++++++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index b012645a5a7c..f66953bdabe4 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -3981,6 +3981,8 @@ static void kvm_gmap_notifier(struct gmap *gmap, unsigned long start,
unsigned long prefix;
unsigned long i;
+ trace_kvm_s390_gmap_notifier(start, end, gmap_is_shadow(gmap));
+
if (gmap_is_shadow(gmap))
return;
if (start >= 1UL << 31)
diff --git a/arch/s390/kvm/trace-s390.h b/arch/s390/kvm/trace-s390.h
index 6f0209d45164..5dabd0b64d6e 100644
--- a/arch/s390/kvm/trace-s390.h
+++ b/arch/s390/kvm/trace-s390.h
@@ -333,6 +333,29 @@ TRACE_EVENT(kvm_s390_airq_suppressed,
__entry->id, __entry->isc)
);
+/*
+ * Trace point for gmap notifier calls.
+ */
+TRACE_EVENT(kvm_s390_gmap_notifier,
+ TP_PROTO(unsigned long start, unsigned long end, unsigned int shadow),
+ TP_ARGS(start, end, shadow),
+
+ TP_STRUCT__entry(
+ __field(unsigned long, start)
+ __field(unsigned long, end)
+ __field(unsigned int, shadow)
+ ),
+
+ TP_fast_assign(
+ __entry->start = start;
+ __entry->end = end;
+ __entry->shadow = shadow;
+ ),
+
+ TP_printk("gmap notified (start:0x%lx end:0x%lx shadow:%d)",
+ __entry->start, __entry->end, __entry->shadow)
+ );
+
#endif /* _TRACE_KVMS390_H */
--
2.39.1
next prev parent reply other threads:[~2023-05-09 11:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-09 11:11 [PATCH v1 0/3] KVM: s390: add counters for vsie performance Nico Boehr
2023-05-09 11:12 ` [PATCH v1 1/3] KVM: s390: fix space before open parenthesis Nico Boehr
2023-05-09 11:19 ` Claudio Imbrenda
2023-05-09 11:12 ` [PATCH v1 2/3] KVM: s390: add stat counter for shadow gmap events Nico Boehr
2023-05-09 11:43 ` Claudio Imbrenda
2023-05-09 14:53 ` Nico Boehr
2023-05-09 15:17 ` Claudio Imbrenda
2023-05-09 11:59 ` Janosch Frank
2023-05-09 14:54 ` Nico Boehr
2023-05-09 15:14 ` Claudio Imbrenda
2023-05-10 6:45 ` Janosch Frank
2023-05-09 11:12 ` Nico Boehr [this message]
2023-05-09 11:48 ` [PATCH v1 3/3] KVM: s390: add tracepoint in gmap notifier Claudio Imbrenda
2023-05-09 14:54 ` Nico Boehr
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=20230509111202.333714-4-nrb@linux.ibm.com \
--to=nrb@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=david@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox