Skip to content

Commit 211e3a9

Browse files
sumanannaandersson
authored andcommitted
rpmsg: use dynamic_hex_dump for hex dump traces
There are couple of print_hex_dump traces used in rpmsg code which prints the actual byte messages being transferred between host and the remote processors. These traces are quiet verbose and affects performance, if the appropriate trace level is enabled. These hex dumps are needed rather rarely, but are quite useful when debugging complex IPC corner cases. So, this patch switches these hex dump traces to use the dynamic_hex_dump() API. The hex dump traces are also enabled only when CONFIG_DYNAMIC_DEBUG is enabled. This switch allows flexibility of controlling these traces through dynamic debug, instead of removing them completely. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
1 parent 0963679 commit 211e3a9

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

‎drivers/rpmsg/virtio_rpmsg_bus.c‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -749,8 +749,10 @@ int rpmsg_send_offchannel_raw(struct rpmsg_channel *rpdev, u32 src, u32 dst,
749749

750750
dev_dbg(dev, "TX From 0x%x, To 0x%x, Len %d, Flags %d, Reserved %d\n",
751751
msg->src, msg->dst, msg->len, msg->flags, msg->reserved);
752-
print_hex_dump(KERN_DEBUG, "rpmsg_virtio TX: ", DUMP_PREFIX_NONE, 16, 1,
753-
msg, sizeof(*msg) + msg->len, true);
752+
#if defined(CONFIG_DYNAMIC_DEBUG)
753+
dynamic_hex_dump("rpmsg_virtio TX: ", DUMP_PREFIX_NONE, 16, 1,
754+
msg, sizeof(*msg) + msg->len, true);
755+
#endif
754756

755757
sg_init_one(&sg, msg, sizeof(*msg) + len);
756758

@@ -785,8 +787,10 @@ static int rpmsg_recv_single(struct virtproc_info *vrp, struct device *dev,
785787

786788
dev_dbg(dev, "From: 0x%x, To: 0x%x, Len: %d, Flags: %d, Reserved: %d\n",
787789
msg->src, msg->dst, msg->len, msg->flags, msg->reserved);
788-
print_hex_dump(KERN_DEBUG, "rpmsg_virtio RX: ", DUMP_PREFIX_NONE, 16, 1,
789-
msg, sizeof(*msg) + msg->len, true);
790+
#if defined(CONFIG_DYNAMIC_DEBUG)
791+
dynamic_hex_dump("rpmsg_virtio RX: ", DUMP_PREFIX_NONE, 16, 1,
792+
msg, sizeof(*msg) + msg->len, true);
793+
#endif
790794

791795
/*
792796
* We currently use fixed-sized buffers, so trivially sanitize
@@ -897,8 +901,10 @@ static void rpmsg_ns_cb(struct rpmsg_channel *rpdev, void *data, int len,
897901
struct device *dev = &vrp->vdev->dev;
898902
int ret;
899903

900-
print_hex_dump(KERN_DEBUG, "NS announcement: ",
901-
DUMP_PREFIX_NONE, 16, 1, data, len, true);
904+
#if defined(CONFIG_DYNAMIC_DEBUG)
905+
dynamic_hex_dump("NS announcement: ", DUMP_PREFIX_NONE, 16, 1,
906+
data, len, true);
907+
#endif
902908

903909
if (len != sizeof(*msg)) {
904910
dev_err(dev, "malformed ns msg (%d)\n", len);

0 commit comments

Comments
 (0)