public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>, passt-dev@passt.top
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 1/6] vhost-user: Change different vhost-user messages to trace() level
Date: Mon,  3 Feb 2025 20:26:10 +1100	[thread overview]
Message-ID: <20250203092615.500163-2-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20250203092615.500163-1-david@gibson.dropbear.id.au>

A previous patch changed the debug() calls in vu_control_handler() to
trace() to reduce noise when debugging migration.  However those messages
are infrequent, and pretty useful when debugging migration (I used them to
discover I needed a different qemu version).

At the same time we have potentially per-packet debug() messages in
vu_kick_cb() and vu_send_single().  These get much more in the way since
they occur asynchronously with the migration operation.  As a rule, per
packet messages should be trace() level anyway.

[This is a candidate to fold into the earlier patch]

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 vhost_user.c | 8 ++++----
 vu_common.c  | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/vhost_user.c b/vhost_user.c
index 19ede8a9..755017f1 100644
--- a/vhost_user.c
+++ b/vhost_user.c
@@ -1181,11 +1181,11 @@ void vu_control_handler(struct vu_dev *vdev, int fd, uint32_t events)
 		vu_sock_reset(vdev);
 		return;
 	}
-	trace("================ Vhost user message ================");
-	trace("Request: %s (%d)", vu_request_to_string(msg.hdr.request),
+	debug("================ Vhost user message ================");
+	debug("Request: %s (%d)", vu_request_to_string(msg.hdr.request),
 		msg.hdr.request);
-	trace("Flags:   0x%x", msg.hdr.flags);
-	trace("Size:    %u", msg.hdr.size);
+	debug("Flags:   0x%x", msg.hdr.flags);
+	debug("Size:    %u", msg.hdr.size);
 
 	need_reply = msg.hdr.flags & VHOST_USER_NEED_REPLY_MASK;
 
diff --git a/vu_common.c b/vu_common.c
index 78d1c1ba..48826b13 100644
--- a/vu_common.c
+++ b/vu_common.c
@@ -240,7 +240,7 @@ void vu_kick_cb(struct vu_dev *vdev, union epoll_ref ref,
 	if (rc == -1)
 		die_perror("vhost-user kick eventfd_read()");
 
-	debug("vhost-user: got kick_data: %016"PRIx64" idx: %d",
+	trace("vhost-user: got kick_data: %016"PRIx64" idx: %d",
 	      kick_data, ref.queue);
 	if (VHOST_USER_IS_QUEUE_TX(ref.queue))
 		vu_handle_tx(vdev, ref.queue, now);
@@ -264,7 +264,7 @@ int vu_send_single(const struct ctx *c, const void *buf, size_t size)
 	int elem_cnt;
 	int i;
 
-	debug("vu_send_single size %zu", size);
+	trace("vu_send_single size %zu", size);
 
 	if (!vu_queue_enabled(vq) || !vu_queue_started(vq)) {
 		debug("Got packet, but RX virtqueue not usable yet");
@@ -296,7 +296,7 @@ int vu_send_single(const struct ctx *c, const void *buf, size_t size)
 
 	vu_flush(vdev, vq, elem, elem_cnt);
 
-	debug("vhost-user sent %zu", total);
+	trace("vhost-user sent %zu", total);
 
 	return total;
 err:
-- 
@@ -240,7 +240,7 @@ void vu_kick_cb(struct vu_dev *vdev, union epoll_ref ref,
 	if (rc == -1)
 		die_perror("vhost-user kick eventfd_read()");
 
-	debug("vhost-user: got kick_data: %016"PRIx64" idx: %d",
+	trace("vhost-user: got kick_data: %016"PRIx64" idx: %d",
 	      kick_data, ref.queue);
 	if (VHOST_USER_IS_QUEUE_TX(ref.queue))
 		vu_handle_tx(vdev, ref.queue, now);
@@ -264,7 +264,7 @@ int vu_send_single(const struct ctx *c, const void *buf, size_t size)
 	int elem_cnt;
 	int i;
 
-	debug("vu_send_single size %zu", size);
+	trace("vu_send_single size %zu", size);
 
 	if (!vu_queue_enabled(vq) || !vu_queue_started(vq)) {
 		debug("Got packet, but RX virtqueue not usable yet");
@@ -296,7 +296,7 @@ int vu_send_single(const struct ctx *c, const void *buf, size_t size)
 
 	vu_flush(vdev, vq, elem, elem_cnt);
 
-	debug("vhost-user sent %zu", total);
+	trace("vhost-user sent %zu", total);
 
 	return total;
 err:
-- 
2.48.1


  reply	other threads:[~2025-02-03  9:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03  9:26 [PATCH 0/6] More migration improvements David Gibson
2025-02-03  9:26 ` David Gibson [this message]
2025-02-04  0:42   ` [PATCH 1/6] vhost-user: Change different vhost-user messages to trace() level Stefano Brivio
2025-02-03  9:26 ` [PATCH 2/6] migrate, flow: Abort migration on repair_flush() failure David Gibson
2025-02-03  9:26 ` [PATCH 3/6] migrate: Clearer debug message in migrate_request() David Gibson
2025-02-03  9:26 ` [PATCH 4/6] migrate: Handle sending header section from data sections David Gibson
2025-02-03  9:26 ` [PATCH 5/6] util: read_remainder should take const pointer to iovec David Gibson
2025-02-04  0:42   ` Stefano Brivio
2025-02-03  9:26 ` [PATCH 6/6] migrate: Make migration handlers simpler and more flexible David Gibson
2025-02-03 10:20   ` Stefano Brivio
2025-02-03 23:55     ` David Gibson
2025-02-04  0:12       ` Stefano Brivio
2025-02-04  3:36         ` David Gibson

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=20250203092615.500163-2-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

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 IMAP folder(s).