2 * xHCI host controller driver
4 * Copyright (C) 2013 Xenia Ragiadakou
6 * Author: Xenia Ragiadakou
7 * Email : burzalodowa@gmail.com
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
15 #define TRACE_SYSTEM xhci-hcd
17 #if !defined(__XHCI_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
18 #define __XHCI_TRACE_H
20 #include <linux/tracepoint.h>
23 #define XHCI_MSG_MAX 500
25 DECLARE_EVENT_CLASS(xhci_log_msg,
26 TP_PROTO(struct va_format *vaf),
28 TP_STRUCT__entry(__dynamic_array(char, msg, XHCI_MSG_MAX)),
30 vsnprintf(__get_str(msg), XHCI_MSG_MAX, vaf->fmt, *vaf->va);
32 TP_printk("%s", __get_str(msg))
35 DEFINE_EVENT(xhci_log_msg, xhci_dbg_address,
36 TP_PROTO(struct va_format *vaf),
40 DEFINE_EVENT(xhci_log_msg, xhci_dbg_context_change,
41 TP_PROTO(struct va_format *vaf),
45 DEFINE_EVENT(xhci_log_msg, xhci_dbg_quirks,
46 TP_PROTO(struct va_format *vaf),
50 DEFINE_EVENT(xhci_log_msg, xhci_dbg_reset_ep,
51 TP_PROTO(struct va_format *vaf),
55 DECLARE_EVENT_CLASS(xhci_log_ctx,
56 TP_PROTO(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx,
58 TP_ARGS(xhci, ctx, ep_num),
61 __field(unsigned, ctx_type)
62 __field(dma_addr_t, ctx_dma)
64 __field(unsigned, ctx_ep_num)
66 __dynamic_array(u32, ctx_data,
67 ((HCC_64BYTE_CONTEXT(xhci->hcc_params) + 1) * 8) *
68 ((ctx->type == XHCI_CTX_TYPE_INPUT) + ep_num + 1))
71 struct usb_device *udev;
73 udev = to_usb_device(xhci_to_hcd(xhci)->self.controller);
74 __entry->ctx_64 = HCC_64BYTE_CONTEXT(xhci->hcc_params);
75 __entry->ctx_type = ctx->type;
76 __entry->ctx_dma = ctx->dma;
77 __entry->ctx_va = ctx->bytes;
78 __entry->slot_id = udev->slot_id;
79 __entry->ctx_ep_num = ep_num;
80 memcpy(__get_dynamic_array(ctx_data), ctx->bytes,
81 ((HCC_64BYTE_CONTEXT(xhci->hcc_params) + 1) * 32) *
82 ((ctx->type == XHCI_CTX_TYPE_INPUT) + ep_num + 1));
84 TP_printk("\nctx_64=%d, ctx_type=%u, ctx_dma=@%llx, ctx_va=@%p",
85 __entry->ctx_64, __entry->ctx_type,
86 (unsigned long long) __entry->ctx_dma, __entry->ctx_va
90 DEFINE_EVENT(xhci_log_ctx, xhci_address_ctx,
91 TP_PROTO(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx,
93 TP_ARGS(xhci, ctx, ep_num)
96 #endif /* __XHCI_TRACE_H */
98 /* this part must be outside header guard */
100 #undef TRACE_INCLUDE_PATH
101 #define TRACE_INCLUDE_PATH .
103 #undef TRACE_INCLUDE_FILE
104 #define TRACE_INCLUDE_FILE xhci-trace
106 #include <trace/define_trace.h>