Re: [PATCH 7/9] xhci: add port status tracing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 16.08.2017 14:45, Felipe Balbi wrote:

Hi,

Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx> writes:
Track the port status in a human readble way each time we get a
port status change event

Signed-off-by: Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>
---
  drivers/usb/host/xhci-ring.c  |  2 ++
  drivers/usb/host/xhci-trace.h | 23 +++++++++++++++++++++++
  2 files changed, 25 insertions(+)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 52a6650..a944365 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1638,6 +1638,8 @@ static void handle_port_status(struct xhci_hcd *xhci,
  			port_id);
  	portsc = readl(port_array[faked_port_index]);

+	trace_xhci_handle_port_status(faked_port_index, portsc);
+
  	if (hcd->state == HC_STATE_SUSPENDED) {
  		xhci_dbg(xhci, "resume root hub\n");
  		usb_hcd_resume_root_hub(hcd);
diff --git a/drivers/usb/host/xhci-trace.h b/drivers/usb/host/xhci-trace.h
index 8ce96de..f20753b 100644
--- a/drivers/usb/host/xhci-trace.h
+++ b/drivers/usb/host/xhci-trace.h
@@ -453,6 +453,29 @@
  	TP_PROTO(struct xhci_ring *ring),
  	TP_ARGS(ring)
  );
+
+DECLARE_EVENT_CLASS(xhci_log_portsc,
+		    TP_PROTO(u32 portnum, u32 portsc),
+		    TP_ARGS(portnum, portsc),
+		    TP_STRUCT__entry(
+				     __field(u32, portnum)
+				     __field(u32, portsc)
+				     ),
+		    TP_fast_assign(
+				   __entry->portnum = portnum;
+				   __entry->portsc = portsc;
+				   ),
+		    TP_printk("port-%d: %s",

this will give you "port-0" for a USB3 and USB2 roothub. How are you
going to differentiate between the two in a long trace?

you could pass hcd to the tracer, and extract hcd->speed to print out
something like "usb2-port-0: %s".


Seems like an improvement that could be done, but unless there is anything else
that needs fixing in this series I'd prefer to not respin/retest it this late
in the rc

-Mathias

-Mathas
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux