[PATCH] gadget event trace : add request pointer

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

 



This allow to identify transfert request, if more than one are in queue.

This is allowed by usb_ep_queue : "Any endpoint
(except control endpoints like ep0) may have more than one transfer
request queued; they complete in FIFO order."

For example with adb gadget with function fs :

[00:59:36.655980]      <-transport-223   [002] d..1   112.529723: usb_ep_queue: ep1out: req[ffffffc07cbab610] length 0/24 sgs 0/0 stream 0 zsI status -115 --> 0
[00:59:36.672086]           <idle>-0     [000] d.h1   112.600725: usb_gadget_giveback_request: ep1out: req[ffffffc07cbab610] length 24/24 sgs 0/0 stream 0 zsI status 0 --> 0
[00:59:36.688087]      <-transport-223   [002] d..1   112.600878: usb_ep_queue: ep1out: req[ffffffc07cbab610] length 0/6 sgs 0/0 stream 0 zsI status -115 --> 0
[00:59:36.704085]           <idle>-0     [000] d.h1   112.600918: usb_gadget_giveback_request: ep1out: req[ffffffc07cbab610] length 6/6 sgs 0/0 stream 0 zsI status 0 --> 0
[00:59:36.704090]      <-transport-223   [002] d..1   112.600994: usb_ep_queue: ep1out: req[ffffffc07cbab610] length 0/24 sgs 0/0 stream 0 zsI status -115 --> 0
[00:59:36.720080]      ->transport-222   [002] d..1   112.601150: usb_ep_queue: ep1in: req[ffffffc07c234710] length 0/24 sgs 0/0 stream 0 zsI status -115 --> 0
[00:59:36.736087]           <idle>-0     [000] d.h1   112.601171: usb_gadget_giveback_request: ep1in: req[ffffffc07c234710] length 24/24 sgs 0/0 stream 0 zsI status 0 --> 0
[00:59:36.752082]      ->transport-222   [002] d..1   112.602262: usb_ep_queue: ep1in: req[ffffffc07c234710] length 0/24 sgs 0/0 stream 0 zsI status -115 --> 0
[00:59:36.768084]               sh-448   [000] dnh1   112.602300: usb_gadget_giveback_request: ep1in: req[ffffffc07c234710] length 24/24 sgs 0/0 stream 0 zsI status 0 --> 0
[00:59:36.784082]      ->transport-222   [002] d..1   112.602331: usb_ep_queue: ep1in: req[ffffffc07c234710] length 0/7 sgs 0/0 stream 0 zsI status -115 --> 0
[00:59:36.784088]               ls-452   [000] d.h1   112.602411: usb_gadget_giveback_request: ep1in: req[ffffffc07c234710] length 7/7 sgs 0/0 stream 0 zsI status 0 --> 0
[00:59:36.800117]               ls-452   [000] d.h1   112.602721: usb_gadget_giveback_request: ep1out: req[ffffffc07cbab610] length 24/24 sgs 0/0 stream 0 zsI status 0 --> 0

Signed-off-by: Matthieu CASTET <matthieu.castet@xxxxxxxxxx>
---
 drivers/usb/gadget/udc/trace.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/udc/trace.h b/drivers/usb/gadget/udc/trace.h
index f07ddb3f4bb9..99feb4a07e20 100644
--- a/drivers/usb/gadget/udc/trace.h
+++ b/drivers/usb/gadget/udc/trace.h
@@ -225,6 +225,7 @@ DECLARE_EVENT_CLASS(udc_log_req,
 		__field(unsigned, short_not_ok)
 		__field(int, status)
 		__field(int, ret)
+		__field(struct usb_request *, req)
 	),
 	TP_fast_assign(
 		snprintf(__get_str(name), UDC_TRACE_STR_MAX, "%s", ep->name);
@@ -238,9 +239,10 @@ DECLARE_EVENT_CLASS(udc_log_req,
 		__entry->short_not_ok = req->short_not_ok;
 		__entry->status = req->status;
 		__entry->ret = ret;
+		__entry->req = req;
 	),
-	TP_printk("%s: length %d/%d sgs %d/%d stream %d %s%s%s status %d --> %d",
-		__get_str(name), __entry->actual, __entry->length,
+	TP_printk("%s: req[%p] length %d/%d sgs %d/%d stream %d %s%s%s status %d --> %d",
+		__get_str(name),__entry->req,  __entry->actual, __entry->length,
 		__entry->num_mapped_sgs, __entry->num_sgs, __entry->stream_id,
 		__entry->zero ? "Z" : "z",
 		__entry->short_not_ok ? "S" : "s",
-- 
2.15.0

--
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