* [PATCH] Migration: Add trace points for vmstate handler insertion/removal
@ 2024-10-18 14:44 Peter Xu
2024-10-18 14:50 ` Fabiano Rosas
2024-10-18 21:27 ` Peter Xu
0 siblings, 2 replies; 3+ messages in thread
From: Peter Xu @ 2024-10-18 14:44 UTC (permalink / raw)
To: qemu-devel; +Cc: peterx, Laurent Vivier, Fabiano Rosas
SaveStateEntry has lots of magics internally, on alias_id, get_id() being
able to overwrite the original idstr, compat fields, ID_ANY, and so on. It
may not be always clear that what all these fields are being registered for
some device we care.
Add trace points for SaveStateEntry insertions/removals, so that we know
what was being registered. For insertions, we dump everything that might
be useful. For removal, only section_id is needed because that's the
unique identifier for an SeveStateEntry.
Cc: Laurent Vivier <lvivier@redhat.com>
Cc: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
migration/savevm.c | 7 +++++++
migration/trace-events | 2 ++
2 files changed, 9 insertions(+)
diff --git a/migration/savevm.c b/migration/savevm.c
index e796436979..57f058bd40 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -718,6 +718,11 @@ static void savevm_state_handler_insert(SaveStateEntry *nse)
assert(priority <= MIG_PRI_MAX);
+ trace_vmstate_handler_insert(
+ nse->idstr, nse->instance_id, nse->alias_id, nse->version_id,
+ nse->section_id, nse->compat ? nse->compat->idstr : NULL,
+ nse->compat ? nse->compat->instance_id : 0);
+
/*
* This should never happen otherwise migration will probably fail
* silently somewhere because we can be wrongly applying one
@@ -754,6 +759,8 @@ static void savevm_state_handler_remove(SaveStateEntry *se)
SaveStateEntry *next;
MigrationPriority priority = save_state_priority(se);
+ trace_vmstate_handler_remove(se->section_id);
+
if (se == savevm_state.handler_pri_head[priority]) {
next = QTAILQ_NEXT(se, entry);
if (next != NULL && save_state_priority(next) == priority) {
diff --git a/migration/trace-events b/migration/trace-events
index 0638183056..3411f2f699 100644
--- a/migration/trace-events
+++ b/migration/trace-events
@@ -50,6 +50,8 @@ vmstate_load(const char *idstr, const char *vmsd_name) "%s, %s"
vmstate_downtime_save(const char *type, const char *idstr, uint32_t instance_id, int64_t downtime) "type=%s idstr=%s instance_id=%d downtime=%"PRIi64
vmstate_downtime_load(const char *type, const char *idstr, uint32_t instance_id, int64_t downtime) "type=%s idstr=%s instance_id=%d downtime=%"PRIi64
vmstate_downtime_checkpoint(const char *checkpoint) "%s"
+vmstate_handler_insert(char *idstr, uint32_t instance_id, int alias_id, int version_id, int section_id, char *compat_idstr, int compat_instance_id) "id=%s instance_id=%"PRIu32" alias_id=%d version_id=%d section_id=%d compat_id=%s compat_instance_id=%d"
+vmstate_handler_remove(int section_id) "section_id=%d"
postcopy_pause_incoming(void) ""
postcopy_pause_incoming_continued(void) ""
postcopy_page_req_sync(void *host_addr) "sync page req %p"
--
2.45.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Migration: Add trace points for vmstate handler insertion/removal
2024-10-18 14:44 [PATCH] Migration: Add trace points for vmstate handler insertion/removal Peter Xu
@ 2024-10-18 14:50 ` Fabiano Rosas
2024-10-18 21:27 ` Peter Xu
1 sibling, 0 replies; 3+ messages in thread
From: Fabiano Rosas @ 2024-10-18 14:50 UTC (permalink / raw)
To: Peter Xu, qemu-devel; +Cc: peterx, Laurent Vivier
Peter Xu <peterx@redhat.com> writes:
> SaveStateEntry has lots of magics internally, on alias_id, get_id() being
> able to overwrite the original idstr, compat fields, ID_ANY, and so on. It
> may not be always clear that what all these fields are being registered for
> some device we care.
>
> Add trace points for SaveStateEntry insertions/removals, so that we know
> what was being registered. For insertions, we dump everything that might
> be useful. For removal, only section_id is needed because that's the
> unique identifier for an SeveStateEntry.
>
> Cc: Laurent Vivier <lvivier@redhat.com>
> Cc: Fabiano Rosas <farosas@suse.de>
> Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Migration: Add trace points for vmstate handler insertion/removal
2024-10-18 14:44 [PATCH] Migration: Add trace points for vmstate handler insertion/removal Peter Xu
2024-10-18 14:50 ` Fabiano Rosas
@ 2024-10-18 21:27 ` Peter Xu
1 sibling, 0 replies; 3+ messages in thread
From: Peter Xu @ 2024-10-18 21:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, Fabiano Rosas
On Fri, Oct 18, 2024 at 10:44:26AM -0400, Peter Xu wrote:
> SaveStateEntry has lots of magics internally, on alias_id, get_id() being
> able to overwrite the original idstr, compat fields, ID_ANY, and so on. It
> may not be always clear that what all these fields are being registered for
> some device we care.
>
> Add trace points for SaveStateEntry insertions/removals, so that we know
> what was being registered. For insertions, we dump everything that might
> be useful. For removal, only section_id is needed because that's the
> unique identifier for an SeveStateEntry.
>
> Cc: Laurent Vivier <lvivier@redhat.com>
> Cc: Fabiano Rosas <farosas@suse.de>
> Signed-off-by: Peter Xu <peterx@redhat.com>
queued.
--
Peter Xu
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-18 21:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-18 14:44 [PATCH] Migration: Add trace points for vmstate handler insertion/removal Peter Xu
2024-10-18 14:50 ` Fabiano Rosas
2024-10-18 21:27 ` Peter Xu
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).