2017-11-03 18:28:30 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2014-05-01 06:45:10 +08:00
|
|
|
/**
|
|
|
|
* trace.h - DesignWare USB3 DRD Controller Trace Support
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com
|
|
|
|
*
|
|
|
|
* Author: Felipe Balbi <balbi@ti.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#undef TRACE_SYSTEM
|
|
|
|
#define TRACE_SYSTEM dwc3
|
|
|
|
|
|
|
|
#if !defined(__DWC3_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
|
|
#define __DWC3_TRACE_H
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/tracepoint.h>
|
|
|
|
#include <asm/byteorder.h>
|
|
|
|
#include "core.h"
|
|
|
|
#include "debug.h"
|
|
|
|
|
2016-09-30 20:52:19 +08:00
|
|
|
DECLARE_EVENT_CLASS(dwc3_log_io,
|
|
|
|
TP_PROTO(void *base, u32 offset, u32 value),
|
|
|
|
TP_ARGS(base, offset, value),
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(void *, base)
|
|
|
|
__field(u32, offset)
|
|
|
|
__field(u32, value)
|
|
|
|
),
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->base = base;
|
|
|
|
__entry->offset = offset;
|
|
|
|
__entry->value = value;
|
|
|
|
),
|
|
|
|
TP_printk("addr %p value %08x", __entry->base + __entry->offset,
|
|
|
|
__entry->value)
|
2015-01-28 03:47:02 +08:00
|
|
|
);
|
|
|
|
|
2016-09-30 20:52:19 +08:00
|
|
|
DEFINE_EVENT(dwc3_log_io, dwc3_readl,
|
2017-12-01 08:16:31 +08:00
|
|
|
TP_PROTO(void __iomem *base, u32 offset, u32 value),
|
2016-09-30 20:52:19 +08:00
|
|
|
TP_ARGS(base, offset, value)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(dwc3_log_io, dwc3_writel,
|
2017-12-01 08:16:31 +08:00
|
|
|
TP_PROTO(void __iomem *base, u32 offset, u32 value),
|
2016-09-30 20:52:19 +08:00
|
|
|
TP_ARGS(base, offset, value)
|
2014-05-01 06:45:10 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(dwc3_log_event,
|
2016-09-26 18:23:34 +08:00
|
|
|
TP_PROTO(u32 event, struct dwc3 *dwc),
|
|
|
|
TP_ARGS(event, dwc),
|
2014-05-01 06:45:10 +08:00
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(u32, event)
|
2016-09-26 18:23:34 +08:00
|
|
|
__field(u32, ep0state)
|
2017-04-28 16:28:35 +08:00
|
|
|
__dynamic_array(char, str, DWC3_MSG_MAX)
|
2014-05-01 06:45:10 +08:00
|
|
|
),
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->event = event;
|
2016-09-26 18:23:34 +08:00
|
|
|
__entry->ep0state = dwc->ep0state;
|
2014-05-01 06:45:10 +08:00
|
|
|
),
|
2016-05-23 16:10:08 +08:00
|
|
|
TP_printk("event (%08x): %s", __entry->event,
|
2017-04-28 16:28:35 +08:00
|
|
|
dwc3_decode_event(__get_str(str), __entry->event,
|
|
|
|
__entry->ep0state))
|
2014-05-01 06:45:10 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(dwc3_log_event, dwc3_event,
|
2016-09-26 18:23:34 +08:00
|
|
|
TP_PROTO(u32 event, struct dwc3 *dwc),
|
|
|
|
TP_ARGS(event, dwc)
|
2014-05-01 06:45:10 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(dwc3_log_ctrl,
|
|
|
|
TP_PROTO(struct usb_ctrlrequest *ctrl),
|
|
|
|
TP_ARGS(ctrl),
|
|
|
|
TP_STRUCT__entry(
|
2014-09-18 05:28:38 +08:00
|
|
|
__field(__u8, bRequestType)
|
|
|
|
__field(__u8, bRequest)
|
2016-05-24 02:32:47 +08:00
|
|
|
__field(__u16, wValue)
|
|
|
|
__field(__u16, wIndex)
|
|
|
|
__field(__u16, wLength)
|
usb: dwc3: trace: decode ctrl request
Instead of *always* dumping raw ctrl bytes, let's decode standard
requests which will make the lives of those debugging DWC3 quite a bit
easier.
Output will now look like so:
irq/34-dwc3-1594 [000] d..1 107.573081: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
irq/34-dwc3-1594 [000] d..1 107.573694: dwc3_ctrl_req: Set Address(Addr = 01)
irq/34-dwc3-1594 [000] d..1 107.588319: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
irq/34-dwc3-1594 [000] d..1 107.588816: dwc3_ctrl_req: Get Configuration Descriptor(Index = 0, Length = 9)
irq/34-dwc3-1594 [000] d..1 107.589191: dwc3_ctrl_req: Set Configuration(Config = 3)
irq/34-dwc3-1594 [000] d..1 107.589846: dwc3_ctrl_req: Get BOS Descriptor(Index = 0, Length = 5)
irq/34-dwc3-1594 [000] d..1 107.590146: dwc3_ctrl_req: Get BOS Descriptor(Index = 0, Length = 22)
irq/34-dwc3-1594 [000] d..1 107.590546: dwc3_ctrl_req: Get Configuration Descriptor(Index = 0, Length = 9)
irq/34-dwc3-1594 [000] d..1 107.590840: dwc3_ctrl_req: Get Configuration Descriptor(Index = 0, Length = 69)
irq/34-dwc3-1594 [000] d..1 107.591138: dwc3_ctrl_req: Get Configuration Descriptor(Index = 1, Length = 9)
irq/34-dwc3-1594 [000] d..1 107.591541: dwc3_ctrl_req: Get Configuration Descriptor(Index = 1, Length = 32)
irq/34-dwc3-1594 [000] d..1 107.591834: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
irq/34-dwc3-1594 [000] d..1 114.701005: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
irq/34-dwc3-1594 [000] d..1 114.721080: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
irq/34-dwc3-1594 [000] d..1 114.722709: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
irq/34-dwc3-1594 [000] d..1 114.728979: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
irq/34-dwc3-1594 [000] d..1 114.730544: dwc3_ctrl_req: Get Device Qualifier Descriptor(Index = 0, Length = 10)
irq/34-dwc3-1594 [000] d..1 115.776018: dwc3_ctrl_req: Get Configuration Descriptor(Index = 0, Length = 9)
irq/34-dwc3-1594 [000] d..1 115.776760: dwc3_ctrl_req: Set Configuration(Config = 0)
irq/34-dwc3-1594 [000] d..1 115.777676: dwc3_ctrl_req: Get Configuration(Length = 1)
irq/34-dwc3-1594 [000] d..1 115.924797: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
irq/34-dwc3-1594 [000] d..1 115.929025: dwc3_ctrl_req: Get String Descriptor(Index = 0, Length = 500)
irq/34-dwc3-1594 [000] d..1 115.929566: dwc3_ctrl_req: Get String Descriptor(Index = 1, Length = 500)
irq/34-dwc3-1594 [000] d..1 115.930911: dwc3_ctrl_req: Get String Descriptor(Index = 0, Length = 500)
irq/34-dwc3-1594 [000] d..1 115.931528: dwc3_ctrl_req: Get String Descriptor(Index = 2, Length = 500)
irq/34-dwc3-1594 [000] d..1 115.932950: dwc3_ctrl_req: Get String Descriptor(Index = 0, Length = 500)
irq/34-dwc3-1594 [000] d..1 115.933533: dwc3_ctrl_req: Get String Descriptor(Index = 3, Length = 500)
Note that Class and Vendor requests won't be decoded for obvious
reasons. Those will be printed as a raw sequence of bytes.
This patch has been tested against a normal host (both Linux and
Windows) and USB30CV Chapter 9 tests.
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2017-04-26 21:09:09 +08:00
|
|
|
__dynamic_array(char, str, DWC3_MSG_MAX)
|
2014-05-01 06:45:10 +08:00
|
|
|
),
|
|
|
|
TP_fast_assign(
|
2014-09-18 05:28:38 +08:00
|
|
|
__entry->bRequestType = ctrl->bRequestType;
|
|
|
|
__entry->bRequest = ctrl->bRequest;
|
2016-05-24 02:32:47 +08:00
|
|
|
__entry->wValue = le16_to_cpu(ctrl->wValue);
|
|
|
|
__entry->wIndex = le16_to_cpu(ctrl->wIndex);
|
|
|
|
__entry->wLength = le16_to_cpu(ctrl->wLength);
|
2014-05-01 06:45:10 +08:00
|
|
|
),
|
usb: dwc3: trace: decode ctrl request
Instead of *always* dumping raw ctrl bytes, let's decode standard
requests which will make the lives of those debugging DWC3 quite a bit
easier.
Output will now look like so:
irq/34-dwc3-1594 [000] d..1 107.573081: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
irq/34-dwc3-1594 [000] d..1 107.573694: dwc3_ctrl_req: Set Address(Addr = 01)
irq/34-dwc3-1594 [000] d..1 107.588319: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
irq/34-dwc3-1594 [000] d..1 107.588816: dwc3_ctrl_req: Get Configuration Descriptor(Index = 0, Length = 9)
irq/34-dwc3-1594 [000] d..1 107.589191: dwc3_ctrl_req: Set Configuration(Config = 3)
irq/34-dwc3-1594 [000] d..1 107.589846: dwc3_ctrl_req: Get BOS Descriptor(Index = 0, Length = 5)
irq/34-dwc3-1594 [000] d..1 107.590146: dwc3_ctrl_req: Get BOS Descriptor(Index = 0, Length = 22)
irq/34-dwc3-1594 [000] d..1 107.590546: dwc3_ctrl_req: Get Configuration Descriptor(Index = 0, Length = 9)
irq/34-dwc3-1594 [000] d..1 107.590840: dwc3_ctrl_req: Get Configuration Descriptor(Index = 0, Length = 69)
irq/34-dwc3-1594 [000] d..1 107.591138: dwc3_ctrl_req: Get Configuration Descriptor(Index = 1, Length = 9)
irq/34-dwc3-1594 [000] d..1 107.591541: dwc3_ctrl_req: Get Configuration Descriptor(Index = 1, Length = 32)
irq/34-dwc3-1594 [000] d..1 107.591834: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
irq/34-dwc3-1594 [000] d..1 114.701005: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
irq/34-dwc3-1594 [000] d..1 114.721080: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
irq/34-dwc3-1594 [000] d..1 114.722709: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
irq/34-dwc3-1594 [000] d..1 114.728979: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
irq/34-dwc3-1594 [000] d..1 114.730544: dwc3_ctrl_req: Get Device Qualifier Descriptor(Index = 0, Length = 10)
irq/34-dwc3-1594 [000] d..1 115.776018: dwc3_ctrl_req: Get Configuration Descriptor(Index = 0, Length = 9)
irq/34-dwc3-1594 [000] d..1 115.776760: dwc3_ctrl_req: Set Configuration(Config = 0)
irq/34-dwc3-1594 [000] d..1 115.777676: dwc3_ctrl_req: Get Configuration(Length = 1)
irq/34-dwc3-1594 [000] d..1 115.924797: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
irq/34-dwc3-1594 [000] d..1 115.929025: dwc3_ctrl_req: Get String Descriptor(Index = 0, Length = 500)
irq/34-dwc3-1594 [000] d..1 115.929566: dwc3_ctrl_req: Get String Descriptor(Index = 1, Length = 500)
irq/34-dwc3-1594 [000] d..1 115.930911: dwc3_ctrl_req: Get String Descriptor(Index = 0, Length = 500)
irq/34-dwc3-1594 [000] d..1 115.931528: dwc3_ctrl_req: Get String Descriptor(Index = 2, Length = 500)
irq/34-dwc3-1594 [000] d..1 115.932950: dwc3_ctrl_req: Get String Descriptor(Index = 0, Length = 500)
irq/34-dwc3-1594 [000] d..1 115.933533: dwc3_ctrl_req: Get String Descriptor(Index = 3, Length = 500)
Note that Class and Vendor requests won't be decoded for obvious
reasons. Those will be printed as a raw sequence of bytes.
This patch has been tested against a normal host (both Linux and
Windows) and USB30CV Chapter 9 tests.
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2017-04-26 21:09:09 +08:00
|
|
|
TP_printk("%s", dwc3_decode_ctrl(__get_str(str), __entry->bRequestType,
|
|
|
|
__entry->bRequest, __entry->wValue,
|
|
|
|
__entry->wIndex, __entry->wLength)
|
2014-05-01 06:45:10 +08:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(dwc3_log_ctrl, dwc3_ctrl_req,
|
|
|
|
TP_PROTO(struct usb_ctrlrequest *ctrl),
|
|
|
|
TP_ARGS(ctrl)
|
|
|
|
);
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(dwc3_log_request,
|
|
|
|
TP_PROTO(struct dwc3_request *req),
|
|
|
|
TP_ARGS(req),
|
|
|
|
TP_STRUCT__entry(
|
2017-04-28 17:54:52 +08:00
|
|
|
__string(name, req->dep->name)
|
2014-05-01 06:45:10 +08:00
|
|
|
__field(struct dwc3_request *, req)
|
2014-09-18 05:28:38 +08:00
|
|
|
__field(unsigned, actual)
|
|
|
|
__field(unsigned, length)
|
|
|
|
__field(int, status)
|
2015-12-04 05:27:32 +08:00
|
|
|
__field(int, zero)
|
|
|
|
__field(int, short_not_ok)
|
|
|
|
__field(int, no_interrupt)
|
2014-05-01 06:45:10 +08:00
|
|
|
),
|
|
|
|
TP_fast_assign(
|
2017-04-28 17:54:52 +08:00
|
|
|
__assign_str(name, req->dep->name);
|
2014-05-01 06:45:10 +08:00
|
|
|
__entry->req = req;
|
2014-09-18 05:28:38 +08:00
|
|
|
__entry->actual = req->request.actual;
|
|
|
|
__entry->length = req->request.length;
|
|
|
|
__entry->status = req->request.status;
|
2015-12-04 05:27:32 +08:00
|
|
|
__entry->zero = req->request.zero;
|
|
|
|
__entry->short_not_ok = req->request.short_not_ok;
|
|
|
|
__entry->no_interrupt = req->request.no_interrupt;
|
2014-05-01 06:45:10 +08:00
|
|
|
),
|
2015-12-04 05:27:32 +08:00
|
|
|
TP_printk("%s: req %p length %u/%u %s%s%s ==> %d",
|
2014-09-18 05:28:38 +08:00
|
|
|
__get_str(name), __entry->req, __entry->actual, __entry->length,
|
2015-12-04 05:27:32 +08:00
|
|
|
__entry->zero ? "Z" : "z",
|
|
|
|
__entry->short_not_ok ? "S" : "s",
|
|
|
|
__entry->no_interrupt ? "i" : "I",
|
2014-09-18 05:28:38 +08:00
|
|
|
__entry->status
|
2014-05-01 06:45:10 +08:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(dwc3_log_request, dwc3_alloc_request,
|
|
|
|
TP_PROTO(struct dwc3_request *req),
|
|
|
|
TP_ARGS(req)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(dwc3_log_request, dwc3_free_request,
|
|
|
|
TP_PROTO(struct dwc3_request *req),
|
|
|
|
TP_ARGS(req)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(dwc3_log_request, dwc3_ep_queue,
|
|
|
|
TP_PROTO(struct dwc3_request *req),
|
|
|
|
TP_ARGS(req)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(dwc3_log_request, dwc3_ep_dequeue,
|
|
|
|
TP_PROTO(struct dwc3_request *req),
|
|
|
|
TP_ARGS(req)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(dwc3_log_request, dwc3_gadget_giveback,
|
|
|
|
TP_PROTO(struct dwc3_request *req),
|
|
|
|
TP_ARGS(req)
|
|
|
|
);
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(dwc3_log_generic_cmd,
|
2016-05-23 19:16:19 +08:00
|
|
|
TP_PROTO(unsigned int cmd, u32 param, int status),
|
|
|
|
TP_ARGS(cmd, param, status),
|
2014-05-01 06:45:10 +08:00
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned int, cmd)
|
|
|
|
__field(u32, param)
|
2016-05-23 19:16:19 +08:00
|
|
|
__field(int, status)
|
2014-05-01 06:45:10 +08:00
|
|
|
),
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->cmd = cmd;
|
|
|
|
__entry->param = param;
|
2016-05-23 19:16:19 +08:00
|
|
|
__entry->status = status;
|
2014-05-01 06:45:10 +08:00
|
|
|
),
|
2017-03-22 19:03:13 +08:00
|
|
|
TP_printk("cmd '%s' [%x] param %08x --> status: %s",
|
2014-05-01 06:45:10 +08:00
|
|
|
dwc3_gadget_generic_cmd_string(__entry->cmd),
|
2016-05-23 19:16:19 +08:00
|
|
|
__entry->cmd, __entry->param,
|
|
|
|
dwc3_gadget_generic_cmd_status_string(__entry->status)
|
2014-05-01 06:45:10 +08:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(dwc3_log_generic_cmd, dwc3_gadget_generic_cmd,
|
2016-05-23 19:16:19 +08:00
|
|
|
TP_PROTO(unsigned int cmd, u32 param, int status),
|
|
|
|
TP_ARGS(cmd, param, status)
|
2014-05-01 06:45:10 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(dwc3_log_gadget_ep_cmd,
|
|
|
|
TP_PROTO(struct dwc3_ep *dep, unsigned int cmd,
|
2016-05-23 19:02:33 +08:00
|
|
|
struct dwc3_gadget_ep_cmd_params *params, int cmd_status),
|
|
|
|
TP_ARGS(dep, cmd, params, cmd_status),
|
2014-05-01 06:45:10 +08:00
|
|
|
TP_STRUCT__entry(
|
2017-04-28 17:54:52 +08:00
|
|
|
__string(name, dep->name)
|
2014-05-01 06:45:10 +08:00
|
|
|
__field(unsigned int, cmd)
|
2014-11-21 00:12:32 +08:00
|
|
|
__field(u32, param0)
|
|
|
|
__field(u32, param1)
|
|
|
|
__field(u32, param2)
|
2016-05-23 19:02:33 +08:00
|
|
|
__field(int, cmd_status)
|
2014-05-01 06:45:10 +08:00
|
|
|
),
|
|
|
|
TP_fast_assign(
|
2017-04-28 17:54:52 +08:00
|
|
|
__assign_str(name, dep->name);
|
2014-05-01 06:45:10 +08:00
|
|
|
__entry->cmd = cmd;
|
2014-11-21 00:12:32 +08:00
|
|
|
__entry->param0 = params->param0;
|
|
|
|
__entry->param1 = params->param1;
|
|
|
|
__entry->param2 = params->param2;
|
2016-05-23 19:02:33 +08:00
|
|
|
__entry->cmd_status = cmd_status;
|
2014-05-01 06:45:10 +08:00
|
|
|
),
|
2018-08-15 13:30:59 +08:00
|
|
|
TP_printk("%s: cmd '%s' [%x] params %08x %08x %08x --> status: %s",
|
2014-09-18 05:28:38 +08:00
|
|
|
__get_str(name), dwc3_gadget_ep_cmd_string(__entry->cmd),
|
2014-11-21 00:12:32 +08:00
|
|
|
__entry->cmd, __entry->param0,
|
2016-05-23 19:02:33 +08:00
|
|
|
__entry->param1, __entry->param2,
|
|
|
|
dwc3_ep_cmd_status_string(__entry->cmd_status)
|
2014-05-01 06:45:10 +08:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(dwc3_log_gadget_ep_cmd, dwc3_gadget_ep_cmd,
|
|
|
|
TP_PROTO(struct dwc3_ep *dep, unsigned int cmd,
|
2016-05-23 19:02:33 +08:00
|
|
|
struct dwc3_gadget_ep_cmd_params *params, int cmd_status),
|
|
|
|
TP_ARGS(dep, cmd, params, cmd_status)
|
2014-05-01 06:45:10 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(dwc3_log_trb,
|
|
|
|
TP_PROTO(struct dwc3_ep *dep, struct dwc3_trb *trb),
|
|
|
|
TP_ARGS(dep, trb),
|
|
|
|
TP_STRUCT__entry(
|
2017-04-28 17:54:52 +08:00
|
|
|
__string(name, dep->name)
|
2014-05-01 06:45:10 +08:00
|
|
|
__field(struct dwc3_trb *, trb)
|
2016-05-30 18:34:58 +08:00
|
|
|
__field(u32, allocated)
|
|
|
|
__field(u32, queued)
|
2014-09-18 05:28:38 +08:00
|
|
|
__field(u32, bpl)
|
|
|
|
__field(u32, bph)
|
|
|
|
__field(u32, size)
|
|
|
|
__field(u32, ctrl)
|
2016-09-28 19:58:33 +08:00
|
|
|
__field(u32, type)
|
2014-05-01 06:45:10 +08:00
|
|
|
),
|
|
|
|
TP_fast_assign(
|
2017-04-28 17:54:52 +08:00
|
|
|
__assign_str(name, dep->name);
|
2014-05-01 06:45:10 +08:00
|
|
|
__entry->trb = trb;
|
2014-09-18 05:28:38 +08:00
|
|
|
__entry->bpl = trb->bpl;
|
|
|
|
__entry->bph = trb->bph;
|
|
|
|
__entry->size = trb->size;
|
|
|
|
__entry->ctrl = trb->ctrl;
|
2016-09-28 19:58:33 +08:00
|
|
|
__entry->type = usb_endpoint_type(dep->endpoint.desc);
|
2014-05-01 06:45:10 +08:00
|
|
|
),
|
2018-03-26 21:09:00 +08:00
|
|
|
TP_printk("%s: trb %p buf %08x%08x size %s%d ctrl %08x (%c%c%c%c:%c%c:%s)",
|
|
|
|
__get_str(name), __entry->trb, __entry->bph, __entry->bpl,
|
2016-09-28 19:58:33 +08:00
|
|
|
({char *s;
|
|
|
|
int pcm = ((__entry->size >> 24) & 3) + 1;
|
|
|
|
switch (__entry->type) {
|
|
|
|
case USB_ENDPOINT_XFER_INT:
|
|
|
|
case USB_ENDPOINT_XFER_ISOC:
|
|
|
|
switch (pcm) {
|
|
|
|
case 1:
|
|
|
|
s = "1x ";
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
s = "2x ";
|
|
|
|
break;
|
|
|
|
case 3:
|
2018-12-03 17:28:47 +08:00
|
|
|
default:
|
2016-09-28 19:58:33 +08:00
|
|
|
s = "3x ";
|
|
|
|
break;
|
|
|
|
}
|
2018-12-03 17:28:47 +08:00
|
|
|
break;
|
2016-09-28 19:58:33 +08:00
|
|
|
default:
|
|
|
|
s = "";
|
|
|
|
} s; }),
|
|
|
|
DWC3_TRB_SIZE_LENGTH(__entry->size), __entry->ctrl,
|
2016-05-20 16:37:13 +08:00
|
|
|
__entry->ctrl & DWC3_TRB_CTRL_HWO ? 'H' : 'h',
|
|
|
|
__entry->ctrl & DWC3_TRB_CTRL_LST ? 'L' : 'l',
|
|
|
|
__entry->ctrl & DWC3_TRB_CTRL_CHN ? 'C' : 'c',
|
|
|
|
__entry->ctrl & DWC3_TRB_CTRL_CSP ? 'S' : 's',
|
|
|
|
__entry->ctrl & DWC3_TRB_CTRL_ISP_IMI ? 'S' : 's',
|
|
|
|
__entry->ctrl & DWC3_TRB_CTRL_IOC ? 'C' : 'c',
|
2017-03-31 19:44:09 +08:00
|
|
|
dwc3_trb_type_string(DWC3_TRBCTL_TYPE(__entry->ctrl))
|
2014-05-01 06:45:10 +08:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(dwc3_log_trb, dwc3_prepare_trb,
|
|
|
|
TP_PROTO(struct dwc3_ep *dep, struct dwc3_trb *trb),
|
|
|
|
TP_ARGS(dep, trb)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(dwc3_log_trb, dwc3_complete_trb,
|
|
|
|
TP_PROTO(struct dwc3_ep *dep, struct dwc3_trb *trb),
|
|
|
|
TP_ARGS(dep, trb)
|
|
|
|
);
|
|
|
|
|
2016-11-03 19:53:29 +08:00
|
|
|
DECLARE_EVENT_CLASS(dwc3_log_ep,
|
|
|
|
TP_PROTO(struct dwc3_ep *dep),
|
|
|
|
TP_ARGS(dep),
|
|
|
|
TP_STRUCT__entry(
|
2017-04-28 17:54:52 +08:00
|
|
|
__string(name, dep->name)
|
2016-11-03 19:53:29 +08:00
|
|
|
__field(unsigned, maxpacket)
|
|
|
|
__field(unsigned, maxpacket_limit)
|
|
|
|
__field(unsigned, max_streams)
|
|
|
|
__field(unsigned, maxburst)
|
|
|
|
__field(unsigned, flags)
|
|
|
|
__field(unsigned, direction)
|
|
|
|
__field(u8, trb_enqueue)
|
|
|
|
__field(u8, trb_dequeue)
|
|
|
|
),
|
|
|
|
TP_fast_assign(
|
2017-04-28 17:54:52 +08:00
|
|
|
__assign_str(name, dep->name);
|
2016-11-03 19:53:29 +08:00
|
|
|
__entry->maxpacket = dep->endpoint.maxpacket;
|
|
|
|
__entry->maxpacket_limit = dep->endpoint.maxpacket_limit;
|
|
|
|
__entry->max_streams = dep->endpoint.max_streams;
|
|
|
|
__entry->maxburst = dep->endpoint.maxburst;
|
|
|
|
__entry->flags = dep->flags;
|
|
|
|
__entry->direction = dep->direction;
|
|
|
|
__entry->trb_enqueue = dep->trb_enqueue;
|
|
|
|
__entry->trb_dequeue = dep->trb_dequeue;
|
|
|
|
),
|
2019-01-21 19:08:44 +08:00
|
|
|
TP_printk("%s: mps %d/%d streams %d burst %d ring %d/%d flags %c:%c%c%c%c:%c",
|
2016-11-03 19:53:29 +08:00
|
|
|
__get_str(name), __entry->maxpacket,
|
|
|
|
__entry->maxpacket_limit, __entry->max_streams,
|
|
|
|
__entry->maxburst, __entry->trb_enqueue,
|
|
|
|
__entry->trb_dequeue,
|
|
|
|
__entry->flags & DWC3_EP_ENABLED ? 'E' : 'e',
|
|
|
|
__entry->flags & DWC3_EP_STALL ? 'S' : 's',
|
|
|
|
__entry->flags & DWC3_EP_WEDGE ? 'W' : 'w',
|
2018-03-29 16:10:45 +08:00
|
|
|
__entry->flags & DWC3_EP_TRANSFER_STARTED ? 'B' : 'b',
|
2016-11-03 19:53:29 +08:00
|
|
|
__entry->flags & DWC3_EP_PENDING_REQUEST ? 'P' : 'p',
|
|
|
|
__entry->direction ? '<' : '>'
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(dwc3_log_ep, dwc3_gadget_ep_enable,
|
|
|
|
TP_PROTO(struct dwc3_ep *dep),
|
|
|
|
TP_ARGS(dep)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(dwc3_log_ep, dwc3_gadget_ep_disable,
|
|
|
|
TP_PROTO(struct dwc3_ep *dep),
|
|
|
|
TP_ARGS(dep)
|
|
|
|
);
|
|
|
|
|
2014-05-01 06:45:10 +08:00
|
|
|
#endif /* __DWC3_TRACE_H */
|
|
|
|
|
|
|
|
/* this part has to be here */
|
|
|
|
|
|
|
|
#undef TRACE_INCLUDE_PATH
|
|
|
|
#define TRACE_INCLUDE_PATH .
|
|
|
|
|
|
|
|
#undef TRACE_INCLUDE_FILE
|
|
|
|
#define TRACE_INCLUDE_FILE trace
|
|
|
|
|
|
|
|
#include <trace/define_trace.h>
|