From: Ciunas Bennett <ciunas@linux.ibm.com>
To: linux-s390@vger.kernel.org
Cc: borntraeger@linux.ibm.com, frankja@linux.ibm.com,
imbrenda@linux.ibm.com, david@kernel.org, hca@linux.ibm.com,
gor@linux.ibm.com, agordeev@linux.ibm.com, svens@linux.ibm.com,
Ciunas Bennett <ciunas@linux.ibm.com>
Subject: [PATCH v2 2/2] s390/kvm: Add tracepoint for DIAG 9c directed yield operations
Date: Thu, 25 Jun 2026 15:16:15 +0200 [thread overview]
Message-ID: <20260625131615.262367-3-ciunas@linux.ibm.com> (raw)
In-Reply-To: <20260625131615.262367-1-ciunas@linux.ibm.com>
Add a new tracepoint kvm_s390_diag_9c to provide detailed observability
for directed yield operations. The tracepoint captures:
- Source and target VCPU IDs
- Current and target physical CPU numbers
- Operation result (done, ignored, yield forwarded)
This enables better analysis of VCPU scheduling behaviour and helps
diagnose performance issues related to directed yields in virtualised
s390 environments.
Signed-off-by: Ciunas Bennett <ciunas@linux.ibm.com>
---
arch/s390/kvm/diag.c | 1 +
arch/s390/kvm/trace.h | 30 ++++++++++++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/arch/s390/kvm/diag.c b/arch/s390/kvm/diag.c
index 85c84421b510..031ab6e5d6c4 100644
--- a/arch/s390/kvm/diag.c
+++ b/arch/s390/kvm/diag.c
@@ -228,6 +228,7 @@ static int __diag_time_slice_end_directed(struct kvm_vcpu *vcpu)
out:
VCPU_EVENT(vcpu, 5, "diag time slice end directed to %d: %s", tid,
result);
+ trace_kvm_s390_diag_9c(vcpu, tid, tcpu_cpu, result);
return 0;
}
diff --git a/arch/s390/kvm/trace.h b/arch/s390/kvm/trace.h
index aa419eb6a0c8..2d6da21f590c 100644
--- a/arch/s390/kvm/trace.h
+++ b/arch/s390/kvm/trace.h
@@ -283,6 +283,36 @@ TRACE_EVENT(kvm_s390_handle_diag,
__print_symbolic(__entry->code, diagnose_codes))
);
+TRACE_EVENT(kvm_s390_diag_9c,
+ TP_PROTO(VCPU_PROTO_COMMON, int target_vcpu, int target_cpu,
+ const char *result),
+ TP_ARGS(VCPU_ARGS_COMMON, target_vcpu, target_cpu, result),
+
+ TP_STRUCT__entry(
+ VCPU_FIELD_COMMON
+ __field(int, target_vcpu)
+ __field(int, target_cpu)
+ __field(int, current_cpu)
+ __string(result, result)
+ ),
+
+ TP_fast_assign(
+ VCPU_ASSIGN_COMMON
+ __entry->target_vcpu = target_vcpu;
+ __entry->target_cpu = target_cpu;
+ __entry->current_cpu = smp_processor_id();
+ __assign_str(result);
+ ),
+
+ VCPU_TP_PRINTK(
+ "diag=9c vcpu=%d pcpu=%d target_vcpu=%d target_pcpu=%d result=%s",
+ __entry->id,
+ __entry->current_cpu,
+ __entry->target_vcpu,
+ __entry->target_cpu,
+ __get_str(result))
+ );
+
TRACE_EVENT(kvm_s390_handle_lctl,
TP_PROTO(VCPU_PROTO_COMMON, int g, int reg1, int reg3, u64 addr),
TP_ARGS(VCPU_ARGS_COMMON, g, reg1, reg3, addr),
--
2.54.0
next prev parent reply other threads:[~2026-06-25 13:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-25 13:16 [PATCH v2 0/2] Improve DIAG 9c observability Ciunas Bennett
2026-06-25 13:16 ` [PATCH v2 1/2] s390/kvm: Refactor __diag_time_slice_end_directed for single exit point Ciunas Bennett
2026-06-25 13:16 ` Ciunas Bennett [this message]
2026-07-23 15:28 ` [PATCH v2 2/2] s390/kvm: Add tracepoint for DIAG 9c directed yield operations Christian Borntraeger
2026-07-23 19:56 ` Ciunas Bennett
2026-06-25 13:52 ` [PATCH v2 0/2] Improve DIAG 9c observability Mete Durlu
2026-06-25 16:02 ` Claudio Imbrenda
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=20260625131615.262367-3-ciunas@linux.ibm.com \
--to=ciunas@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=david@kernel.org \
--cc=frankja@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=svens@linux.ibm.com \
/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.