qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] migration/block: Convert remaining DPRINTF() debug macro to trace events
@ 2023-02-15 15:35 Philippe Mathieu-Daudé
  2023-02-15 16:50 ` Juan Quintela
  0 siblings, 1 reply; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-02-15 15:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Fam Zheng, Stefan Hajnoczi, Juan Quintela,
	Dr. David Alan Gilbert, qemu-block, Philippe Mathieu-Daudé

Finish the conversion from commit fe80c0241d
("migration: using trace_ to replace DPRINTF").

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 migration/block.c      | 12 +-----------
 migration/trace-events |  1 +
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/migration/block.c b/migration/block.c
index 29f69025af..b5ce506d01 100644
--- a/migration/block.c
+++ b/migration/block.c
@@ -42,16 +42,6 @@
 #define MAX_IO_BUFFERS 512
 #define MAX_PARALLEL_IO 16
 
-/* #define DEBUG_BLK_MIGRATION */
-
-#ifdef DEBUG_BLK_MIGRATION
-#define DPRINTF(fmt, ...) \
-    do { printf("blk_migration: " fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
-    do { } while (0)
-#endif
-
 typedef struct BlkMigDevState {
     /* Written during setup phase.  Can be read without a lock.  */
     BlockBackend *blk;
@@ -502,7 +492,7 @@ static int blk_mig_save_bulked_block(QEMUFile *f)
         block_mig_state.prev_progress = progress;
         qemu_put_be64(f, (progress << BDRV_SECTOR_BITS)
                          | BLK_MIG_FLAG_PROGRESS);
-        DPRINTF("Completed %d %%\r", progress);
+        trace_migration_block_progression(progress);
     }
 
     return ret;
diff --git a/migration/trace-events b/migration/trace-events
index 67b65a70ff..b20e1271bc 100644
--- a/migration/trace-events
+++ b/migration/trace-events
@@ -357,6 +357,7 @@ migration_block_flush_blks(const char *action, int submitted, int read_done, int
 migration_block_save(const char *mig_stage, int submitted, int transferred) "Enter save live %s submitted %d transferred %d"
 migration_block_save_complete(void) "Block migration completed"
 migration_block_state_pending(uint64_t pending) "Enter save live pending  %" PRIu64
+migration_block_progression(unsigned percent) "Completed %u%%"
 
 # page_cache.c
 migration_pagecache_init(int64_t max_num_items) "Setting cache buckets to %" PRId64
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] migration/block: Convert remaining DPRINTF() debug macro to trace events
  2023-02-15 15:35 [PATCH] migration/block: Convert remaining DPRINTF() debug macro to trace events Philippe Mathieu-Daudé
@ 2023-02-15 16:50 ` Juan Quintela
  0 siblings, 0 replies; 2+ messages in thread
From: Juan Quintela @ 2023-02-15 16:50 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, qemu-trivial, Fam Zheng, Stefan Hajnoczi,
	Dr. David Alan Gilbert, qemu-block

Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> Finish the conversion from commit fe80c0241d
> ("migration: using trace_ to replace DPRINTF").
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Juan Quintela <quintela@redhat.com>

queued.

Thanks.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-15 16:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-15 15:35 [PATCH] migration/block: Convert remaining DPRINTF() debug macro to trace events Philippe Mathieu-Daudé
2023-02-15 16:50 ` Juan Quintela

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).