All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ani Sinha <anisinha@redhat.com>
To: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Peter Xu" <peterx@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@mailo.com>
Cc: Ani Sinha <anisinha@redhat.com>,
	agraf@csgraf.de, graf@amazon.com, qemu-devel@nongnu.org,
	kraxel@redhat.com
Subject: [PATCH v4 04/11] system/memory: add a tracepoint for memory_region_finalize
Date: Fri,  7 Aug 2026 10:55:46 +0530	[thread overview]
Message-ID: <20260807052559.50643-5-anisinha@redhat.com> (raw)
In-Reply-To: <20260807052559.50643-1-anisinha@redhat.com>

cosmetic: add a tracepoint to track when memory regions are getting freed.
Useful for debugging and tracking all freed memory regions.

Signed-off-by: Ani Sinha <anisinha@redhat.com>
---
 system/memory.c     | 1 +
 system/trace-events | 1 +
 2 files changed, 2 insertions(+)

diff --git a/system/memory.c b/system/memory.c
index 5fc36708ec..9485ba316f 100644
--- a/system/memory.c
+++ b/system/memory.c
@@ -1730,6 +1730,7 @@ static void memory_region_finalize(Object *obj)
 {
     MemoryRegion *mr = MEMORY_REGION(obj);
 
+    trace_memory_region_finalize(mr->name);
     /*
      * Each memory region (that can be freed) must have an owner, and it
      * always has the same lifecycle of its owner.  It means when reaching
diff --git a/system/trace-events b/system/trace-events
index 51b4a4679a..0e1a4c5865 100644
--- a/system/trace-events
+++ b/system/trace-events
@@ -27,6 +27,7 @@ flatview_new(void *view, void *root) "%p (root %p)"
 flatview_destroy(void *view, void *root) "%p (root %p)"
 flatview_destroy_rcu(void *view, void *root) "%p (root %p)"
 global_dirty_changed(unsigned int bitmask) "bitmask 0x%"PRIx32
+memory_region_finalize(const char* name) "mr %s"
 
 # physmem.c
 address_space_map(void *as, uint64_t addr, uint64_t len, bool is_write, uint32_t attrs) "as:%p addr 0x%"PRIx64":%"PRIx64" write:%d attrs:0x%x"
-- 
2.42.0



  parent reply	other threads:[~2026-08-07  5:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07  5:25 [PATCH v4 00/11] Introducing guest driven VM launch update mechanism (BYOF interface) Ani Sinha
2026-08-07  5:25 ` [PATCH v4 01/11] igvm: store IgvmCfg pointer in QIgvm Ani Sinha
2026-08-07  5:25 ` [PATCH v4 02/11] igvm: track memory regions Ani Sinha
2026-08-07  5:25 ` [PATCH v4 03/11] igvm: cleanup " Ani Sinha
2026-08-07  5:25 ` Ani Sinha [this message]
2026-08-07 12:59   ` [PATCH v4 04/11] system/memory: add a tracepoint for memory_region_finalize Peter Xu
2026-08-07  5:25 ` [PATCH v4 05/11] backends/igvm: add a tracepoint for qigvm_cleanup_memory Ani Sinha
2026-08-07  5:25 ` [PATCH v4 06/11] hw/misc/vmlaunchupdate: add api header Ani Sinha
2026-08-07  5:25 ` [PATCH v4 07/11] hw/misc/vmlaunchupdate: Introduce hypervisor fw-cfg interface support Ani Sinha
2026-08-07  5:25 ` [PATCH v4 08/11] docs/spec: Add a specification document for vm-launch-update device Ani Sinha
2026-08-07  5:25 ` [PATCH v4 09/11] tests/qtest: Add small igvm files for testing purpose Ani Sinha
2026-08-07  5:25 ` [PATCH v4 10/11] Add functional and unit tests for the vm-launch-update device Ani Sinha
2026-08-07  5:25 ` [PATCH v4 11/11] Update MAINTAINERS Ani Sinha

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=20260807052559.50643-5-anisinha@redhat.com \
    --to=anisinha@redhat.com \
    --cc=agraf@csgraf.de \
    --cc=graf@amazon.com \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@mailo.com \
    --cc=qemu-devel@nongnu.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 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.