linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: trace: Print register read and write offset
@ 2021-03-25  1:53 Thinh Nguyen
  2021-03-25  9:27 ` Felipe Balbi
  0 siblings, 1 reply; 2+ messages in thread
From: Thinh Nguyen @ 2021-03-25  1:53 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, linux-usb; +Cc: John Youn

Currently dwc3 only prints the virtual address of a register when doing
register read/write. However, these hashed addresses are difficult to read.
Also, since we use %p, we may get some useless (___ptrval___) prints if the
address is not randomized enough. Let's include the register offset to help
read the register read and write tracepoints.

Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
---
 drivers/usb/dwc3/trace.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/trace.h b/drivers/usb/dwc3/trace.h
index 97f4f1125a41..3cbeb9854532 100644
--- a/drivers/usb/dwc3/trace.h
+++ b/drivers/usb/dwc3/trace.h
@@ -32,8 +32,10 @@ DECLARE_EVENT_CLASS(dwc3_log_io,
 		__entry->offset = offset;
 		__entry->value = value;
 	),
-	TP_printk("addr %p value %08x", __entry->base + __entry->offset,
-			__entry->value)
+	TP_printk("addr %p offset %04x value %08x",
+		__entry->base + __entry->offset,
+		__entry->offset,
+		__entry->value)
 );
 
 DEFINE_EVENT(dwc3_log_io, dwc3_readl,

base-commit: 049d3db625a652e23488db88b6104de4d5b62f16
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: dwc3: trace: Print register read and write offset
  2021-03-25  1:53 [PATCH] usb: dwc3: trace: Print register read and write offset Thinh Nguyen
@ 2021-03-25  9:27 ` Felipe Balbi
  0 siblings, 0 replies; 2+ messages in thread
From: Felipe Balbi @ 2021-03-25  9:27 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman, linux-usb; +Cc: John Youn

[-- Attachment #1: Type: text/plain, Size: 1232 bytes --]


Hi,

Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes:
> Currently dwc3 only prints the virtual address of a register when doing
> register read/write. However, these hashed addresses are difficult to read.
> Also, since we use %p, we may get some useless (___ptrval___) prints if the
> address is not randomized enough. Let's include the register offset to help
> read the register read and write tracepoints.
>
> Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
> ---
>  drivers/usb/dwc3/trace.h | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/dwc3/trace.h b/drivers/usb/dwc3/trace.h
> index 97f4f1125a41..3cbeb9854532 100644
> --- a/drivers/usb/dwc3/trace.h
> +++ b/drivers/usb/dwc3/trace.h
> @@ -32,8 +32,10 @@ DECLARE_EVENT_CLASS(dwc3_log_io,
>  		__entry->offset = offset;
>  		__entry->value = value;
>  	),
> -	TP_printk("addr %p value %08x", __entry->base + __entry->offset,
> -			__entry->value)
> +	TP_printk("addr %p offset %04x value %08x",
> +		__entry->base + __entry->offset,
> +		__entry->offset,

might be better, then, to print base and offset separately. Other than
that:

Acked-by: Felipe Balbi <balbi@kernel.org>

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 857 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-25  9:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-25  1:53 [PATCH] usb: dwc3: trace: Print register read and write offset Thinh Nguyen
2021-03-25  9:27 ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).