qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: Juraj Marcin <jmarcin@redhat.com>,
	peterx@redhat.com, "Dr . David Alan Gilbert" <dave@treblig.org>,
	Fabiano Rosas <farosas@suse.de>
Subject: [PATCH v2 09/11] migration/ram: Add tracepoints for ram_save_complete()
Date: Mon,  9 Jun 2025 12:18:53 -0400	[thread overview]
Message-ID: <20250609161855.6603-10-peterx@redhat.com> (raw)
In-Reply-To: <20250609161855.6603-1-peterx@redhat.com>

Take notes on start/end state of dirty pages for the whole system.

Reviewed-by: Juraj Marcin <jmarcin@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 migration/ram.c        | 5 +++++
 migration/trace-events | 1 +
 2 files changed, 6 insertions(+)

diff --git a/migration/ram.c b/migration/ram.c
index c66ad3cf8b..a1d0e8ada2 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3289,6 +3289,8 @@ static int ram_save_complete(QEMUFile *f, void *opaque)
     RAMState *rs = *temp;
     int ret = 0;
 
+    trace_ram_save_complete(rs->migration_dirty_pages, 0);
+
     rs->last_stage = !migration_in_colo_state();
 
     WITH_RCU_READ_LOCK_GUARD() {
@@ -3352,6 +3354,9 @@ static int ram_save_complete(QEMUFile *f, void *opaque)
     }
 
     qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
+
+    trace_ram_save_complete(rs->migration_dirty_pages, 1);
+
     return qemu_fflush(f);
 }
 
diff --git a/migration/trace-events b/migration/trace-events
index c506e11a2e..dcd8fe9a0c 100644
--- a/migration/trace-events
+++ b/migration/trace-events
@@ -105,6 +105,7 @@ ram_load_postcopy_loop(int channel, uint64_t addr, int flags) "chan=%d addr=0x%"
 ram_postcopy_send_discard_bitmap(void) ""
 ram_save_page(const char *rbname, uint64_t offset, void *host) "%s: offset: 0x%" PRIx64 " host: %p"
 ram_save_queue_pages(const char *rbname, size_t start, size_t len) "%s: start: 0x%zx len: 0x%zx"
+ram_save_complete(uint64_t dirty_pages, int done) "dirty=%" PRIu64 ", done=%d"
 ram_dirty_bitmap_request(char *str) "%s"
 ram_dirty_bitmap_reload_begin(char *str) "%s"
 ram_dirty_bitmap_reload_complete(char *str) "%s"
-- 
2.49.0



  parent reply	other threads:[~2025-06-09 16:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-09 16:18 [PATCH v2 00/11] migration: Some enhancements and cleanups for 10.1 Peter Xu
2025-06-09 16:18 ` [PATCH v2 01/11] migration/hmp: Reorg "info migrate" once more Peter Xu
2025-06-09 16:18 ` [PATCH v2 02/11] migration/hmp: Fix postcopy-blocktime per-vCPU results Peter Xu
2025-07-01 14:38   ` Fabiano Rosas
2025-06-09 16:18 ` [PATCH v2 03/11] migration/docs: Move docs for postcopy blocktime feature Peter Xu
2025-06-09 16:18 ` [PATCH v2 04/11] migration/bg-snapshot: Do not check for SKIP in iterator Peter Xu
2025-06-09 16:18 ` [PATCH v2 05/11] migration: Drop save_live_complete_postcopy hook Peter Xu
2025-07-01 14:40   ` Fabiano Rosas
2025-06-09 16:18 ` [PATCH v2 06/11] migration: Rename save_live_complete_precopy to save_complete Peter Xu
2025-07-01 14:41   ` Fabiano Rosas
2025-06-09 16:18 ` [PATCH v2 07/11] migration: qemu_savevm_complete*() helpers Peter Xu
2025-07-01 14:53   ` Fabiano Rosas
2025-06-09 16:18 ` [PATCH v2 08/11] migration/ram: One less indent for ram_find_and_save_block() Peter Xu
2025-06-09 16:18 ` Peter Xu [this message]
2025-06-09 16:18 ` [PATCH v2 10/11] migration: Rewrite the migration complete detect logic Peter Xu
2025-07-01 17:35   ` Fabiano Rosas
2025-06-09 16:18 ` [PATCH v2 11/11] migration/postcopy: Avoid clearing dirty bitmap for postcopy too Peter Xu
2025-06-11  6:15 ` [PATCH v2 00/11] migration: Some enhancements and cleanups for 10.1 Mario Casquero
2025-06-11 13:06   ` Peter Xu
2025-06-12 10:35     ` Mario Casquero
2025-06-12 11:43       ` Peter Xu
2025-06-11 21:35 ` Peter Xu

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=20250609161855.6603-10-peterx@redhat.com \
    --to=peterx@redhat.com \
    --cc=dave@treblig.org \
    --cc=farosas@suse.de \
    --cc=jmarcin@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).