diff mbox series

usb: dwc3: trace: Print register read and write offset

Message ID cb38aa7dec109a8965691b53039a8b317d026189.1616636706.git.Thinh.Nguyen@synopsys.com
State New
Headers show
Series usb: dwc3: trace: Print register read and write offset | expand

Commit Message

Thinh Nguyen March 25, 2021, 1:53 a.m. UTC
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(-)


base-commit: 049d3db625a652e23488db88b6104de4d5b62f16

Comments

Felipe Balbi March 25, 2021, 9:27 a.m. UTC | #1
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>
diff mbox series

Patch

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,