[PATCH v12 20/24] virt: geniezone: Add tracing support for hyp call and vcpu exit_reason

Steven Rostedt rostedt at goodmis.org
Wed Aug 7 13:02:41 PDT 2024


On Tue, 30 Jul 2024 16:24:32 +0800
Liju-clr Chen <liju-clr.chen at mediatek.com> wrote:

> From: Liju Chen <liju-clr.chen at mediatek.com>
> 
> Add tracepoints for hypervisor calls and VCPU exit reasons in GenieZone
> driver. It aids performance debugging by providing more information
> about hypervisor operations and VCPU behavior.
> 
> Command Usage:
> echo geniezone:* >> /sys/kernel/tracing/set_event
> echo 1 > /sys/kernel/tracing/tracing_on
> echo 0 > /sys/kernel/tracing/tracing_on
> cat /sys/kernel/tracing/trace
> 
> For example:
> crosvm_vcpu0-4874    [007] .....    94.757349: mtk_hypcall_enter: id=0xfb001005
> crosvm_vcpu0-4874    [007] .....    94.760902: mtk_hypcall_leave: id=0xfb001005 invalid=0
> crosvm_vcpu0-4874    [007] .....    94.760902: mtk_vcpu_exit: vcpu exit_reason=IRQ(0x92920003)
> 
> This example tracks a hypervisor function call by an ID (`0xbb001005`)
> from initiation to termination, which is supported (invalid=0). A vCPU
> exit is triggered by an Interrupt Request (IRQ) (exit reason: 0x92920003).
> 
> /* VM exit reason */
> enum {
> 	GZVM_EXIT_UNKNOWN = 0x92920000,
> 	GZVM_EXIT_MMIO = 0x92920001,
> 	GZVM_EXIT_HYPERCALL = 0x92920002,
> 	GZVM_EXIT_IRQ = 0x92920003,
> 	GZVM_EXIT_EXCEPTION = 0x92920004,
> 	GZVM_EXIT_DEBUG = 0x92920005,
> 	GZVM_EXIT_FAIL_ENTRY = 0x92920006,
> 	GZVM_EXIT_INTERNAL_ERROR = 0x92920007,
> 	GZVM_EXIT_SYSTEM_EVENT = 0x92920008,
> 	GZVM_EXIT_SHUTDOWN = 0x92920009,
> 	GZVM_EXIT_GZ = 0x9292000a,
> };
> 
> Signed-off-by: Yi-De Wu <yi-de.wu at mediatek.com>
> Signed-off-by: Liju Chen <liju-clr.chen at mediatek.com>

From a tracing POV, I don't see any issues with this patch.

Reviewed-by: Steven Rostedt (Google) <rostedt at goodmis.org>

-- Steve


> ---
>  arch/arm64/geniezone/vm.c          |  4 ++
>  drivers/virt/geniezone/gzvm_vcpu.c |  3 ++
>  include/trace/events/geniezone.h   | 84 ++++++++++++++++++++++++++++++
>  3 files changed, 91 insertions(+)
>  create mode 100644 include/trace/events/geniezone.h




More information about the Linux-mediatek mailing list