From nobody Fri Dec 19 03:14:22 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