aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rpmsg
diff options
context:
space:
mode:
authorAnna, Suman <s-anna@ti.com>2016-08-12 19:42:27 -0400
committerBjorn Andersson <bjorn.andersson@linaro.org>2016-08-13 00:26:21 -0400
commit211e3a93e5b5933e64ddfb299eee462ac7c7d500 (patch)
tree4cfcfde8ac4e2136bf7d27d9468e011e6e024e7f /drivers/rpmsg
parent0963679c0c30269c17d5891081cf0896f7d92c4b (diff)
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>
Diffstat (limited to 'drivers/rpmsg')
-rw-r--r--drivers/rpmsg/virtio_rpmsg_bus.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index 7006dd3466c0..4a4374cc6a59 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -749,8 +749,10 @@ int rpmsg_send_offchannel_raw(struct rpmsg_channel *rpdev, u32 src, u32 dst,
749 749
750 dev_dbg(dev, "TX From 0x%x, To 0x%x, Len %d, Flags %d, Reserved %d\n", 750 dev_dbg(dev, "TX From 0x%x, To 0x%x, Len %d, Flags %d, Reserved %d\n",
751 msg->src, msg->dst, msg->len, msg->flags, msg->reserved); 751 msg->src, msg->dst, msg->len, msg->flags, msg->reserved);
752 print_hex_dump(KERN_DEBUG, "rpmsg_virtio TX: ", DUMP_PREFIX_NONE, 16, 1, 752#if defined(CONFIG_DYNAMIC_DEBUG)
753 msg, sizeof(*msg) + msg->len, true); 753 dynamic_hex_dump("rpmsg_virtio TX: ", DUMP_PREFIX_NONE, 16, 1,
754 msg, sizeof(*msg) + msg->len, true);
755#endif
754 756
755 sg_init_one(&sg, msg, sizeof(*msg) + len); 757 sg_init_one(&sg, msg, sizeof(*msg) + len);
756 758
@@ -785,8 +787,10 @@ static int rpmsg_recv_single(struct virtproc_info *vrp, struct device *dev,
785 787
786 dev_dbg(dev, "From: 0x%x, To: 0x%x, Len: %d, Flags: %d, Reserved: %d\n", 788 dev_dbg(dev, "From: 0x%x, To: 0x%x, Len: %d, Flags: %d, Reserved: %d\n",
787 msg->src, msg->dst, msg->len, msg->flags, msg->reserved); 789 msg->src, msg->dst, msg->len, msg->flags, msg->reserved);
788 print_hex_dump(KERN_DEBUG, "rpmsg_virtio RX: ", DUMP_PREFIX_NONE, 16, 1, 790#if defined(CONFIG_DYNAMIC_DEBUG)
789 msg, sizeof(*msg) + msg->len, true); 791 dynamic_hex_dump("rpmsg_virtio RX: ", DUMP_PREFIX_NONE, 16, 1,
792 msg, sizeof(*msg) + msg->len, true);
793#endif
790 794
791 /* 795 /*
792 * We currently use fixed-sized buffers, so trivially sanitize 796 * 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,
897 struct device *dev = &vrp->vdev->dev; 901 struct device *dev = &vrp->vdev->dev;
898 int ret; 902 int ret;
899 903
900 print_hex_dump(KERN_DEBUG, "NS announcement: ", 904#if defined(CONFIG_DYNAMIC_DEBUG)
901 DUMP_PREFIX_NONE, 16, 1, data, len, true); 905 dynamic_hex_dump("NS announcement: ", DUMP_PREFIX_NONE, 16, 1,
906 data, len, true);
907#endif
902 908
903 if (len != sizeof(*msg)) { 909 if (len != sizeof(*msg)) {
904 dev_err(dev, "malformed ns msg (%d)\n", len); 910 dev_err(dev, "malformed ns msg (%d)\n", len);