From nobody Thu Dec 18 18:07:13 2025 Received: from wfhigh5-smtp.messagingengine.com (wfhigh5-smtp.messagingengine.com [64.147.123.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4303A635 for ; Tue, 30 Apr 2024 00:14:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714436053; cv=none; b=K6yyp0eX/A0z5VswlS1pmg/CSeZQa866itp+RE5itmLYFD9pyqatYqALMfvH0Sn7NXZDkKHMlfLBI6/Q1hIZwtcEHJw26vHqEWzYRMN63ygTBpfkyQiYpUGv0FJvLWQt7CFrNaHsiGHlPnk2Dkl09bzB1Xlcwvmxv+KL8b9p2ug= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714436053; c=relaxed/simple; bh=T85yen7HnG+x+lmA6ANvjwm4bTms2b7gFzcgLogpfwY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lU3IhT28sfunz8+tr4gOBIxxIWt2h3Vmgy388aPV7dteBdsf/bDXLqLVB/7gQ4ZWrdbkSurEOPPkGLXzngR4JSTDhQjLMZvrV1CFzRJTspIMO7jP8erk4QTnxVln2VHonVjTnIzmtUZYraWmh0RJOcxMeubiaUlS0Ky8hsKIgMg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp; spf=pass smtp.mailfrom=sakamocchi.jp; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b=dH/If4aI; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=bn77oDCp; arc=none smtp.client-ip=64.147.123.156 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="dH/If4aI"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="bn77oDCp" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.west.internal (Postfix) with ESMTP id 6A2AA1800117; Mon, 29 Apr 2024 20:14:10 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 29 Apr 2024 20:14:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1714436050; x= 1714522450; bh=Hr78+iTtvJXTwj7q8gZRLKxv3nui8iV2ZdOeKx/4HVw=; b=d H/If4aIpp0PqrRHNEJWcIgt3c4HyGXWbGd4F/9YaHr6DrBboQ7c4US2mjGbQuGCQ wZ7VYL0hS15VeY3deLzciybhBdIjlOJrZZsxjrUx3pZOWxtoThkjS5pElzAY1v38 s/32HK1it6WLnYjiTDTbvVfACoMo33o6ivkxguW0F0qwTcOGVlGSOml2Rnmb2k3C 79gDPrYjsVCFv/0dZgmgXJ0hKcby0Rt+Q0iW7i9v68hzY4i3EsM75nE3BQpLO3Ze ci8mxE8jkXc9/2Iwt8fiA7rTliazPqZXTyBopXChDirabbA3CYCzu9XXSsI5PcHH gB2+cV306zgv041SD3kvQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1714436050; x= 1714522450; bh=Hr78+iTtvJXTwj7q8gZRLKxv3nui8iV2ZdOeKx/4HVw=; b=b n77oDCp3NNtWEbqDlGfyALlShZsn9f0SEhOV0IRZYATyHQ2vlgYHvfD0ya3grU7a bAzUz8WFbWrDhx2L/plH+WVZPu86D6Ytmfg9D6EUFACyDTXSw8NQMowvbnUMiHaO KKrAEZf/uFDth4AI3aNYFEi6FKGyxOeETb0KU7nJmK5OEGYfNypaRuCXZxhJjB5i sNX1Fk7G2n8oSS3eRC3UmwE2SzvVWOmVTBs+rDQr+ugIGy592CHgcfnKA/pfFTLK iw6X5mYXGTbEXlMowa14v4wNPlbbfjng33BPdkXrEF7rcfSFbr1iGqLrT9irOdqH vRdiOoEm75g/Dvhof31Yg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdduvddgfedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 29 Apr 2024 20:14:08 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/2] firewire: core/cdev: add tracepoints events for asynchronous phy packet Date: Tue, 30 Apr 2024 09:14:03 +0900 Message-ID: <20240430001404.734657-2-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240430001404.734657-1-o-takashi@sakamocchi.jp> References: <20240430001404.734657-1-o-takashi@sakamocchi.jp> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In IEEE 1394 bus, the type of asynchronous packet without any offset to node address space is called as phy packet. The destination of packet is IEEE 1394 phy itself. This type of packet is used for several purposes, mainly for selfID at the state of bus reset, to force selection of root node, and to adjust gap count. This commit adds tracepoints events for the type of asynchronous outbound packet. Like asynchronous outbound transaction packets, a pair of events are added to trace initiation and completion of transmission. In the case that the phy packet is sent by kernel API, the match between the initiation and completion is not so easy, since the data of 'struct fw_packet' is allocated statically. In the case that it is sent by userspace applications via cdev, the match is easy, since the data is allocated per each. This example is for Remote Access Packet by lsfirewirephy command in linux-firewire-utils: async_phy_outbound_initiate: \ packet=3D0xffff89fb34e42e78 generation=3D1 first_quadlet=3D0x00148200 \ second_quadlet=3D0xffeb7dff async_phy_outbound_complete: \ packet=3D0xffff89fb34e42e78 generation=3D1 status=3D1 timestamp=3D0x0619 Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-cdev.c | 7 +++++ drivers/firewire/core-transaction.c | 6 ++++ include/trace/events/firewire.h | 48 +++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 6274b86eb943..55993c9e0b90 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -35,6 +35,7 @@ =20 =20 #include "core.h" +#include =20 /* * ABI version history is documented in linux/firewire-cdev.h. @@ -1558,6 +1559,9 @@ static void outbound_phy_packet_callback(struct fw_pa= cket *packet, struct client *e_client =3D e->client; u32 rcode; =20 + trace_async_phy_outbound_complete((uintptr_t)packet, status, packet->gene= ration, + packet->timestamp); + switch (status) { // expected: case ACK_COMPLETE: @@ -1655,6 +1659,9 @@ static int ioctl_send_phy_packet(struct client *clien= t, union ioctl_arg *arg) memcpy(pp->data, a->data, sizeof(a->data)); } =20 + trace_async_phy_outbound_initiate((uintptr_t)&e->p, e->p.generation, e->p= .header[1], + e->p.header[2]); + card->driver->send_request(card, &e->p); =20 return 0; diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-tr= ansaction.c index 0e49ebf52500..a828b7167d15 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -463,6 +463,8 @@ static DECLARE_COMPLETION(phy_config_done); static void transmit_phy_packet_callback(struct fw_packet *packet, struct fw_card *card, int status) { + trace_async_phy_outbound_complete((uintptr_t)packet, packet->generation, = status, + packet->timestamp); complete(&phy_config_done); } =20 @@ -501,6 +503,10 @@ void fw_send_phy_config(struct fw_card *card, phy_config_packet.generation =3D generation; reinit_completion(&phy_config_done); =20 + trace_async_phy_outbound_initiate((uintptr_t)&phy_config_packet, + phy_config_packet.generation, phy_config_packet.header[1], + phy_config_packet.header[2]); + card->driver->send_request(card, &phy_config_packet); wait_for_completion_timeout(&phy_config_done, timeout); =20 diff --git a/include/trace/events/firewire.h b/include/trace/events/firewir= e.h index d4688e341837..3ade7d4b9268 100644 --- a/include/trace/events/firewire.h +++ b/include/trace/events/firewire.h @@ -206,6 +206,54 @@ DEFINE_EVENT(async_outbound_complete_template, async_r= esponse_outbound_complete, #undef ASYNC_HEADER_GET_RCODE #undef QUADLET_SIZE =20 +TRACE_EVENT(async_phy_outbound_initiate, + TP_PROTO(u64 packet, unsigned int generation, u32 first_quadlet, u32 seco= nd_quadlet), + TP_ARGS(packet, generation, first_quadlet, second_quadlet), + TP_STRUCT__entry( + __field(u64, packet) + __field(u8, generation) + __field(u32, first_quadlet) + __field(u32, second_quadlet) + ), + TP_fast_assign( + __entry->packet =3D packet; + __entry->generation =3D generation; + __entry->first_quadlet =3D first_quadlet; + __entry->second_quadlet =3D second_quadlet + ), + TP_printk( + "packet=3D0x%016llx generation=3D%u first_quadlet=3D0x%08x second_quadle= t=3D0x%08x", + __entry->packet, + __entry->generation, + __entry->first_quadlet, + __entry->second_quadlet + ) +); + +TRACE_EVENT(async_phy_outbound_complete, + TP_PROTO(u64 packet, unsigned int generation, unsigned int status, unsign= ed int timestamp), + TP_ARGS(packet, generation, status, timestamp), + TP_STRUCT__entry( + __field(u64, packet) + __field(u8, generation) + __field(u8, status) + __field(u16, timestamp) + ), + TP_fast_assign( + __entry->packet =3D packet; + __entry->generation =3D generation; + __entry->status =3D status; + __entry->timestamp =3D timestamp; + ), + TP_printk( + "packet=3D0x%016llx generation=3D%u status=3D%u timestamp=3D0x%04x", + __entry->packet, + __entry->generation, + __entry->status, + __entry->timestamp + ) +); + #endif // _FIREWIRE_TRACE_EVENT_H =20 #include --=20 2.43.0 From nobody Thu Dec 18 18:07:13 2025 Received: from wfout3-smtp.messagingengine.com (wfout3-smtp.messagingengine.com [64.147.123.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 901D410E4 for ; Tue, 30 Apr 2024 00:14:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714436055; cv=none; b=ujr1m+rWT04WWNElyfBxG++OP5wg2OUjS9x7sGRgfI8IjJQjFXLyPXmy6VSjZAYfxU0l2XRpy3fv9D2lNYn77LUlS+HpeNPvEahSJIo7PKEEat5qyPrVsnM9VYritDTfga3s2BY5G+QymkEatyZgEsFxm13FEIbYYovsrFLVZIA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714436055; c=relaxed/simple; bh=f7J7AByp16lTNUyKN3w2Z+wIhLTVdjiRSQubEzdIp2k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P1JPl1e0WB6ZZ6QFqz5xHx5ohfYBUkDzM6RIdquuLY+/7RodfRFqj+ZOMa97hg4rOMr5MdPyRpW0/fvPe8rRiAu9Zt9+Tamt29Ek/JWGvIam0YOZ4czLF9wlxYWZ3Q4OnqRT2kQNmAdUSWIjYXLF+/F6ZblsCIVU5GM9Rpk2DmE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp; spf=pass smtp.mailfrom=sakamocchi.jp; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b=j6fLsFqN; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Lq5o/44I; arc=none smtp.client-ip=64.147.123.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="j6fLsFqN"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Lq5o/44I" Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfout.west.internal (Postfix) with ESMTP id A4FAE1C00139; Mon, 29 Apr 2024 20:14:12 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Mon, 29 Apr 2024 20:14:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1714436052; x= 1714522452; bh=Tp122UnR3pnsKSGpowqnjXWFjoFKONpXEM4cHTo76o0=; b=j 6fLsFqNSmkHgAwtQtHhdEUXfpMCc1/fp5Oj0fTo5C5VPD3AZcgw90C5c07yp9dsv yHhdPdXik6EerF4dnoO8pu1of77RN8CGBDkgBMURu48hR0/Rz2SYC3fIQczGx1ui h1qDp63X+hq72ETsLiB/nyLd7ZxNsXd+KvcRBO9Rsmk36IgUej8dTqNEK0TVrMkB 6ilaBJfOC+dvXRdTQTJMvpPpFLn9TD9dtF/ohos1BO4e7pgESFLgJX5wGfJsjdje Rm8eG8j76J9z4x4PiOdVepYCN2mT65zocQJmnY4rrYb0omve7VRSI3sWh37TApfx 5VJmslt93+8XvLGDmhmWw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1714436052; x= 1714522452; bh=Tp122UnR3pnsKSGpowqnjXWFjoFKONpXEM4cHTo76o0=; b=L q5o/44Ig6XzllntaVdiLyc8Ed3SlU5iXugfIFBL6Zc+IrTZwC++hGpeFjUATDfuk NIivjMPHHEudDPA96k95u16AV4+EK2tDw2aJRH/sEmgVl+rS+33Xw54UPQYK/xu5 40K5dcW8TuSzP9JXDUubHislsaYPrFxveaN5cS1PlZkVZwYQUuan7eFvzoKFndHk Xmr5dHU/HERcptorsNe5rHkOyVCMnNdOj8paI3rVqfcUqKlb411HbKOD+o6UCHkl dTpQflzSpv3AdNAekis1bDsZm+apy0Yn1S2ojWMlv+VsUF9RHMmRJMbGExqzEwPG xL6eaDI+0TQdyS4ePu+7Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdduvddgfedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 29 Apr 2024 20:14:10 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] firewire: core: add tracepoints event for asynchronous inbound phy packet Date: Tue, 30 Apr 2024 09:14:04 +0900 Message-ID: <20240430001404.734657-3-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240430001404.734657-1-o-takashi@sakamocchi.jp> References: <20240430001404.734657-1-o-takashi@sakamocchi.jp> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" At the former commit, a pair of tracepoints events is added to trace asynchronous outbound phy packet. This commit adds a tracepoints event to trace inbound phy packet. It includes transaction status as well as the content of phy packet. This is an example for Remote Reply Packet as a response to Remote Access Packet sent by lsfirewirephy command in linux-firewire-utils: async_phy_inbound: \ packet=3D0xffff955fc02b4e10 generation=3D1 status=3D1 timestamp=3D0x0619 \ first_quadlet=3D0x001c8208 second_quadlet=3D0xffe37df7 Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-transaction.c | 2 ++ include/trace/events/firewire.h | 30 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-tr= ansaction.c index a828b7167d15..d3eefbf23663 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -995,6 +995,8 @@ void fw_core_handle_request(struct fw_card *card, struc= t fw_packet *p) =20 tcode =3D async_header_get_tcode(p->header); if (tcode_is_link_internal(tcode)) { + trace_async_phy_inbound((uintptr_t)p, p->generation, p->ack, p->timestam= p, + p->header[1], p->header[2]); fw_cdev_handle_phy_packet(card, p); return; } diff --git a/include/trace/events/firewire.h b/include/trace/events/firewir= e.h index 3ade7d4b9268..db49b9828bd1 100644 --- a/include/trace/events/firewire.h +++ b/include/trace/events/firewire.h @@ -254,6 +254,36 @@ TRACE_EVENT(async_phy_outbound_complete, ) ); =20 +TRACE_EVENT(async_phy_inbound, + TP_PROTO(u64 packet, unsigned int generation, unsigned int status, unsign= ed int timestamp, u32 first_quadlet, u32 second_quadlet), + TP_ARGS(packet, generation, status, timestamp, first_quadlet, second_quad= let), + TP_STRUCT__entry( + __field(u64, packet) + __field(u8, generation) + __field(u8, status) + __field(u16, timestamp) + __field(u32, first_quadlet) + __field(u32, second_quadlet) + ), + TP_fast_assign( + __entry->packet =3D packet; + __entry->generation =3D generation; + __entry->status =3D status; + __entry->timestamp =3D timestamp; + __entry->first_quadlet =3D first_quadlet; + __entry->second_quadlet =3D second_quadlet + ), + TP_printk( + "packet=3D0x%016llx generation=3D%u status=3D%u timestamp=3D0x%04x first= _quadlet=3D0x%08x second_quadlet=3D0x%08x", + __entry->packet, + __entry->generation, + __entry->status, + __entry->timestamp, + __entry->first_quadlet, + __entry->second_quadlet + ) +); + #endif // _FIREWIRE_TRACE_EVENT_H =20 #include --=20 2.43.0