Skip to contentSkip to conversation

rpmsg: reduce rpmsg_virtio verbosity

PATCH In review David Cohen 2 participants 4 messages Oct 3, 2013 – Feb 24, 2014 Remote processor messaging (rpmsg)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rpmsg: reduce rpmsg_virtio verbosity

From: Jocelyn Falempe <[email protected]>

rpmsg_virtio TX/RX messages are very verbose, overflowing kernel printk buffer. This patch makes the guilty print_hex_dump()'s to act as dev_dbg() and do nothing in case neither DEBUG nor CONFIG_DYNAMIC_DEBUG are defined.

---
 drivers/rpmsg/virtio_rpmsg_bus.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/rpmsg/virtio_rpmsg_bus.c +6 -2
index b6135d4..e7c5927 100644
@@ -749,8 +749,10 @@ int rpmsg_send_offchannel_raw(struct rpmsg_channel *rpdev, u32 src, u32 dst,
 	dev_dbg(dev, "TX From 0x%x, To 0x%x, Len %d, Flags %d, Reserved %d\n",
 					msg->src, msg->dst, msg->len,
 					msg->flags, msg->reserved);
-	print_hex_dump(KERN_DEBUG, "rpmsg_virtio TX: ", DUMP_PREFIX_NONE, 16, 1,
+#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG)
+	print_hex_dump_debug("rpmsg_virtio TX: ", DUMP_PREFIX_NONE, 16, 1,
 					msg, sizeof(*msg) + msg->len, true);
+#endif
 
 	sg_init_one(&sg, msg, sizeof(*msg) + len);
 
@@ -786,8 +788,10 @@ static int rpmsg_recv_single(struct virtproc_info *vrp, struct device *dev,
 	dev_dbg(dev, "From: 0x%x, To: 0x%x, Len: %d, Flags: %d, Reserved: %d\n",
 					msg->src, msg->dst, msg->len,
 					msg->flags, msg->reserved);
-	print_hex_dump(KERN_DEBUG, "rpmsg_virtio RX: ", DUMP_PREFIX_NONE, 16, 1,
+#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG)
+	print_hex_dump_debug("rpmsg_virtio RX: ", DUMP_PREFIX_NONE, 16, 1,
 					msg, sizeof(*msg) + msg->len, true);
+#endif
 
 	/*
 	 * We currently use fixed-sized buffers, so trivially sanitize
Signature · 1 line
1.8.4.rc3
#1 lore raw
Quoted 10 lines · David Cohen

From: Jocelyn Falempe <[email protected]>

rpmsg_virtio TX/RX messages are very verbose, overflowing kernel printk buffer. This patch makes the guilty print_hex_dump()'s to act as dev_dbg() and do nothing in case neither DEBUG nor CONFIG_DYNAMIC_DEBUG are defined.

---

Ping :)
Comments here?

Br, David Cohen

Quoted 32 lines
  drivers/rpmsg/virtio_rpmsg_bus.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
drivers/rpmsg/virtio_rpmsg_bus.c +6 -2
index b6135d4..e7c5927 100644
@@ -749,8 +749,10 @@ int rpmsg_send_offchannel_raw(struct rpmsg_channel *rpdev, u32 src, u32 dst,
  	dev_dbg(dev, "TX From 0x%x, To 0x%x, Len %d, Flags %d, Reserved %d\n",
  					msg->src, msg->dst, msg->len,
  					msg->flags, msg->reserved);
-	print_hex_dump(KERN_DEBUG, "rpmsg_virtio TX: ", DUMP_PREFIX_NONE, 16, 1,
+#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG)
+	print_hex_dump_debug("rpmsg_virtio TX: ", DUMP_PREFIX_NONE, 16, 1,
  					msg, sizeof(*msg) + msg->len, true);
+#endif
 
  	sg_init_one(&sg, msg, sizeof(*msg) + len);
 
@@ -786,8 +788,10 @@ static int rpmsg_recv_single(struct virtproc_info *vrp, struct device *dev,
  	dev_dbg(dev, "From: 0x%x, To: 0x%x, Len: %d, Flags: %d, Reserved: %d\n",
  					msg->src, msg->dst, msg->len,
  					msg->flags, msg->reserved);
-	print_hex_dump(KERN_DEBUG, "rpmsg_virtio RX: ", DUMP_PREFIX_NONE, 16, 1,
+#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG)
+	print_hex_dump_debug("rpmsg_virtio RX: ", DUMP_PREFIX_NONE, 16, 1,
  					msg, sizeof(*msg) + msg->len, true);
+#endif
 
  	/*
  	 * We currently use fixed-sized buffers, so trivially sanitize
#2 lore raw

Hi,

Quoted 8 lines · David Cohen
Quoted 7 lines · David Cohen

From: Jocelyn Falempe <[email protected]>

rpmsg_virtio TX/RX messages are very verbose, overflowing kernel printk buffer. This patch makes the guilty print_hex_dump()'s to act as dev_dbg() and do nothing in case neither DEBUG nor CONFIG_DYNAMIC_DEBUG are defined.

Quoted 6 lines
Quoted 3 lines

---

Ping :)
Comments here?

Ping again :)

Quoted 3 lines

Br, David Cohen

#3 lore raw
In reply to David Cohen

Hi David,

Sorry for the late response.

Quoted 9 lines · David Cohen

From: Jocelyn Falempe <[email protected]>

rpmsg_virtio TX/RX messages are very verbose, overflowing kernel printk buffer. This patch makes the guilty print_hex_dump()'s to act as dev_dbg() and do nothing in case neither DEBUG nor CONFIG_DYNAMIC_DEBUG are defined.

This sounds like a good thing to do, but I wonder if it should be implemented in a more generic way, so other users of print_hex_dump_debug can benefit from this as well?

Thanks,
Ohad.