From: Suman Anna <s-anna@ti.com>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Ohad Ben-Cohen <ohad@wizery.com>,
<linux-remoteproc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, Suman Anna <s-anna@ti.com>
Subject: [PATCH 12/13] rpmsg: use dynamic_hex_dump for hex dump traces
Date: Fri, 12 Aug 2016 18:42:27 -0500 [thread overview]
Message-ID: <20160812234228.39731-13-s-anna@ti.com> (raw)
In-Reply-To: <20160812234228.39731-1-s-anna@ti.com>
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>
---
drivers/rpmsg/virtio_rpmsg_bus.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index e55d30d217ba..95ee6a9721d5 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,
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,
- msg, sizeof(*msg) + msg->len, true);
+#if defined(CONFIG_DYNAMIC_DEBUG)
+ dynamic_hex_dump("rpmsg_virtio TX: ", DUMP_PREFIX_NONE, 16, 1,
+ msg, sizeof(*msg) + msg->len, true);
+#endif
sg_init_one(&sg, msg, sizeof(*msg) + len);
@@ -785,8 +787,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,
- msg, sizeof(*msg) + msg->len, true);
+#if defined(CONFIG_DYNAMIC_DEBUG)
+ dynamic_hex_dump("rpmsg_virtio RX: ", DUMP_PREFIX_NONE, 16, 1,
+ msg, sizeof(*msg) + msg->len, true);
+#endif
/*
* 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,
struct device *dev = &vrp->vdev->dev;
int ret;
- print_hex_dump(KERN_DEBUG, "NS announcement: ",
- DUMP_PREFIX_NONE, 16, 1, data, len, true);
+#if defined(CONFIG_DYNAMIC_DEBUG)
+ dynamic_hex_dump("NS announcement: ", DUMP_PREFIX_NONE, 16, 1,
+ data, len, true);
+#endif
if (len != sizeof(*msg)) {
dev_err(dev, "malformed ns msg (%d)\n", len);
--
2.9.0
next prev parent reply other threads:[~2016-08-12 23:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-12 23:42 [PATCH 00/13] various remoteproc/rpmsg trivial cleanups Suman Anna
2016-08-12 23:42 ` [PATCH 01/13] remoteproc: use proper format-specifier for printing dma_addr_t Suman Anna
2016-08-12 23:42 ` [PATCH 02/13] remoteproc: fix couple of minor typos Suman Anna
2016-08-12 23:42 ` [PATCH 03/13] remoteproc: use variable names for sizeof() operator Suman Anna
2016-08-12 23:42 ` [PATCH 04/13] remoteproc: fix bare unsigned type usage Suman Anna
2016-08-12 23:42 ` [PATCH 05/13] remoteproc: align code with open parenthesis Suman Anna
2016-08-12 23:42 ` [PATCH 06/13] remoteproc: print hex numbers with a leading 0x format Suman Anna
2016-08-12 23:42 ` [PATCH 07/13] remoteproc/omap: fix various code formatting issues Suman Anna
2016-08-12 23:42 ` [PATCH 08/13] remoteproc/omap: revise a minor error trace message Suman Anna
2016-08-12 23:42 ` [PATCH 09/13] rpmsg: remove pointless OOM prints Suman Anna
2016-08-12 23:42 ` [PATCH 10/13] rpmsg: use proper format-specifier for printing dma_addr_t Suman Anna
2016-08-12 23:42 ` [PATCH 11/13] rpmsg: align code with open parenthesis Suman Anna
2016-08-12 23:42 ` Suman Anna [this message]
2016-08-12 23:42 ` [PATCH 13/13] samples/rpmsg: add support for multiple instances Suman Anna
2016-08-13 5:10 ` [PATCH 00/13] various remoteproc/rpmsg trivial cleanups Bjorn Andersson
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=20160812234228.39731-13-s-anna@ti.com \
--to=s-anna@ti.com \
--cc=bjorn.andersson@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=ohad@wizery.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®