All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@linux.ibm.com>
To: Ciunas Bennett <ciunas@linux.ibm.com>, linux-s390@vger.kernel.org
Cc: 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
Subject: Re: [PATCH v2 2/2] s390/kvm: Add tracepoint for DIAG 9c directed yield operations
Date: Thu, 23 Jul 2026 17:28:23 +0200	[thread overview]
Message-ID: <71e16596-591a-4991-b217-ecdcf284ea67@linux.ibm.com> (raw)
In-Reply-To: <20260625131615.262367-3-ciunas@linux.ibm.com>



Am 25.06.26 um 15:16 schrieb Ciunas Bennett:
> 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.

Nothing critical, just some ideas.

> 
> 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,
I think vcpu=%d re-prints __entry->id, which VCPU_TP_PRINTK() already emits as the line prefix; likewise current_cpu/pcpu=%d duplicates ftrace's built-in per-event CPU column.
Can you double check?

> +		       __entry->current_cpu,
> +		       __entry->target_vcpu,
> +		       __entry->target_cpu,
> +		       __get_str(result))

result is a dynamic __string of three fixed literals — an int plus __print_symbolic() (matching diagnose_codes style in the same file) would also allow splitting "ignored", which currently conflates four distinct causes despite the commit's diagnosability goal.
This is not trivial though, due to the VCPU_EVENT which also uses result. So maybe this is not that easy and feel free to ignore that.

> +	);
> +
>   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),


  reply	other threads:[~2026-07-23 15:28 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 ` [PATCH v2 2/2] s390/kvm: Add tracepoint for DIAG 9c directed yield operations Ciunas Bennett
2026-07-23 15:28   ` Christian Borntraeger [this message]
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=71e16596-591a-4991-b217-ecdcf284ea67@linux.ibm.com \
    --to=borntraeger@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=ciunas@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.