From patchwork Tue Jul 3 19:57:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 10505107 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 80B0560225 for ; Tue, 3 Jul 2018 20:00:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FD2428C27 for ; Tue, 3 Jul 2018 20:00:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6374928CA4; Tue, 3 Jul 2018 20:00:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6333C28C27 for ; Tue, 3 Jul 2018 20:00:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752630AbeGCT7r (ORCPT ); Tue, 3 Jul 2018 15:59:47 -0400 Received: from mail-dm3nam03on0041.outbound.protection.outlook.com ([104.47.41.41]:23298 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753131AbeGCT6i (ORCPT ); Tue, 3 Jul 2018 15:58:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hig5zP/Crja7W2gdA1t1JA1o/Fohtd3bFBIV//M7m7s=; b=DLciV1As/YaybWs1haFnzxsZLUwLB4l2NAEeVjgvX9+ZUDSX0FgPu6d/DjgGsQonV8KUGVDdGatq60EDUhtWfNyvyyDSO/xBJ/HGdcEH88k0YCE5sWXCBPoqbMqQEtNU77Z17aIqU7jbGVyrc1FBcWumFRzVGGl9DGqNrrSqjvw= Received: from BY2PR07CA0087.namprd07.prod.outlook.com (2a01:111:e400:7bff::40) by DM6PR07MB4716.namprd07.prod.outlook.com (2603:10b6:5:a1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.20; Tue, 3 Jul 2018 19:58:30 +0000 Received: from DM3NAM05FT016.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::206) by BY2PR07CA0087.outlook.office365.com (2a01:111:e400:7bff::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.906.24 via Frontend Transport; Tue, 3 Jul 2018 19:58:30 +0000 Authentication-Results: spf=softfail (sender IP is 199.43.4.28) smtp.mailfrom=cadence.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=cadence.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning cadence.com discourages use of 199.43.4.28 as permitted sender) Received: from rmmaillnx1.cadence.com (199.43.4.28) by DM3NAM05FT016.mail.protection.outlook.com (10.152.98.125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.930.2 via Frontend Transport; Tue, 3 Jul 2018 19:58:29 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by rmmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id w63JwMs8006991 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Tue, 3 Jul 2018 15:58:28 -0400 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 3 Jul 2018 21:58:41 +0200 Received: from lvlogina.cadence.com (10.165.176.102) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 3 Jul 2018 21:58:41 +0200 Received: from lvlogina.cadence.com (localhost.localdomain [127.0.0.1]) by lvlogina.cadence.com (8.14.4/8.14.4) with ESMTP id w63JwOAr012325; Tue, 3 Jul 2018 20:58:24 +0100 Received: (from pawell@localhost) by lvlogina.cadence.com (8.14.4/8.14.4/Submit) id w63JwOHK012323; Tue, 3 Jul 2018 20:58:24 +0100 From: Pawel Laszczak To: Greg Kroah-Hartman , , Felipe Balbi CC: , , Subject: [PATCH 10/15] Introduce Cadence USBSSP DRD Driver - added trace files. Date: Tue, 3 Jul 2018 20:57:54 +0100 Message-ID: <1530647879-10007-11-git-send-email-pawell@cadence.com> X-Mailer: git-send-email 1.7.11.2 In-Reply-To: <1530647879-10007-1-git-send-email-pawell@cadence.com> References: <1530647879-10007-1-git-send-email-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:199.43.4.28; IPV:CAL; SCL:-1; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(396003)(39860400002)(2980300002)(189003)(199004)(36092001)(26005)(14444005)(186003)(51416003)(6666003)(4720700003)(5660300001)(26826003)(8676002)(68736007)(87636003)(478600001)(11346002)(446003)(336012)(426003)(69596002)(76176011)(50226002)(305945005)(48376002)(50466002)(356003)(47776003)(126002)(2906002)(106466001)(86362001)(8936002)(2616005)(81156014)(81166006)(476003)(316002)(107886003)(97736004)(54906003)(110136005)(36756003)(53936002)(105596002)(16586007)(486006)(4326008)(42186006)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB4716; H:rmmaillnx1.cadence.com; FPR:; SPF:SoftFail; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM05FT016; 1:IUNYL4MHX7vQeZMYfTxxHD/kiQh8E69pH4tjzHYxESwq1WUiBRA0jL1ifQUJTX1E0qCwOQOLR0Phiv4kfD/IeKJTeOCqU1kAX2wwP/cfasQ8Wo0JV6T175EneV6RjCJf X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6c0bfd79-69cc-4d9b-dcee-08d5e11f593a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600053)(711020)(2017052603328)(7153060); SRVR:DM6PR07MB4716; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4716; 3:oCyw89TNemR9nJIAwwzWv10R9EzgMuRv6AuzdKjAOHmG5G7IC8O6oUXxCzimypo6eK4QANBeMYfhu4JpNTCU5erQ09Gp31G9TNokZca6GO2zMEe4JmIZY55xj4LQ939AlZuTtHIk69p1BV3M6JRkbRP1/Ij6/q7/Q8YAWAr6Mjb2mm/lbeLWvT9eliFg35ry1DvFHbsZN/rAo1udqRIJgXdsxV2OL+yYmHSN55EeGzcbpikjcV5rYftJBYuC/ONqD3eJpwgW/3M7jf7wMyXlkzdNgAVCt9olLB9ZhF3b3w9u8V+omVvW2DuN3XmvY7vzFMh/eG+fN2m9PS0XsUyhlQ==; 25:gKvkmu8S36c/ZEPR+p3fizz4+kpYZZHUxK/SvM4ZBbob2hnaCy+wrxCD1nDKferi+121K2v1VN03GvgNNKxInzY+dJlDCc4bSonS0f87d8pc5AUUp2OSfrIy7YdbBJJnV/XDmiseSVC1fwYatGVcACZ4gldVdQzCat516oZn1L+3DALKPHjMHC5xujmqe0EbnkzEjPkx6kY1o9ANhO8cTUbyfe8uVA2k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SDzbbqZf7JJcyy8XV3OiBfRJo8NTBsybL/Bk3LQi9L8TKgUenWSNJT52QuB6Nxz/paSXzXKBvAqZtZbfrkohGDuCcoNh6XzCK/GhvXayudrzui5hoJOjJuB86Dk+fPwur021cs86u3ELHSeDPu+Ow/K7Q+LynCCmjh1NcoeT9U8cfpKW8jGewRpu X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(72806322054110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93003095)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:DM6PR07MB4716; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB4716; X-Forefront-PRVS: 0722981D2A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR07MB4716; 23:mb+0/FppoJO+XVARXVSXWPTC7+W9nzEJNJKoMPRO+?= =?us-ascii?Q?JNDNoiMeZ/cHEPcLExXlUCgOuQqVOIMXA5tj5P3z6WQc5pvx6d6rRNVmVRly?= =?us-ascii?Q?G7ILIk0wgJv5zdpAmVpoY4qm/d9ytQXXlgRuL8HOkdl+drYL5AIhqTGKPBne?= =?us-ascii?Q?Q2LPtKU7Cahb2CzCTIuCanmv8rPXDm+0I9ZoWrOk9xHYqkzIQJh8MPlShfTx?= =?us-ascii?Q?PmZej587YiFGqJnmbAOSFPWfH5iwKEgKuZJmrhpqO9dHD+QE9yK3vL7UK+Lu?= =?us-ascii?Q?I+0152YQNI9UDwhyoYu/eHWvIgJTJiKjYWYD8C1MCqvtkPPpk7fhxdQFQZUn?= =?us-ascii?Q?E+c4rBTpgSTbBtDeEVHYCruLTJ3CE0cAH5VpCewYrl6KFfkukLDPCm+BY5pn?=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QSE=; 24:x87HJ/hKZohjH/qVVolvGhgGszl8V89+l9k3kehuDJX6Im1VpoMu68DlLT3AdQus9z5xHozBXLNl+/YNhv0hH21TcuylDgUeH8gdKQkj4/s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4716; 7:6hE1ZOuYDLb8RsB9UnIKU6o4kIk6kJyrEgYyhC0YdjoPrxXOc2sgHZm8rfhcGDLAXHQFAnHWYak+rV+CwlV0N3XZKYyGV8Ne0pMDAWnaZRoLDJeP5F0KPtp4Yqb3ToM7dMaqMlx78cdDyyJWxIc/oKyJ1LRZK3/L4IIxEl660QZY8VetVzj257FYB339Vh9dnhY6bdgGaKw7fw2FM5JJvQMfFVzXI3qCPkFWjQXIja9y8epaitviliKJvvbvrfbC; 20:gGx1WulTMvmFP3ms4OdQM9YUUrLTe5OVYQWBRP2arBSpfsoUEK7fBsbzOko0s8jTxrb7LNW0ZGyOYB1jhkikWYEt2dy9i1GvV16poCYmcQMzpG+b4HsXzceVwRbj0/94E4ip+66P15A8JYNlsmno7G+z7YsKJhOh0xfi0DRaGEciKxHZQTkrs1Jl1WFkcXTwqtbLtcy4XuK7rFLQ9uHdNzt5vlUtO0WEZjZC3nwwwQS+Pq9kBwTJ6QQqOASm5yHt X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2018 19:58:29.7402 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c0bfd79-69cc-4d9b-dcee-08d5e11f593a X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9; Ip=[199.43.4.28]; Helo=[rmmaillnx1.cadence.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB4716 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Laszczak Pawel --- drivers/usb/usbssp/gadget-trace.c | 12 + drivers/usb/usbssp/gadget-trace.h | 505 ++++++++++++++++++++++++++++++ 2 files changed, 517 insertions(+) create mode 100644 drivers/usb/usbssp/gadget-trace.c create mode 100644 drivers/usb/usbssp/gadget-trace.h diff --git a/drivers/usb/usbssp/gadget-trace.c b/drivers/usb/usbssp/gadget-trace.c new file mode 100644 index 000000000000..6c8ef287d81b --- /dev/null +++ b/drivers/usb/usbssp/gadget-trace.c @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * USBSSP device controller driver + * + * Copyright (C) 2018 Cadence. + * + * Author: Pawel Laszczak + * Code borrowed from the Linux XHCI driver. + */ + +#define CREATE_TRACE_POINTS +#include "gadget-trace.h" diff --git a/drivers/usb/usbssp/gadget-trace.h b/drivers/usb/usbssp/gadget-trace.h new file mode 100644 index 000000000000..6adba591bade --- /dev/null +++ b/drivers/usb/usbssp/gadget-trace.h @@ -0,0 +1,505 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * USBSSP device controller driver + * + * Copyright (C) 2018 Cadence. + * + * Author: Pawel Laszczak + * Code borrowed from the Linux XHCI driver. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM usbssp-dev + +/* + * The TRACE_SYSTEM_VAR defaults to TRACE_SYSTEM, but must be a + * legitimate C variable. It is not exported to user space. + */ +#undef TRACE_SYSTEM_VAR +#define TRACE_SYSTEM_VAR usbssp_dev + +#if !defined(__USBSSP_DEV_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) +#define __USBSSP_DEV_TRACE_H + +#include +#include "gadget.h" + +#define USBSSP_DEV_MSG_MAX 500 + +DECLARE_EVENT_CLASS(usbssp_log_msg, + TP_PROTO(struct va_format *vaf), + TP_ARGS(vaf), + TP_STRUCT__entry(__dynamic_array(char, msg, USBSSP_DEV_MSG_MAX)), + TP_fast_assign( + vsnprintf(__get_str(msg), USBSSP_DEV_MSG_MAX, vaf->fmt, *vaf->va); + ), + TP_printk("%s", __get_str(msg)) +); + +DEFINE_EVENT(usbssp_log_msg, usbssp_dbg_address, + TP_PROTO(struct va_format *vaf), + TP_ARGS(vaf) +); + +DEFINE_EVENT(usbssp_log_msg, usbssp_dbg_context_change, + TP_PROTO(struct va_format *vaf), + TP_ARGS(vaf) +); + +DEFINE_EVENT(usbssp_log_msg, usbssp_dbg_quirks, + TP_PROTO(struct va_format *vaf), + TP_ARGS(vaf) +); + +DEFINE_EVENT(usbssp_log_msg, usbssp_dbg_reset_ep, + TP_PROTO(struct va_format *vaf), + TP_ARGS(vaf) +); + +DEFINE_EVENT(usbssp_log_msg, usbssp_dbg_cancel_request, + TP_PROTO(struct va_format *vaf), + TP_ARGS(vaf) +); + +DEFINE_EVENT(usbssp_log_msg, usbssp_dbg_init, + TP_PROTO(struct va_format *vaf), + TP_ARGS(vaf) +); + +DEFINE_EVENT(usbssp_log_msg, usbssp_dbg_ring_expansion, + TP_PROTO(struct va_format *vaf), + TP_ARGS(vaf) +); + +DECLARE_EVENT_CLASS(usbssp_log_ctx, + TP_PROTO(struct usbssp_udc *usbssp_data, struct usbssp_container_ctx *ctx, + unsigned int ep_num), + TP_ARGS(usbssp_data, ctx, ep_num), + TP_STRUCT__entry( + __field(int, ctx_64) + __field(unsigned int, ctx_type) + __field(dma_addr_t, ctx_dma) + __field(u8 *, ctx_va) + __field(unsigned int, ctx_ep_num) + __field(int, slot_id) + __dynamic_array(u32, ctx_data, + ((HCC_64BYTE_CONTEXT(usbssp_data->hcc_params) + 1) * 8) * + ((ctx->type == USBSSP_CTX_TYPE_INPUT) + ep_num + 1)) + ), + TP_fast_assign( + __entry->ctx_64 = HCC_64BYTE_CONTEXT(usbssp_data->hcc_params); + __entry->ctx_type = ctx->type; + __entry->ctx_dma = ctx->dma; + __entry->ctx_va = ctx->bytes; + __entry->slot_id = usbssp_data->slot_id; + __entry->ctx_ep_num = ep_num; + memcpy(__get_dynamic_array(ctx_data), ctx->bytes, + ((HCC_64BYTE_CONTEXT(usbssp_data->hcc_params) + 1) * 32) * + ((ctx->type == USBSSP_CTX_TYPE_INPUT) + ep_num + 1)); + ), + TP_printk("\nctx_64=%d, ctx_type=%u, ctx_dma=@%llx, ctx_va=@%p", + __entry->ctx_64, __entry->ctx_type, + (unsigned long long) __entry->ctx_dma, __entry->ctx_va + ) +); + +DEFINE_EVENT(usbssp_log_ctx, usbssp_address_ctx, + TP_PROTO(struct usbssp_udc *usbssp_data, struct usbssp_container_ctx *ctx, + unsigned int ep_num), + TP_ARGS(usbssp_data, ctx, ep_num) +); + + +DECLARE_EVENT_CLASS(usbssp_log_trb, + TP_PROTO(struct usbssp_ring *ring, struct usbssp_generic_trb *trb), + TP_ARGS(ring, trb), + TP_STRUCT__entry( + __field(u32, type) + __field(u32, field0) + __field(u32, field1) + __field(u32, field2) + __field(u32, field3) + ), + TP_fast_assign( + __entry->type = ring->type; + __entry->field0 = le32_to_cpu(trb->field[0]); + __entry->field1 = le32_to_cpu(trb->field[1]); + __entry->field2 = le32_to_cpu(trb->field[2]); + __entry->field3 = le32_to_cpu(trb->field[3]); + ), + TP_printk("%s: %s", usbssp_ring_type_string(__entry->type), + usbssp_decode_trb(__entry->field0, __entry->field1, + __entry->field2, __entry->field3) + ) +); + +DEFINE_EVENT(usbssp_log_trb, usbssp_handle_event, + TP_PROTO(struct usbssp_ring *ring, struct usbssp_generic_trb *trb), + TP_ARGS(ring, trb) +); + +DEFINE_EVENT(usbssp_log_trb, usbssp_handle_command, + TP_PROTO(struct usbssp_ring *ring, struct usbssp_generic_trb *trb), + TP_ARGS(ring, trb) +); + +DEFINE_EVENT(usbssp_log_trb, usbssp_handle_transfer, + TP_PROTO(struct usbssp_ring *ring, struct usbssp_generic_trb *trb), + TP_ARGS(ring, trb) +); + +DEFINE_EVENT(usbssp_log_trb, usbssp_queue_trb, + TP_PROTO(struct usbssp_ring *ring, struct usbssp_generic_trb *trb), + TP_ARGS(ring, trb) +); + +DEFINE_EVENT(usbssp_log_trb, usbssp_dbc_handle_event, + TP_PROTO(struct usbssp_ring *ring, struct usbssp_generic_trb *trb), + TP_ARGS(ring, trb) +); + +DEFINE_EVENT(usbssp_log_trb, usbssp_dbc_handle_transfer, + TP_PROTO(struct usbssp_ring *ring, struct usbssp_generic_trb *trb), + TP_ARGS(ring, trb) +); + +DEFINE_EVENT(usbssp_log_trb, usbssp_dbc_gadget_ep_queue, + TP_PROTO(struct usbssp_ring *ring, struct usbssp_generic_trb *trb), + TP_ARGS(ring, trb) +); + +DECLARE_EVENT_CLASS(usbssp_log_priv_dev, + TP_PROTO(struct usbssp_device *priv_dev), + TP_ARGS(priv_dev), + TP_STRUCT__entry( + __field(struct usbssp_device *, priv_dev) + __field(struct usb_gadget *, gadget) + __field(unsigned long long, out_ctx) + __field(unsigned long long, in_ctx) + __field(u8, port_num) + ), + TP_fast_assign( + __entry->priv_dev = priv_dev; + __entry->gadget = priv_dev->gadget; + __entry->in_ctx = (unsigned long long) priv_dev->in_ctx->dma; + __entry->out_ctx = (unsigned long long) priv_dev->out_ctx->dma; + __entry->port_num = priv_dev->port_num; + ), + TP_printk("priv_dev %p gadget %p ctx %llx | %llx, port %d ", + __entry->priv_dev, __entry->gadget, __entry->in_ctx, __entry->out_ctx, + __entry->port_num + ) +); + +DEFINE_EVENT(usbssp_log_priv_dev, usbssp_alloc_priv_device, + TP_PROTO(struct usbssp_device *vdev), + TP_ARGS(vdev) +); + +DEFINE_EVENT(usbssp_log_priv_dev, usbssp_free_priv_device, + TP_PROTO(struct usbssp_device *vdev), + TP_ARGS(vdev) +); + +DEFINE_EVENT(usbssp_log_priv_dev, usbssp_setup_device, + TP_PROTO(struct usbssp_device *vdev), + TP_ARGS(vdev) +); + +DEFINE_EVENT(usbssp_log_priv_dev, usbssp_setup_addressable_priv_device, + TP_PROTO(struct usbssp_device *vdev), + TP_ARGS(vdev) +); + +DEFINE_EVENT(usbssp_log_priv_dev, usbssp_stop_device, + TP_PROTO(struct usbssp_device *vdev), + TP_ARGS(vdev) +); + +DECLARE_EVENT_CLASS(usbssp_log_request, + TP_PROTO(struct usb_request *request), + TP_ARGS(request), + TP_STRUCT__entry( + __field(struct usb_request *, request) + __field(void *, buf) + __field(unsigned int, length) + __field(dma_addr_t, dma) + __field(struct scatterlist*, sg) + __field(unsigned int, num_sgs) + __field(unsigned int, num_mapped_sgs) + __field(unsigned int, stream_id) + __field(unsigned int, no_interrupt) + __field(unsigned int, zero) + __field(unsigned int, short_not_ok) + __field(unsigned int, dma_mapped) + __field(int, status) + __field(unsigned int, actual) + ), + TP_fast_assign( + __entry->request = request; + __entry->buf = request->buf; + __entry->length = request->length; + __entry->dma = request->dma; + __entry->sg = request->sg; + __entry->num_sgs = request->num_sgs; + __entry->num_mapped_sgs = request->num_mapped_sgs; + __entry->stream_id = request->stream_id; + __entry->no_interrupt = request->no_interrupt; + __entry->zero = request->zero; + __entry->short_not_ok = request->short_not_ok; + __entry->dma_mapped = 0 /*request->dma_mapped*/; + __entry->status = request->status; + __entry->actual = request->actual; + ), + + TP_printk("req %p; buf %p, len %d, dma %llx, sg %p, num_sg %d, num_m_sg %d," + "stream_id %d, no_int %x, zero %x, short_not_ok %x, dma_mapped %x, " + "status %d, actual %d", + __entry->request, + __entry->buf, __entry->length, __entry->dma, __entry->sg, + __entry->num_sgs, __entry->num_mapped_sgs, __entry->stream_id, + __entry->no_interrupt, __entry->zero, __entry->short_not_ok, + __entry->dma_mapped, __entry->status, __entry->actual + ) + +); + +DEFINE_EVENT(usbssp_log_request, usbssp_request_enqueue, + TP_PROTO(struct usb_request *request), + TP_ARGS(request) +); + +DEFINE_EVENT(usbssp_log_request, usbssp_request_giveback, + TP_PROTO(struct usb_request *request), + TP_ARGS(request) +); + +DEFINE_EVENT(usbssp_log_request, usbssp_request_dequeue, + TP_PROTO(struct usb_request *request), + TP_ARGS(request) +); + +DEFINE_EVENT(usbssp_log_request, usbssp_alloc_request, + TP_PROTO(struct usb_request *request), + TP_ARGS(request) +); + +DEFINE_EVENT(usbssp_log_request, usbssp_free_request, + TP_PROTO(struct usb_request *request), + TP_ARGS(request) +); + +DECLARE_EVENT_CLASS(usbssp_log_ep_ctx, + TP_PROTO(struct usbssp_ep_ctx *ctx), + TP_ARGS(ctx), + TP_STRUCT__entry( + __field(u32, info) + __field(u32, info2) + __field(u64, deq) + __field(u32, tx_info) + ), + TP_fast_assign( + __entry->info = le32_to_cpu(ctx->ep_info); + __entry->info2 = le32_to_cpu(ctx->ep_info2); + __entry->deq = le64_to_cpu(ctx->deq); + __entry->tx_info = le32_to_cpu(ctx->tx_info); + ), + TP_printk("%s", usbssp_decode_ep_context(__entry->info, + __entry->info2, __entry->deq, __entry->tx_info) + ) +); + +DEFINE_EVENT(usbssp_log_ep_ctx, usbssp_remove_request, + TP_PROTO(struct usbssp_ep_ctx *ctx), + TP_ARGS(ctx) +); + +DEFINE_EVENT(usbssp_log_ep_ctx, usbssp_handle_cmd_stop_ep, + TP_PROTO(struct usbssp_ep_ctx *ctx), + TP_ARGS(ctx) +); + +DEFINE_EVENT(usbssp_log_ep_ctx, usbssp_handle_cmd_set_deq_ep, + TP_PROTO(struct usbssp_ep_ctx *ctx), + TP_ARGS(ctx) +); + +DEFINE_EVENT(usbssp_log_ep_ctx, usbssp_handle_cmd_reset_ep, + TP_PROTO(struct usbssp_ep_ctx *ctx), + TP_ARGS(ctx) +); + +DEFINE_EVENT(usbssp_log_ep_ctx, usbssp_handle_cmd_config_ep, + TP_PROTO(struct usbssp_ep_ctx *ctx), + TP_ARGS(ctx) +); + +DECLARE_EVENT_CLASS(usbssp_log_slot_ctx, + TP_PROTO(struct usbssp_slot_ctx *ctx), + TP_ARGS(ctx), + TP_STRUCT__entry( + __field(u32, info) + __field(u32, info2) + __field(u32, int_target) + __field(u32, state) + ), + TP_fast_assign( + __entry->info = le32_to_cpu(ctx->dev_info); + __entry->info2 = le32_to_cpu(ctx->dev_info2); + __entry->int_target = le64_to_cpu(ctx->int_target); + __entry->state = le32_to_cpu(ctx->dev_state); + ), + TP_printk("%s", usbssp_decode_slot_context(__entry->info, + __entry->info2, __entry->int_target, + __entry->state) + ) +); + +DEFINE_EVENT(usbssp_log_slot_ctx, usbssp_alloc_dev, + TP_PROTO(struct usbssp_slot_ctx *ctx), + TP_ARGS(ctx) +); + +DEFINE_EVENT(usbssp_log_slot_ctx, usbssp_free_dev, + TP_PROTO(struct usbssp_slot_ctx *ctx), + TP_ARGS(ctx) +); + +DEFINE_EVENT(usbssp_log_slot_ctx, usbssp_handle_cmd_disable_slot, + TP_PROTO(struct usbssp_slot_ctx *ctx), + TP_ARGS(ctx) +); + +DEFINE_EVENT(usbssp_log_slot_ctx, usbssp_reset_device, + TP_PROTO(struct usbssp_slot_ctx *ctx), + TP_ARGS(ctx) +); + +DEFINE_EVENT(usbssp_log_slot_ctx, usbssp_setup_device_slot, + TP_PROTO(struct usbssp_slot_ctx *ctx), + TP_ARGS(ctx) +); + +DEFINE_EVENT(usbssp_log_slot_ctx, usbssp_handle_cmd_addr_dev, + TP_PROTO(struct usbssp_slot_ctx *ctx), + TP_ARGS(ctx) +); + +DEFINE_EVENT(usbssp_log_slot_ctx, usbssp_handle_cmd_reset_dev, + TP_PROTO(struct usbssp_slot_ctx *ctx), + TP_ARGS(ctx) +); + +DEFINE_EVENT(usbssp_log_slot_ctx, usbssp_handle_cmd_set_deq, + TP_PROTO(struct usbssp_slot_ctx *ctx), + TP_ARGS(ctx) +); + +DEFINE_EVENT(usbssp_log_slot_ctx, usbssp_configure_endpoint, + TP_PROTO(struct usbssp_slot_ctx *ctx), + TP_ARGS(ctx) +); + +DECLARE_EVENT_CLASS(usbssp_log_ring, + TP_PROTO(struct usbssp_ring *ring), + TP_ARGS(ring), + TP_STRUCT__entry( + __field(u32, type) + __field(void *, ring) + __field(dma_addr_t, enq) + __field(dma_addr_t, deq) + __field(dma_addr_t, enq_seg) + __field(dma_addr_t, deq_seg) + __field(unsigned int, num_segs) + __field(unsigned int, stream_id) + __field(unsigned int, cycle_state) + __field(unsigned int, num_trbs_free) + __field(unsigned int, bounce_buf_len) + ), + TP_fast_assign( + __entry->ring = ring; + __entry->type = ring->type; + __entry->num_segs = ring->num_segs; + __entry->stream_id = ring->stream_id; + __entry->enq_seg = ring->enq_seg->dma; + __entry->deq_seg = ring->deq_seg->dma; + __entry->cycle_state = ring->cycle_state; + __entry->num_trbs_free = ring->num_trbs_free; + __entry->bounce_buf_len = ring->bounce_buf_len; + __entry->enq = usbssp_trb_virt_to_dma(ring->enq_seg, ring->enqueue); + __entry->deq = usbssp_trb_virt_to_dma(ring->deq_seg, ring->dequeue); + ), + TP_printk("%s %p: enq %pad(%pad) deq %pad(%pad) segs %d stream %d free_trbs %d bounce %d cycle %d", + usbssp_ring_type_string(__entry->type), __entry->ring, + &__entry->enq, &__entry->enq_seg, + &__entry->deq, &__entry->deq_seg, + __entry->num_segs, + __entry->stream_id, + __entry->num_trbs_free, + __entry->bounce_buf_len, + __entry->cycle_state + ) +); + +DEFINE_EVENT(usbssp_log_ring, usbssp_ring_alloc, + TP_PROTO(struct usbssp_ring *ring), + TP_ARGS(ring) +); + +DEFINE_EVENT(usbssp_log_ring, usbssp_ring_free, + TP_PROTO(struct usbssp_ring *ring), + TP_ARGS(ring) +); + +DEFINE_EVENT(usbssp_log_ring, usbssp_ring_expansion, + TP_PROTO(struct usbssp_ring *ring), + TP_ARGS(ring) +); + +DEFINE_EVENT(usbssp_log_ring, usbssp_inc_enq, + TP_PROTO(struct usbssp_ring *ring), + TP_ARGS(ring) +); + +DEFINE_EVENT(usbssp_log_ring, usbssp_inc_deq, + TP_PROTO(struct usbssp_ring *ring), + TP_ARGS(ring) +); + +DECLARE_EVENT_CLASS(usbssp_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", + __entry->portnum, + usbssp_decode_portsc(__entry->portsc) + ) +); + +DEFINE_EVENT(usbssp_log_portsc, usbssp_handle_port_status, + TP_PROTO(u32 portnum, u32 portsc), + TP_ARGS(portnum, portsc) +); + +DEFINE_EVENT(usbssp_log_portsc, usbssp_get_port_status, + TP_PROTO(u32 portnum, u32 portsc), + TP_ARGS(portnum, portsc) +); + +#endif /* __USBSSP_TRACE_H */ +/* this part must be outside header guard */ + +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH . + +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE gadget-trace + +#include