[PATCH 3/4] igvm: add trace point for igvm file loading and processing

Gerd Hoffmann posted 4 patches 2 months, 3 weeks ago
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>, Ani Sinha <anisinha@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
There is a newer version of this series
[PATCH 3/4] igvm: add trace point for igvm file loading and processing
Posted by Gerd Hoffmann 2 months, 3 weeks ago
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 backends/igvm.c       | 5 +++++
 backends/trace-events | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/backends/igvm.c b/backends/igvm.c
index 05d197fdfe85..a350c890cc95 100644
--- a/backends/igvm.c
+++ b/backends/igvm.c
@@ -18,6 +18,8 @@
 #include "system/address-spaces.h"
 #include "hw/core/cpu.h"
 
+#include "trace.h"
+
 #include <igvm/igvm.h>
 #include <igvm/igvm_defs.h>
 
@@ -884,6 +886,8 @@ IgvmHandle qigvm_file_init(char *filename, Error **errp)
         error_setg(errp, "Unable to parse IGVM file %s: %d", filename, igvm);
         return -1;
     }
+
+    trace_igvm_file_loaded(filename, igvm);
     return igvm;
 }
 
@@ -901,6 +905,7 @@ int qigvm_process_file(IgvmCfg *cfg, ConfidentialGuestSupport *cgs,
         return -1;
     }
     ctx.file = cfg->file;
+    trace_igvm_process_file(cfg->file, onlyVpContext);
 
     /*
      * The ConfidentialGuestSupport object is optional and allows a confidential
diff --git a/backends/trace-events b/backends/trace-events
index 45ac46dc2454..7a00e9bf6c16 100644
--- a/backends/trace-events
+++ b/backends/trace-events
@@ -26,3 +26,5 @@ iommufd_backend_invalidate_cache(int iommufd, uint32_t id, uint32_t data_type, u
 igvm_reset_enter(int type) "type=%u"
 igvm_reset_hold(int type) "type=%u"
 igvm_reset_exit(int type) "type=%u"
+igvm_file_loaded(const char *fn, int32_t handle) "fn=%s, handle=0x%x"
+igvm_process_file(int32_t handle, bool context_only) "handle=0x%x context-only=%d"
-- 
2.51.1
Re: [PATCH 3/4] igvm: add trace point for igvm file loading and processing
Posted by Stefano Garzarella 2 months, 2 weeks ago
On Tue, Nov 18, 2025 at 01:21:31PM +0100, Gerd Hoffmann wrote:
>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
>---
> backends/igvm.c       | 5 +++++
> backends/trace-events | 2 ++
> 2 files changed, 7 insertions(+)

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

>
>diff --git a/backends/igvm.c b/backends/igvm.c
>index 05d197fdfe85..a350c890cc95 100644
>--- a/backends/igvm.c
>+++ b/backends/igvm.c
>@@ -18,6 +18,8 @@
> #include "system/address-spaces.h"
> #include "hw/core/cpu.h"
>
>+#include "trace.h"
>+
> #include <igvm/igvm.h>
> #include <igvm/igvm_defs.h>
>
>@@ -884,6 +886,8 @@ IgvmHandle qigvm_file_init(char *filename, Error **errp)
>         error_setg(errp, "Unable to parse IGVM file %s: %d", filename, igvm);
>         return -1;
>     }
>+
>+    trace_igvm_file_loaded(filename, igvm);
>     return igvm;
> }
>
>@@ -901,6 +905,7 @@ int qigvm_process_file(IgvmCfg *cfg, ConfidentialGuestSupport *cgs,
>         return -1;
>     }
>     ctx.file = cfg->file;
>+    trace_igvm_process_file(cfg->file, onlyVpContext);
>
>     /*
>      * The ConfidentialGuestSupport object is optional and allows a confidential
>diff --git a/backends/trace-events b/backends/trace-events
>index 45ac46dc2454..7a00e9bf6c16 100644
>--- a/backends/trace-events
>+++ b/backends/trace-events
>@@ -26,3 +26,5 @@ iommufd_backend_invalidate_cache(int iommufd, uint32_t id, uint32_t data_type, u
> igvm_reset_enter(int type) "type=%u"
> igvm_reset_hold(int type) "type=%u"
> igvm_reset_exit(int type) "type=%u"
>+igvm_file_loaded(const char *fn, int32_t handle) "fn=%s, handle=0x%x"
>+igvm_process_file(int32_t handle, bool context_only) "handle=0x%x context-only=%d"
>-- 
>2.51.1
>
Re: [PATCH 3/4] igvm: add trace point for igvm file loading and processing
Posted by Ani Sinha 2 months, 2 weeks ago

> On 18 Nov 2025, at 5:51 PM, Gerd Hoffmann <kraxel@redhat.com> wrote:
> 
Please add some description to the patch …

> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Modulo above ..

Reviewed-by: Ani Sinha <anisinha@redhat.com>


> ---
> backends/igvm.c       | 5 +++++
> backends/trace-events | 2 ++
> 2 files changed, 7 insertions(+)
> 
> diff --git a/backends/igvm.c b/backends/igvm.c
> index 05d197fdfe85..a350c890cc95 100644
> --- a/backends/igvm.c
> +++ b/backends/igvm.c
> @@ -18,6 +18,8 @@
> #include "system/address-spaces.h"
> #include "hw/core/cpu.h"
> 
> +#include "trace.h"
> +
> #include <igvm/igvm.h>
> #include <igvm/igvm_defs.h>
> 
> @@ -884,6 +886,8 @@ IgvmHandle qigvm_file_init(char *filename, Error **errp)
>         error_setg(errp, "Unable to parse IGVM file %s: %d", filename, igvm);
>         return -1;
>     }
> +
> +    trace_igvm_file_loaded(filename, igvm);
>     return igvm;
> }
> 
> @@ -901,6 +905,7 @@ int qigvm_process_file(IgvmCfg *cfg, ConfidentialGuestSupport *cgs,
>         return -1;
>     }
>     ctx.file = cfg->file;
> +    trace_igvm_process_file(cfg->file, onlyVpContext);
> 
>     /*
>      * The ConfidentialGuestSupport object is optional and allows a confidential
> diff --git a/backends/trace-events b/backends/trace-events
> index 45ac46dc2454..7a00e9bf6c16 100644
> --- a/backends/trace-events
> +++ b/backends/trace-events
> @@ -26,3 +26,5 @@ iommufd_backend_invalidate_cache(int iommufd, uint32_t id, uint32_t data_type, u
> igvm_reset_enter(int type) "type=%u"
> igvm_reset_hold(int type) "type=%u"
> igvm_reset_exit(int type) "type=%u"
> +igvm_file_loaded(const char *fn, int32_t handle) "fn=%s, handle=0x%x"
> +igvm_process_file(int32_t handle, bool context_only) "handle=0x%x context-only=%d"
> -- 
> 2.51.1
> 
Re: [PATCH 3/4] igvm: add trace point for igvm file loading and processing
Posted by Gerd Hoffmann 2 months, 2 weeks ago
On Fri, Nov 21, 2025 at 06:37:41PM +0530, Ani Sinha wrote:
> 
> 
> > On 18 Nov 2025, at 5:51 PM, Gerd Hoffmann <kraxel@redhat.com> wrote:
> > 
> Please add some description to the patch …

Not sure what to add here.  It's a small patch adding two trace points,
and IMHO $subject is a complete description ...

take care,
  Gerd