Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1701540lqa; Mon, 29 Apr 2024 17:14:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWgYDYJwS66BJnllHWs5WxwE1WPe1q9LS+PJ8GzHq9DgllNavtpU9NftH/OtIFjV7pvsoZIpkeagQKtHrhUUZjK4ZF8HtAXtecwC3fRBg== X-Google-Smtp-Source: AGHT+IGpCkeZ+WDFFRKdKrk1f/bwGdG476tGAvEpX9dC92GfKH9/8B7ibrszRG/y/deJior3elHT X-Received: by 2002:a17:906:b7cf:b0:a52:4bde:4999 with SMTP id fy15-20020a170906b7cf00b00a524bde4999mr988187ejb.31.1714436067110; Mon, 29 Apr 2024 17:14:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714436067; cv=pass; d=google.com; s=arc-20160816; b=XMOb421qi7EkWt0xALkW8FZKcu608+qzJvhh0+DA2JQUuQvfRynGrutW2bZ2uOKIkz KT67vZEQGuCnnCTOY+XL40uTzqSz4MbsMoiTdhM2mfLPL8vVXs0NtOsv6kQzUPmNRopy +Aqz7034btNwEwHaeyLlStrfvdx0JFKUkfG1xxieEmURvrR6EEAAOQQJ/CoZ3Ei+rhh3 O583W1ic+ONiJJVgmkjPJIbwkAsQj1M0vTgP8FTK2nymjTzgc5L09R5q4U1FX8eh17cI gvHgJ/fQL1LtjTP1fL8VCTPqrOI4qTxprVbPBuuoTXQ6QSj37LlPeAyYh88Aa4T8IF6c QYIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:feedback-id:dkim-signature:dkim-signature; bh=Hr78+iTtvJXTwj7q8gZRLKxv3nui8iV2ZdOeKx/4HVw=; fh=5EQyDiYgg+kua2A2AF9eJME8jasrrRA/Pgg86y+lzvY=; b=BOAKvq2uxxqVXZxQGE8LEb0pHFHiLMeFiC1Zpz6iMMGTuZ7DQ33KiJmqcihPf3tfay AiIAd6wAYgwKCLQM7jzd4GfwUvwWwzhzt5++DjbX9qSRC3fe9SRGsfO9mPb4VePxSBTc FoiuiJDI7fRJXdH6Y2lVSmG120Fb9NMaIXiF9cER0fgejE7SwY+6kpfmqij6iwFVU+Ik i34zKGGBmqJRM8iNzNu8qoOAySmtbnIucS6bS4dFe0+9zshSu84LkJMhfuIoon5vhrIo wqx4InVv9o0rjGyqgV3sOzX/L7wcg2aYa1/FDrIVh+RaGX+4/o6jN0jXDZ7/Zq0x7UzG 8JYg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sakamocchi.jp header.s=fm3 header.b="dH/If4aI"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=bn77oDCp; arc=pass (i=1 spf=pass spfdomain=sakamocchi.jp dkim=pass dkdomain=sakamocchi.jp dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=sakamocchi.jp); spf=pass (google.com: domain of linux-kernel+bounces-163177-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163177-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sakamocchi.jp Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gr6-20020a170906e2c600b00a58767ff04fsi8632179ejb.861.2024.04.29.17.14.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 17:14:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163177-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@sakamocchi.jp header.s=fm3 header.b="dH/If4aI"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=bn77oDCp; arc=pass (i=1 spf=pass spfdomain=sakamocchi.jp dkim=pass dkdomain=sakamocchi.jp dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=sakamocchi.jp); spf=pass (google.com: domain of linux-kernel+bounces-163177-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163177-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sakamocchi.jp Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A9F701F213A8 for ; Tue, 30 Apr 2024 00:14:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71D091FBB; Tue, 30 Apr 2024 00:14:14 +0000 (UTC) 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 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 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: 8bit 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=0xffff89fb34e42e78 generation=1 first_quadlet=0x00148200 \ second_quadlet=0xffeb7dff async_phy_outbound_complete: \ packet=0xffff89fb34e42e78 generation=1 status=1 timestamp=0x0619 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 @@ #include "core.h" +#include /* * ABI version history is documented in linux/firewire-cdev.h. @@ -1558,6 +1559,9 @@ static void outbound_phy_packet_callback(struct fw_packet *packet, struct client *e_client = e->client; u32 rcode; + trace_async_phy_outbound_complete((uintptr_t)packet, status, packet->generation, + packet->timestamp); + switch (status) { // expected: case ACK_COMPLETE: @@ -1655,6 +1659,9 @@ static int ioctl_send_phy_packet(struct client *client, union ioctl_arg *arg) memcpy(pp->data, a->data, sizeof(a->data)); } + 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); return 0; diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.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); } @@ -501,6 +503,10 @@ void fw_send_phy_config(struct fw_card *card, phy_config_packet.generation = generation; reinit_completion(&phy_config_done); + 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); diff --git a/include/trace/events/firewire.h b/include/trace/events/firewire.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_response_outbound_complete, #undef ASYNC_HEADER_GET_RCODE #undef QUADLET_SIZE +TRACE_EVENT(async_phy_outbound_initiate, + TP_PROTO(u64 packet, unsigned int generation, u32 first_quadlet, u32 second_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 = packet; + __entry->generation = generation; + __entry->first_quadlet = first_quadlet; + __entry->second_quadlet = second_quadlet + ), + TP_printk( + "packet=0x%016llx generation=%u first_quadlet=0x%08x second_quadlet=0x%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, unsigned 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 = packet; + __entry->generation = generation; + __entry->status = status; + __entry->timestamp = timestamp; + ), + TP_printk( + "packet=0x%016llx generation=%u status=%u timestamp=0x%04x", + __entry->packet, + __entry->generation, + __entry->status, + __entry->timestamp + ) +); + #endif // _FIREWIRE_TRACE_EVENT_H #include -- 2.43.0