[3/4] vhost: improve some datapath log messages

Message ID 20220627092728.78214-4-david.marchand@redhat.com (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers
Series Vhost logs fixes and improvement |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

David Marchand June 27, 2022, 9:27 a.m. UTC
  Those messages were missed when adding socket context.
Fix this.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/vhost/vhost.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Maxime Coquelin June 30, 2022, 4:07 p.m. UTC | #1
On 6/27/22 11:27, David Marchand wrote:
> Those messages were missed when adding socket context.
> Fix this.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>   lib/vhost/vhost.h | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  

Patch

diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h
index 4ebcb7448a..810bc71c9d 100644
--- a/lib/vhost/vhost.h
+++ b/lib/vhost/vhost.h
@@ -652,7 +652,7 @@  extern int vhost_data_log_level;
 	} \
 	snprintf(packet + strnlen(packet, VHOST_MAX_PRINT_BUFF), VHOST_MAX_PRINT_BUFF - strnlen(packet, VHOST_MAX_PRINT_BUFF), "\n"); \
 	\
-	VHOST_LOG_DATA(DEBUG, "%s", packet); \
+	VHOST_LOG_DATA(DEBUG, "(%s) %s", device->ifname, packet); \
 } while (0)
 #else
 #define PRINT_PACKET(device, addr, size, header) do {} while (0)
@@ -866,8 +866,8 @@  vhost_vring_call_split(struct virtio_net *dev, struct vhost_virtqueue *vq)
 		vq->signalled_used = new;
 		vq->signalled_used_valid = true;
 
-		VHOST_LOG_DATA(DEBUG, "%s: used_event_idx=%d, old=%d, new=%d\n",
-			__func__,
+		VHOST_LOG_DATA(DEBUG, "(%s) %s: used_event_idx=%d, old=%d, new=%d\n",
+			dev->ifname, __func__,
 			vhost_used_event(vq),
 			old, new);