From patchwork Sun May 19 10:01:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 10949343 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F3F776 for ; Sun, 19 May 2019 10:04:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF316284F5 for ; Sun, 19 May 2019 10:04:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEB2328571; Sun, 19 May 2019 10:04:02 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 34B5B284F5 for ; Sun, 19 May 2019 10:04:02 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 64B691695; Sun, 19 May 2019 12:03:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 64B691695 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1558260240; bh=vli5TEP3qoklirYm/0/KngU+jBfX73LbLRX8gXTsnSk=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=YmvigUYjbPS5tM05fWAWZuNR6oeAzKMZr3uab8Wuhh6EKpOsgrhqKDfo7/Fi9nHjt Za3YpTYJrNp6tE/PUOD/7eioAeOj8Dy++KHBeGZgivETW1wH4maG5ab1V+mbCPjyej kqNgAKtNVWv+55jupi1Rma1C4Nm7kBOVswh/XTVg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B05ABF89630; Sun, 19 May 2019 12:01:29 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8B979F8970E; Sun, 19 May 2019 12:01:24 +0200 (CEST) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7F762F8962F for ; Sun, 19 May 2019 12:01:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7F762F8962F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="VFnyETqC"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="BbTcAN90" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5EB0321385; Sun, 19 May 2019 06:01:16 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 19 May 2019 06:01:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=UAiMjJ5i541wU n1AHhcqeGUag596huLdmyX+BziqGDM=; b=VFnyETqCklI6UdX6UWlLhroET1BN2 YNy1F2Q6sO9A1Yg5vw+Z3DLQ9J8pbrqkT/XAN1yiZJi8Ti519wg/QRoyNtHapoy0 zUzzdFawOXZrFGFHZTHaxORaOx/IQ6/+Pxo8rx85sIe7E53Aqvypxa23BVrxFNtK 9/O5WkuWB7pnSYnY89DJ7sPUAdQHpdEmMoll/Lmj2JLOABmcBe60g5yBn3GMJXqW f81EK/IBmUrkObr089eqkRSGxeFTHDEvk6N3XUtNqIpIt7Ht94ujRcPlqQpt6KzG QHnzz6pt13mkzmhIxj70RPMvXZGLyyAT5azl64gwsrM6gI4k2y4g7wSBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=UAiMjJ5i541wUn1AHhcqeGUag596huLdmyX+BziqGDM=; b=BbTcAN90 6wKPMP57Vtv8hX3SEZyRpj2FTF29luAo9PdsPFVjIovLT+h8cfIlKs2daJTHnenI 8ZXFZ0nyAef2ZHGhZ//daDktbbuVPqErn+1XUjLvSQMDksaUB+HRL7MaaJY0o3hU vu8hnmGWIlLZ/kE4iQIJffxddOwnHHKw/MWofdZYpyXy7OkRjlVZT95tIv8hRgDD oJAHv1RtuWfSoayWSJwHJ4PYne4cXq84we/UeeTMQFMgUKOiutGL2FyY8tpFzDOT SxV0SWs+M1joyA1WcvGOyiBrLzEXoixf9tXKqS+lU8FYE/eV5KM3i7JVPaYyUNUF ZOu2cOf1bzY4hA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddruddtiedgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvfgrkhgrshhhihcuufgrkhgrmhhothhouceoohdqthgrkhgr shhhihesshgrkhgrmhhotggthhhirdhjpheqnecukfhppedugedrfedrjeehrddukedune curfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhisehsrghkrghmohgttghh ihdrjhhpnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost.localdomain (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 0154810378; Sun, 19 May 2019 06:01:14 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Sun, 19 May 2019 19:01:05 +0900 Message-Id: <20190519100109.14167-2-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190519100109.14167-1-o-takashi@sakamocchi.jp> References: <20190519100109.14167-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 1/5] firewire-lib: use the same type of argument for CIP header for tracing event X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP An argument for CIP header in 'in_packet' event is not the same type in 'out_packet' event. This is not good to unify these events. This commit uses the same type of argument for these events. Signed-off-by: Takashi Sakamoto --- sound/firewire/amdtp-stream-trace.h | 6 +++--- sound/firewire/amdtp-stream.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/firewire/amdtp-stream-trace.h b/sound/firewire/amdtp-stream-trace.h index ac20acf48fc6..a86a827eab90 100644 --- a/sound/firewire/amdtp-stream-trace.h +++ b/sound/firewire/amdtp-stream-trace.h @@ -14,7 +14,7 @@ #include TRACE_EVENT(in_packet, - TP_PROTO(const struct amdtp_stream *s, u32 cycles, u32 *cip_header, unsigned int payload_length, unsigned int index), + TP_PROTO(const struct amdtp_stream *s, u32 cycles, const __be32 *cip_header, unsigned int payload_length, unsigned int index), TP_ARGS(s, cycles, cip_header, payload_length, index), TP_STRUCT__entry( __field(unsigned int, second) @@ -35,8 +35,8 @@ TRACE_EVENT(in_packet, __entry->channel = s->context->channel; __entry->src = fw_parent_device(s->unit)->node_id; __entry->dest = fw_parent_device(s->unit)->card->node_id; - __entry->cip_header0 = cip_header[0]; - __entry->cip_header1 = cip_header[1]; + __entry->cip_header0 = be32_to_cpu(cip_header[0]); + __entry->cip_header1 = be32_to_cpu(cip_header[1]); __entry->payload_quadlets = payload_length / 4; __entry->packet_index = s->packet_index; __entry->irq = !!in_interrupt(); diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index 43f28b813386..2614fa551e24 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -555,7 +555,7 @@ static int handle_in_packet(struct amdtp_stream *s, cip_header[0] = be32_to_cpu(buffer[0]); cip_header[1] = be32_to_cpu(buffer[1]); - trace_in_packet(s, cycle, cip_header, payload_length, index); + trace_in_packet(s, cycle, buffer, payload_length, index); /* * This module supports 'Two-quadlet CIP header with SYT field'. From patchwork Sun May 19 10:01:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 10949341 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51D1D76 for ; Sun, 19 May 2019 10:03:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D901284F5 for ; Sun, 19 May 2019 10:03:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FD5E28571; Sun, 19 May 2019 10:03:14 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 55F42284F5 for ; Sun, 19 May 2019 10:03:13 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7622D1684; Sun, 19 May 2019 12:02:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7622D1684 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1558260191; bh=cDBsg+6ToMn+UBGjZQYBx+tPazSKOX0jWO0Ah3w5njc=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FHDNcGivSNGw2rdvIANb/JO2SeCu6Vu1/FietAkmolLOT+0iZ9O2VXrxIuKjw1vQh TwF0UX+5Si5eiwK2Nw6dEV9jGeaqgAfVs71wNW97KTUH1CWnh9PBdfIy71+r3xyDgS UvxS2Hu6dTxfFEyZxLz4dWgqrLUBCpC/3D1YpuOU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 73F31F8961D; Sun, 19 May 2019 12:01:28 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 59658F89670; Sun, 19 May 2019 12:01:23 +0200 (CEST) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4D056F89630 for ; Sun, 19 May 2019 12:01:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4D056F89630 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="tShC5Dx0"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="XUmgnFyg" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id EAC2F2208C; Sun, 19 May 2019 06:01:17 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 19 May 2019 06:01:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=vIWloC/hh0TS4 3thHtaTPVAweh5rEfH2PVLt2rCBme4=; b=tShC5Dx00Hi8p1AIq39WVq4rXh459 d21A2X0tBxjgfi5Gi/oSGjKBSk+P7WeWlH24y7lnBClp5UQ2yb5GgNRQUg0tRE/h AHtAAopEip9na2mDo6sZdCB0YQmRobXOl6O7EEFq14Rr99bglT+NwAQgJ6lhYocp y32/WjLE/RTk/EldkU9S3XUHEXQ4HSkO05SM7u+tY5Q4A/IJ6YL1gfb74uxd4tjg oEm61Fa58VCSXQ8hShku0yVleiludBLGVBiX5Gyel+CtAhD0gL/8T1w+gveuEVQ8 mn180+K4IKyklvr8Dz4Ts/2mncb9KnVUgQb9g90vihjVyX9p03CQkUW/Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=vIWloC/hh0TS43thHtaTPVAweh5rEfH2PVLt2rCBme4=; b=XUmgnFyg ai05N+vkPUOQITIChjjB5EQLZ28H129BD8B/b0Pvc9MdgUBSQ4d/otPxH4GMw8RJ i8YJYUECuoGbTCys8TVmYLSXAaRtoJeW/cRS0A33DOQpSaJ5r7fPVNCnPjmRBG8W BayPcH6ae+yNuhcoo6RIJ+MZ1qLWyvDY1RYqDYkqAD1Xtf3pM6mbCGNpMdgQN4Cs xWjxR7qR5x9ds8K9DD13SsPOzn6qGh9NURPAYmE/ZJh8KygfcE/PtzM/eJ4v2WNt h8F3tzuKgQ/K1NR1GbNFQw3AxwEU8OaHHbs78tnEom0N3S0UvCn06rZTZcdF+3LW WKvmZu2u+InuXg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddruddtiedgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvfgrkhgrshhhihcuufgrkhgrmhhothhouceoohdqthgrkhgr shhhihesshgrkhgrmhhotggthhhirdhjpheqnecukfhppedugedrfedrjeehrddukedune curfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhisehsrghkrghmohgttghh ihdrjhhpnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost.localdomain (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 7A06910378; Sun, 19 May 2019 06:01:16 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Sun, 19 May 2019 19:01:06 +0900 Message-Id: <20190519100109.14167-3-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190519100109.14167-1-o-takashi@sakamocchi.jp> References: <20190519100109.14167-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 2/5] firewire-lib: add data_blocks/data_block_counter parameter to in_packet/out_packet tracing events X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP Tracing events for packets without CIP header have a parameter of data_blocks/data_block_counter, but events for packets with CIP header don't. This is not good to unify these events. This commit adds the missing parameters to the events. In timing to probe 'in_packet' event, data_blocks and data_block_counter are not calculated yet. This commit also changes the timing. Signed-off-by: Takashi Sakamoto --- sound/firewire/amdtp-stream-trace.h | 24 ++++++++++++++++++------ sound/firewire/amdtp-stream.c | 6 +++--- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/sound/firewire/amdtp-stream-trace.h b/sound/firewire/amdtp-stream-trace.h index a86a827eab90..95343fb17583 100644 --- a/sound/firewire/amdtp-stream-trace.h +++ b/sound/firewire/amdtp-stream-trace.h @@ -14,8 +14,8 @@ #include TRACE_EVENT(in_packet, - TP_PROTO(const struct amdtp_stream *s, u32 cycles, const __be32 *cip_header, unsigned int payload_length, unsigned int index), - TP_ARGS(s, cycles, cip_header, payload_length, index), + TP_PROTO(const struct amdtp_stream *s, u32 cycles, const __be32 *cip_header, unsigned int payload_length, unsigned int data_blocks, unsigned int index), + TP_ARGS(s, cycles, cip_header, payload_length, data_blocks, index), TP_STRUCT__entry( __field(unsigned int, second) __field(unsigned int, cycle) @@ -25,6 +25,8 @@ TRACE_EVENT(in_packet, __field(u32, cip_header0) __field(u32, cip_header1) __field(unsigned int, payload_quadlets) + __field(unsigned int, data_blocks) + __field(unsigned int, data_block_counter) __field(unsigned int, packet_index) __field(unsigned int, irq) __field(unsigned int, index) @@ -38,12 +40,14 @@ TRACE_EVENT(in_packet, __entry->cip_header0 = be32_to_cpu(cip_header[0]); __entry->cip_header1 = be32_to_cpu(cip_header[1]); __entry->payload_quadlets = payload_length / 4; + __entry->data_blocks = data_blocks; + __entry->data_block_counter = s->data_block_counter, __entry->packet_index = s->packet_index; __entry->irq = !!in_interrupt(); __entry->index = index; ), TP_printk( - "%02u %04u %04x %04x %02d %08x %08x %03u %02u %01u %02u", + "%02u %04u %04x %04x %02d %08x %08x %03u %02u %03u %02u %01u %02u", __entry->second, __entry->cycle, __entry->src, @@ -52,14 +56,16 @@ TRACE_EVENT(in_packet, __entry->cip_header0, __entry->cip_header1, __entry->payload_quadlets, + __entry->data_blocks, + __entry->data_block_counter, __entry->packet_index, __entry->irq, __entry->index) ); TRACE_EVENT(out_packet, - TP_PROTO(const struct amdtp_stream *s, u32 cycles, __be32 *cip_header, unsigned int payload_length, unsigned int index), - TP_ARGS(s, cycles, cip_header, payload_length, index), + TP_PROTO(const struct amdtp_stream *s, u32 cycles, const __be32 *cip_header, unsigned int payload_length, unsigned int data_blocks, unsigned int index), + TP_ARGS(s, cycles, cip_header, payload_length, data_blocks, index), TP_STRUCT__entry( __field(unsigned int, second) __field(unsigned int, cycle) @@ -69,6 +75,8 @@ TRACE_EVENT(out_packet, __field(u32, cip_header0) __field(u32, cip_header1) __field(unsigned int, payload_quadlets) + __field(unsigned int, data_blocks) + __field(unsigned int, data_block_counter) __field(unsigned int, packet_index) __field(unsigned int, irq) __field(unsigned int, index) @@ -82,12 +90,14 @@ TRACE_EVENT(out_packet, __entry->cip_header0 = be32_to_cpu(cip_header[0]); __entry->cip_header1 = be32_to_cpu(cip_header[1]); __entry->payload_quadlets = payload_length / 4; + __entry->data_blocks = data_blocks; + __entry->data_block_counter = s->data_block_counter, __entry->packet_index = s->packet_index; __entry->irq = !!in_interrupt(); __entry->index = index; ), TP_printk( - "%02u %04u %04x %04x %02d %08x %08x %03u %02u %01u %02u", + "%02u %04u %04x %04x %02d %08x %08x %03u %02u %03u %02u %01u %02u", __entry->second, __entry->cycle, __entry->src, @@ -96,6 +106,8 @@ TRACE_EVENT(out_packet, __entry->cip_header0, __entry->cip_header1, __entry->payload_quadlets, + __entry->data_blocks, + __entry->data_block_counter, __entry->packet_index, __entry->irq, __entry->index) diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index 2614fa551e24..67b60490e505 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -493,7 +493,7 @@ static int handle_out_packet(struct amdtp_stream *s, (s->data_block_counter + data_blocks) & 0xff; payload_length = 8 + data_blocks * 4 * s->data_block_quadlets; - trace_out_packet(s, cycle, buffer, payload_length, index); + trace_out_packet(s, cycle, buffer, payload_length, data_blocks, index); if (queue_out_packet(s, payload_length) < 0) return -EIO; @@ -555,8 +555,6 @@ static int handle_in_packet(struct amdtp_stream *s, cip_header[0] = be32_to_cpu(buffer[0]); cip_header[1] = be32_to_cpu(buffer[1]); - trace_in_packet(s, cycle, buffer, payload_length, index); - /* * This module supports 'Two-quadlet CIP header with SYT field'. * For convenience, also check FMT field is AM824 or not. @@ -635,6 +633,8 @@ static int handle_in_packet(struct amdtp_stream *s, return -EIO; } + trace_in_packet(s, cycle, buffer, payload_length, data_blocks, index); + syt = be32_to_cpu(buffer[1]) & CIP_SYT_MASK; pcm_frames = s->process_data_blocks(s, buffer + 2, data_blocks, &syt); From patchwork Sun May 19 10:01:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 10949347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF3B11395 for ; Sun, 19 May 2019 10:05:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D85AF284F5 for ; Sun, 19 May 2019 10:05:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C67FA28571; Sun, 19 May 2019 10:05:17 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0714F284F5 for ; Sun, 19 May 2019 10:05:17 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 65FCA167D; Sun, 19 May 2019 12:04:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 65FCA167D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1558260315; bh=NS5QzBpAUgA9NCHYYBdXYCKoAzlCK92yC1nRemcLqM0=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=gz+OsVyKRszJKa6+/n54i/BMaw1+qhuDPqTZmqs2jyNfSHO53FZBTDMTflcWndVSX QP5L1eP0+jVBzu12XHYyNj4U9oCH3lYSJXV5JANMk8gdq4pi4naG0hkuZoBLy+gOC2 +ZLbGp+AhzaAOmba2Z78+XFNfV9XwIz47AyANs4M= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D94D6F89734; Sun, 19 May 2019 12:01:31 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id F0B31F89717; Sun, 19 May 2019 12:01:26 +0200 (CEST) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 25EC9F89709 for ; Sun, 19 May 2019 12:01:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 25EC9F89709 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="cDEFVdQc"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="k/4+iCF9" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5589C2202A; Sun, 19 May 2019 06:01:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 19 May 2019 06:01:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=lyAJo8UxT6Ikf Vln0y5UUE/iK0sXzwUp+Ob9rDpx1K4=; b=cDEFVdQcUyTLzMwSkXMuRguBoFkhw xvfqCdl2JDaNka7OYEX5P5Ll+Dc42V6xW/E3p3Rkcb4zNO1XKwPZGGph4hxaibcD 7OiyLED4f6mjnIdEDvZFT0fbg4cc8AX9hkbChreShOfNtwN2wCGhCZOixIybO4sK aVba33UGfLDWkKdsBDApmEQknD2qvGAFDQOe1AiOLKHDRomemO13yEB+5GtY8APl 7Pyh3nVlzJWMwO+/EYuUhjO9e6q8X5zciximceDRiW3bBRotAsO3NFY1sO9rK/9o 7ppIhJQ3ORQjEwngvQX7YifVHK24GHyr+1DCI79LOPSl+zA85gzJElzow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=lyAJo8UxT6IkfVln0y5UUE/iK0sXzwUp+Ob9rDpx1K4=; b=k/4+iCF9 b1Z/OqabC/wAwI/nE2qULH6q9yrFKad1RWGoVROuQxbi2y9A1eIG9Tobq3spTQye DHqpcpTkL6ie15rrj0JdSTBtQvjNGVaQi7SwWVKKjWJLucTH5nTPoyOIhSafxsXI lO002JEO668cF5w6V7qZWe3e/Z6cReXppsXor4MoVTtuscX94NnPzNDoQuav0QwX fFTKdS3cQ3RC8SgRveYxDRABNpTC+SMdTIJc/ylhcQVpNdM0lkA20n0PO+HuVr+Y Wfc8Fng1b0AS8o+S0bqlDSxnvjSZyvul5U5DCwwTVlXjLEwC4fqhpmACHFIJZiB5 5uDS3XuJdn/RXg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddruddtiedgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvfgrkhgrshhhihcuufgrkhgrmhhothhouceoohdqthgrkhgr shhhihesshgrkhgrmhhotggthhhirdhjpheqnecukfhppedugedrfedrjeehrddukedune curfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhisehsrghkrghmohgttghh ihdrjhhpnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost.localdomain (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 0208F103CF; Sun, 19 May 2019 06:01:17 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Sun, 19 May 2019 19:01:07 +0900 Message-Id: <20190519100109.14167-4-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190519100109.14167-1-o-takashi@sakamocchi.jp> References: <20190519100109.14167-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 3/5] firewire-lib: use the same unit for payload argument in tracing events X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP The most of tracing event in this module have the size of payload in byte unit, however 'in_packet_without_header' event have the argument in quadlet unit. This commit change the unit for argument to be consistent. Signed-off-by: Takashi Sakamoto --- sound/firewire/amdtp-stream-trace.h | 12 ++++++------ sound/firewire/amdtp-stream.c | 6 ++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/sound/firewire/amdtp-stream-trace.h b/sound/firewire/amdtp-stream-trace.h index 95343fb17583..30c547552cd2 100644 --- a/sound/firewire/amdtp-stream-trace.h +++ b/sound/firewire/amdtp-stream-trace.h @@ -39,7 +39,7 @@ TRACE_EVENT(in_packet, __entry->dest = fw_parent_device(s->unit)->card->node_id; __entry->cip_header0 = be32_to_cpu(cip_header[0]); __entry->cip_header1 = be32_to_cpu(cip_header[1]); - __entry->payload_quadlets = payload_length / 4; + __entry->payload_quadlets = payload_length / sizeof(__be32); __entry->data_blocks = data_blocks; __entry->data_block_counter = s->data_block_counter, __entry->packet_index = s->packet_index; @@ -89,7 +89,7 @@ TRACE_EVENT(out_packet, __entry->dest = fw_parent_device(s->unit)->node_id; __entry->cip_header0 = be32_to_cpu(cip_header[0]); __entry->cip_header1 = be32_to_cpu(cip_header[1]); - __entry->payload_quadlets = payload_length / 4; + __entry->payload_quadlets = payload_length / sizeof(__be32); __entry->data_blocks = data_blocks; __entry->data_block_counter = s->data_block_counter, __entry->packet_index = s->packet_index; @@ -114,8 +114,8 @@ TRACE_EVENT(out_packet, ); TRACE_EVENT(in_packet_without_header, - TP_PROTO(const struct amdtp_stream *s, u32 cycles, unsigned int payload_quadlets, unsigned int data_blocks, unsigned int index), - TP_ARGS(s, cycles, payload_quadlets, data_blocks, index), + TP_PROTO(const struct amdtp_stream *s, u32 cycles, unsigned int payload_length, unsigned int data_blocks, unsigned int index), + TP_ARGS(s, cycles, payload_length, data_blocks, index), TP_STRUCT__entry( __field(unsigned int, second) __field(unsigned int, cycle) @@ -135,7 +135,7 @@ TRACE_EVENT(in_packet_without_header, __entry->channel = s->context->channel; __entry->src = fw_parent_device(s->unit)->node_id; __entry->dest = fw_parent_device(s->unit)->card->node_id; - __entry->payload_quadlets = payload_quadlets; + __entry->payload_quadlets = payload_length / sizeof(__be32); __entry->data_blocks = data_blocks, __entry->data_block_counter = s->data_block_counter, __entry->packet_index = s->packet_index; @@ -179,7 +179,7 @@ TRACE_EVENT(out_packet_without_header, __entry->channel = s->context->channel; __entry->src = fw_parent_device(s->unit)->card->node_id; __entry->dest = fw_parent_device(s->unit)->node_id; - __entry->payload_quadlets = payload_length / 4; + __entry->payload_quadlets = payload_length / sizeof(__be32); __entry->data_blocks = data_blocks, __entry->data_block_counter = s->data_block_counter, __entry->packet_index = s->packet_index; diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index 67b60490e505..15ae1f2989e5 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -659,16 +659,14 @@ static int handle_in_packet_without_header(struct amdtp_stream *s, unsigned int index) { __be32 *buffer; - unsigned int payload_quadlets; unsigned int data_blocks; struct snd_pcm_substream *pcm; unsigned int pcm_frames; buffer = s->buffer.packets[s->packet_index].buffer; - payload_quadlets = payload_length / 4; - data_blocks = payload_quadlets / s->data_block_quadlets; + data_blocks = payload_length / sizeof(__be32) / s->data_block_quadlets; - trace_in_packet_without_header(s, cycle, payload_quadlets, data_blocks, + trace_in_packet_without_header(s, cycle, payload_length, data_blocks, index); pcm_frames = s->process_data_blocks(s, buffer, data_blocks, NULL); From patchwork Sun May 19 10:01:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 10949345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ACBA776 for ; Sun, 19 May 2019 10:04:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96EBF284F5 for ; Sun, 19 May 2019 10:04:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8601028571; Sun, 19 May 2019 10:04:41 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A9B6D284F5 for ; Sun, 19 May 2019 10:04:40 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0ADE71683; Sun, 19 May 2019 12:03:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0ADE71683 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1558260279; bh=bRW0z6yqwXuHfP2wfTTJtxT9VyeDMtzX0xDuFgVJ+Bs=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=L+b/Nkjg/eRKbhqXKGg0xcFM6vDPqG1qqbgPwikCdi+epC3chDO4rkdU1OkUbwOEz 8SfgLVWs4FVSIPwo8uf5zXuoUj7/ObJEN1uwcUCPGdM0Kz7OuD/zvVMoew1ujaRWR+ 6CQ2kyLgksCDlk3esV822ROQYlHgBiRTESUl12uE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C9EF2F8972C; Sun, 19 May 2019 12:01:30 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 13E4CF89717; Sun, 19 May 2019 12:01:26 +0200 (CEST) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D0E52F89618 for ; Sun, 19 May 2019 12:01:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D0E52F89618 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="PrjmyriD"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="nKyTfp0+" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 022F221FC1; Sun, 19 May 2019 06:01:21 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 19 May 2019 06:01:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=bQDUt4AoPcNr+ Nv91iNwg2yGlsdH1IDmI0vjiwnfGmM=; b=PrjmyriDmwi4GibL6TnXix8o4Ok+h mdGrcjG/F48re6hLHcno6jUMQnQXrEy8mWHCOKGgazNzbWpcxXA/k7lXjoK6Bns9 gS6BUpMEHU4p+G2ySco/tlLQSVwWcH5YGismT2XVmsHf9qNVXq6+TEYN6hrNpz0f DjagLutXcrC74Drz7GH6VtY+9yEsg632FmCOs7hWIo6lSvVeahDKXbhcRhjzkkux tEy0ap2P+AncDZBggNgEDNsjMf0xuNja7pOJ6grDeV6yLGp7TzCfgmswbv6ch6UZ 4Z4LS6v4KjSWG/6bqsD+c41HuQRp5wXKKbUXtQAAUEz96k3Wog67ann7w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=bQDUt4AoPcNr+Nv91iNwg2yGlsdH1IDmI0vjiwnfGmM=; b=nKyTfp0+ ucr1RNRG2LniaOM4NjkdQtc7snF1+y4alRActTBC5hga7IrG9c/t0zubmYJePh1K scGt8HHjynOuFOOjLz1asi+J7ZgqQWKFY0niBhS93zeyTj4iFcpwT1fNcFPdXiWc fMQG31WEu4c/qs7VtdHyBgjWvc1WPQNvcJX2lGe6/QqkayAvtYfePZ5nw1mt8k3H c3PEhu3doXBSX1WGLgICHnukbuqX9rPWb0neYrl65C3lGopCjLiA/5Jwfp1EPAjN dJO71UsKVafk+7LfBJER7EACKLAtpiyFPR3pW4ojL9G8YGa+ixY5PMM4idy6Wdms PPTOA88TWipKKg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddruddtiedgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvfgrkhgrshhhihcuufgrkhgrmhhothhouceoohdqthgrkhgr shhhihesshgrkhgrmhhotggthhhirdhjpheqnecukfhppedugedrfedrjeehrddukedune curfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhisehsrghkrghmohgttghh ihdrjhhpnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost.localdomain (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 822D610378; Sun, 19 May 2019 06:01:19 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Sun, 19 May 2019 19:01:08 +0900 Message-Id: <20190519100109.14167-5-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190519100109.14167-1-o-takashi@sakamocchi.jp> References: <20190519100109.14167-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 4/5] firewire-lib: use dynamic array for CIP header of tracing events X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP This modules handles two types of isochronous packet; one has CIP header in IEC 61883-1/6 and another doesn't. The module also have tracing events corresponding to the types of packet. To unify the events, one event should be probed with or without CIP header. This commit uses dynamic array for the events to be available for the types of packet. Signed-off-by: Takashi Sakamoto --- sound/firewire/amdtp-stream-trace.h | 36 ++++++++++++++++------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/sound/firewire/amdtp-stream-trace.h b/sound/firewire/amdtp-stream-trace.h index 30c547552cd2..614dfd08aa48 100644 --- a/sound/firewire/amdtp-stream-trace.h +++ b/sound/firewire/amdtp-stream-trace.h @@ -22,8 +22,7 @@ TRACE_EVENT(in_packet, __field(int, channel) __field(int, src) __field(int, dest) - __field(u32, cip_header0) - __field(u32, cip_header1) + __dynamic_array(u8, cip_header, cip_header ? 8 : 0) __field(unsigned int, payload_quadlets) __field(unsigned int, data_blocks) __field(unsigned int, data_block_counter) @@ -37,8 +36,10 @@ TRACE_EVENT(in_packet, __entry->channel = s->context->channel; __entry->src = fw_parent_device(s->unit)->node_id; __entry->dest = fw_parent_device(s->unit)->card->node_id; - __entry->cip_header0 = be32_to_cpu(cip_header[0]); - __entry->cip_header1 = be32_to_cpu(cip_header[1]); + if (cip_header) { + memcpy(__get_dynamic_array(cip_header), cip_header, + __get_dynamic_array_len(cip_header)); + } __entry->payload_quadlets = payload_length / sizeof(__be32); __entry->data_blocks = data_blocks; __entry->data_block_counter = s->data_block_counter, @@ -47,20 +48,21 @@ TRACE_EVENT(in_packet, __entry->index = index; ), TP_printk( - "%02u %04u %04x %04x %02d %08x %08x %03u %02u %03u %02u %01u %02u", + "%02u %04u %04x %04x %02d %03u %02u %03u %02u %01u %02u %s", __entry->second, __entry->cycle, __entry->src, __entry->dest, __entry->channel, - __entry->cip_header0, - __entry->cip_header1, __entry->payload_quadlets, __entry->data_blocks, __entry->data_block_counter, __entry->packet_index, __entry->irq, - __entry->index) + __entry->index, + __print_array(__get_dynamic_array(cip_header), + __get_dynamic_array_len(cip_header), + sizeof(u8))) ); TRACE_EVENT(out_packet, @@ -72,8 +74,7 @@ TRACE_EVENT(out_packet, __field(int, channel) __field(int, src) __field(int, dest) - __field(u32, cip_header0) - __field(u32, cip_header1) + __dynamic_array(u8, cip_header, cip_header ? 8 : 0) __field(unsigned int, payload_quadlets) __field(unsigned int, data_blocks) __field(unsigned int, data_block_counter) @@ -87,8 +88,10 @@ TRACE_EVENT(out_packet, __entry->channel = s->context->channel; __entry->src = fw_parent_device(s->unit)->card->node_id; __entry->dest = fw_parent_device(s->unit)->node_id; - __entry->cip_header0 = be32_to_cpu(cip_header[0]); - __entry->cip_header1 = be32_to_cpu(cip_header[1]); + if (cip_header) { + memcpy(__get_dynamic_array(cip_header), cip_header, + __get_dynamic_array_len(cip_header)); + } __entry->payload_quadlets = payload_length / sizeof(__be32); __entry->data_blocks = data_blocks; __entry->data_block_counter = s->data_block_counter, @@ -97,20 +100,21 @@ TRACE_EVENT(out_packet, __entry->index = index; ), TP_printk( - "%02u %04u %04x %04x %02d %08x %08x %03u %02u %03u %02u %01u %02u", + "%02u %04u %04x %04x %02d %03u %02u %03u %02u %01u %02u %s", __entry->second, __entry->cycle, __entry->src, __entry->dest, __entry->channel, - __entry->cip_header0, - __entry->cip_header1, __entry->payload_quadlets, __entry->data_blocks, __entry->data_block_counter, __entry->packet_index, __entry->irq, - __entry->index) + __entry->index, + __print_array(__get_dynamic_array(cip_header), + __get_dynamic_array_len(cip_header), + sizeof(u8))) ); TRACE_EVENT(in_packet_without_header, From patchwork Sun May 19 10:01:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 10949349 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5AFDF76 for ; Sun, 19 May 2019 10:05:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 459AB27FB3 for ; Sun, 19 May 2019 10:05:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3660228571; Sun, 19 May 2019 10:05: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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3B32A27FB3 for ; Sun, 19 May 2019 10:05:50 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 98A9B1692; Sun, 19 May 2019 12:04:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 98A9B1692 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1558260348; bh=mWW7/iPol5V7Y6ewseDKeKJvKTiNXTexOWmKArSdEts=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SYZoi1UmO0VnUhS/ah0TUYiZ8Iju+i9VBAzXWb8zh8vVcj83OOvgtairXp24a0NMV 7cqQsWCy69mb/1hnv+WgE48pVm69P6ZvJZzo2gd6r5p5PDs8nPB41wyX8WwclCxCPA sVLOkFE7bM5uYSxSBL02LSVMdd/dA/xOuBWVEVUk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2CA8CF89739; Sun, 19 May 2019 12:01:33 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 72307F89717; Sun, 19 May 2019 12:01:28 +0200 (CEST) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2C520F8961D for ; Sun, 19 May 2019 12:01:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2C520F8961D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="rIAgCP1q"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="iNjID/Tt" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id AF0BE20DC2; Sun, 19 May 2019 06:01:22 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 19 May 2019 06:01:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=RVKAVz+66Qisg PnziBAdPpC1/fIkKnDrLK5aZfcag44=; b=rIAgCP1qiuM3RoKrMJtQJUkxTfMNi hSp5G0Ya52VOK42M7SlxyB7e/7xHa9vlXKDKRvqieWGpmlOMjhIpL5ge4vYc4W6b ctrDEVzrjNzizV7vy0R42BbDqgjVU18ecOO7/VE1i4AMLjJpBkHPjmMaowgegPmf 6UvXQnDJnRWgVrNgWWkYtrOn4jsrwWglduMmlC/rjaDoMSqVaUJNqbtkareKO86A fProXdrxaOsU8ePB249ouuIsW3opv8s8QT2Nx5R0iVWkEIwJhiRZVuH6Zi32DqWs kDxMEr2cN1iPfqAODeP6AsyqnKHZeZ06px1lDiMlIOucB3X3aconys0oA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=RVKAVz+66QisgPnziBAdPpC1/fIkKnDrLK5aZfcag44=; b=iNjID/Tt es2SXk4llMfkMBCTaiTlWBLkhUqklDHFJf792zTg0pl6stzCmut4FEdQ2BRWBwoo o+1BmJg0GaU/R9XQuBtWmf5BC9bCmaAHi99CJS/mwXMcAft65oKE+xlBIVyFS8JH lVzSzK85kqDXIeEWzulXLl7TOiSEShRSZMRYod8R7Pe1IJFspklu8AHysNZbUq5f YSi8mP4IaHeODWrNg2STHwzTJ9Q6pfHWjS2ypqkbe1iIezOALVwIyTAe/IBxgncT MaReohb4NVJJ1RDjMyI5dTnK3rJDwIaJh8Q6qxVh9b+41kzbMdfeEKTML03uXOjl snV/THJtXVFI9w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddruddtiedgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvfgrkhgrshhhihcuufgrkhgrmhhothhouceoohdqthgrkhgr shhhihesshgrkhgrmhhotggthhhirdhjpheqnecukfhppedugedrfedrjeehrddukedune curfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhisehsrghkrghmohgttghh ihdrjhhpnecuvehluhhsthgvrhfuihiivgepge X-ME-Proxy: Received: from localhost.localdomain (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 10E1310378; Sun, 19 May 2019 06:01:20 -0400 (EDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Sun, 19 May 2019 19:01:09 +0900 Message-Id: <20190519100109.14167-6-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190519100109.14167-1-o-takashi@sakamocchi.jp> References: <20190519100109.14167-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 5/5] firewire-lib: unify tracing events to 'amdtp_packet' event X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP Now four events of this module have the same arguments and probe timing. This commit adds a new event, 'amdtp_packet', and replace them. Filtering functionality of tracing framework is available to pick up events for inbound/outbound isochronous packets. Signed-off-by: Takashi Sakamoto --- sound/firewire/amdtp-stream-trace.h | 149 ++-------------------------- sound/firewire/amdtp-stream.c | 10 +- 2 files changed, 11 insertions(+), 148 deletions(-) diff --git a/sound/firewire/amdtp-stream-trace.h b/sound/firewire/amdtp-stream-trace.h index 614dfd08aa48..ab708857979f 100644 --- a/sound/firewire/amdtp-stream-trace.h +++ b/sound/firewire/amdtp-stream-trace.h @@ -13,7 +13,7 @@ #include -TRACE_EVENT(in_packet, +TRACE_EVENT(amdtp_packet, TP_PROTO(const struct amdtp_stream *s, u32 cycles, const __be32 *cip_header, unsigned int payload_length, unsigned int data_blocks, unsigned int index), TP_ARGS(s, cycles, cip_header, payload_length, data_blocks, index), TP_STRUCT__entry( @@ -34,60 +34,13 @@ TRACE_EVENT(in_packet, __entry->second = cycles / CYCLES_PER_SECOND; __entry->cycle = cycles % CYCLES_PER_SECOND; __entry->channel = s->context->channel; - __entry->src = fw_parent_device(s->unit)->node_id; - __entry->dest = fw_parent_device(s->unit)->card->node_id; - if (cip_header) { - memcpy(__get_dynamic_array(cip_header), cip_header, - __get_dynamic_array_len(cip_header)); + if (s->direction == AMDTP_IN_STREAM) { + __entry->src = fw_parent_device(s->unit)->node_id; + __entry->dest = fw_parent_device(s->unit)->card->node_id; + } else { + __entry->src = fw_parent_device(s->unit)->card->node_id; + __entry->dest = fw_parent_device(s->unit)->node_id; } - __entry->payload_quadlets = payload_length / sizeof(__be32); - __entry->data_blocks = data_blocks; - __entry->data_block_counter = s->data_block_counter, - __entry->packet_index = s->packet_index; - __entry->irq = !!in_interrupt(); - __entry->index = index; - ), - TP_printk( - "%02u %04u %04x %04x %02d %03u %02u %03u %02u %01u %02u %s", - __entry->second, - __entry->cycle, - __entry->src, - __entry->dest, - __entry->channel, - __entry->payload_quadlets, - __entry->data_blocks, - __entry->data_block_counter, - __entry->packet_index, - __entry->irq, - __entry->index, - __print_array(__get_dynamic_array(cip_header), - __get_dynamic_array_len(cip_header), - sizeof(u8))) -); - -TRACE_EVENT(out_packet, - TP_PROTO(const struct amdtp_stream *s, u32 cycles, const __be32 *cip_header, unsigned int payload_length, unsigned int data_blocks, unsigned int index), - TP_ARGS(s, cycles, cip_header, payload_length, data_blocks, index), - TP_STRUCT__entry( - __field(unsigned int, second) - __field(unsigned int, cycle) - __field(int, channel) - __field(int, src) - __field(int, dest) - __dynamic_array(u8, cip_header, cip_header ? 8 : 0) - __field(unsigned int, payload_quadlets) - __field(unsigned int, data_blocks) - __field(unsigned int, data_block_counter) - __field(unsigned int, packet_index) - __field(unsigned int, irq) - __field(unsigned int, index) - ), - TP_fast_assign( - __entry->second = cycles / CYCLES_PER_SECOND; - __entry->cycle = cycles % CYCLES_PER_SECOND; - __entry->channel = s->context->channel; - __entry->src = fw_parent_device(s->unit)->card->node_id; - __entry->dest = fw_parent_device(s->unit)->node_id; if (cip_header) { memcpy(__get_dynamic_array(cip_header), cip_header, __get_dynamic_array_len(cip_header)); @@ -117,94 +70,6 @@ TRACE_EVENT(out_packet, sizeof(u8))) ); -TRACE_EVENT(in_packet_without_header, - TP_PROTO(const struct amdtp_stream *s, u32 cycles, unsigned int payload_length, unsigned int data_blocks, unsigned int index), - TP_ARGS(s, cycles, payload_length, data_blocks, index), - TP_STRUCT__entry( - __field(unsigned int, second) - __field(unsigned int, cycle) - __field(int, channel) - __field(int, src) - __field(int, dest) - __field(unsigned int, payload_quadlets) - __field(unsigned int, data_blocks) - __field(unsigned int, data_block_counter) - __field(unsigned int, packet_index) - __field(unsigned int, irq) - __field(unsigned int, index) - ), - TP_fast_assign( - __entry->second = cycles / CYCLES_PER_SECOND; - __entry->cycle = cycles % CYCLES_PER_SECOND; - __entry->channel = s->context->channel; - __entry->src = fw_parent_device(s->unit)->node_id; - __entry->dest = fw_parent_device(s->unit)->card->node_id; - __entry->payload_quadlets = payload_length / sizeof(__be32); - __entry->data_blocks = data_blocks, - __entry->data_block_counter = s->data_block_counter, - __entry->packet_index = s->packet_index; - __entry->irq = !!in_interrupt(); - __entry->index = index; - ), - TP_printk( - "%02u %04u %04x %04x %02d %03u %02u %03u %02u %01u %02u", - __entry->second, - __entry->cycle, - __entry->src, - __entry->dest, - __entry->channel, - __entry->payload_quadlets, - __entry->data_blocks, - __entry->data_block_counter, - __entry->packet_index, - __entry->irq, - __entry->index) -); - -TRACE_EVENT(out_packet_without_header, - TP_PROTO(const struct amdtp_stream *s, u32 cycles, unsigned int payload_length, unsigned int data_blocks, unsigned int index), - TP_ARGS(s, cycles, payload_length, data_blocks, index), - TP_STRUCT__entry( - __field(unsigned int, second) - __field(unsigned int, cycle) - __field(int, channel) - __field(int, src) - __field(int, dest) - __field(unsigned int, payload_quadlets) - __field(unsigned int, data_blocks) - __field(unsigned int, data_block_counter) - __field(unsigned int, packet_index) - __field(unsigned int, irq) - __field(unsigned int, index) - ), - TP_fast_assign( - __entry->second = cycles / CYCLES_PER_SECOND; - __entry->cycle = cycles % CYCLES_PER_SECOND; - __entry->channel = s->context->channel; - __entry->src = fw_parent_device(s->unit)->card->node_id; - __entry->dest = fw_parent_device(s->unit)->node_id; - __entry->payload_quadlets = payload_length / sizeof(__be32); - __entry->data_blocks = data_blocks, - __entry->data_block_counter = s->data_block_counter, - __entry->packet_index = s->packet_index; - __entry->irq = !!in_interrupt(); - __entry->index = index; - ), - TP_printk( - "%02u %04u %04x %04x %02d %03u %02u %03u %02u %01u %02u", - __entry->second, - __entry->cycle, - __entry->src, - __entry->dest, - __entry->channel, - __entry->payload_quadlets, - __entry->data_blocks, - __entry->data_block_counter, - __entry->packet_index, - __entry->irq, - __entry->index) -); - #endif #undef TRACE_INCLUDE_PATH diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index 15ae1f2989e5..6b3f936fab91 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -493,7 +493,7 @@ static int handle_out_packet(struct amdtp_stream *s, (s->data_block_counter + data_blocks) & 0xff; payload_length = 8 + data_blocks * 4 * s->data_block_quadlets; - trace_out_packet(s, cycle, buffer, payload_length, data_blocks, index); + trace_amdtp_packet(s, cycle, buffer, payload_length, data_blocks, index); if (queue_out_packet(s, payload_length) < 0) return -EIO; @@ -524,8 +524,7 @@ static int handle_out_packet_without_header(struct amdtp_stream *s, payload_length = data_blocks * 4 * s->data_block_quadlets; - trace_out_packet_without_header(s, cycle, payload_length, data_blocks, - index); + trace_amdtp_packet(s, cycle, NULL, payload_length, data_blocks, index); if (queue_out_packet(s, payload_length) < 0) return -EIO; @@ -633,7 +632,7 @@ static int handle_in_packet(struct amdtp_stream *s, return -EIO; } - trace_in_packet(s, cycle, buffer, payload_length, data_blocks, index); + trace_amdtp_packet(s, cycle, buffer, payload_length, data_blocks, index); syt = be32_to_cpu(buffer[1]) & CIP_SYT_MASK; pcm_frames = s->process_data_blocks(s, buffer + 2, data_blocks, &syt); @@ -666,8 +665,7 @@ static int handle_in_packet_without_header(struct amdtp_stream *s, buffer = s->buffer.packets[s->packet_index].buffer; data_blocks = payload_length / sizeof(__be32) / s->data_block_quadlets; - trace_in_packet_without_header(s, cycle, payload_length, data_blocks, - index); + trace_amdtp_packet(s, cycle, NULL, payload_length, data_blocks, index); pcm_frames = s->process_data_blocks(s, buffer, data_blocks, NULL); s->data_block_counter = (s->data_block_counter + data_blocks) & 0xff;