From nobody Wed Dec 17 17:47:21 2025 Received: from fout3-smtp.messagingengine.com (fout3-smtp.messagingengine.com [103.168.172.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 6178C3611A for ; Tue, 25 Jun 2024 03:18:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719285495; cv=none; b=foPMqbg0i61u1taOP6jz2TtIS7kgtNEITasK9IdJ+prA7SXUuf4QSM6weelkhF5Yq6EalcoUNbbvPOGXpfoFOe/5iMmtiGXAizV1DqR934ZBCi4Jfy/Sftcof0+wHyfqkaAXPu1mEhoAmqrM1Akx3DQVMITC8X2JBQiEyNkfuLk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719285495; c=relaxed/simple; bh=J61cJ8XUrbqstavwbyi35pOU6lObE3n99TW2csmszFE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Cdu6YXUuKPIgDNCq8in0HJPaLpAO4QUq+EKCJDsv+AeMGMu+awdfuGe8l2i2s30yjXe4rFCqfsuXF8oBh/ZHQkMawoxVQBr0SSqmFYCHzNQY9p16mXJXsTJIiXpaUcsJaktwnwurISl2WkSGw8NCAzW2RjPPglbKdSrXllIysho= 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=GATYDxwh; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=JnhrGf2W; arc=none smtp.client-ip=103.168.172.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="GATYDxwh"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="JnhrGf2W" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id 65129138010C; Mon, 24 Jun 2024 23:18:12 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 24 Jun 2024 23:18: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=fm2; t=1719285492; x= 1719371892; bh=qyMxsdeLKsqCGO0IclrxiE5v5YNdkTFLsy/E7mJ/uUg=; b=G ATYDxwhaC5NqW6UoBKFb3sE2bJTcKr/XOjZMHEN3vunVgg16/MmzUmNR3+qpDsHU Ralpauz1yURTIYBUUzJaEvg47s5oCfy6G2u1FUT/e+APm69MpA8V2RsqI3pp2mnF fX8hBf2QrVckwEQBSd0pRfK+ueVfa9KnyUHOLfyCStwaCTk5M0clwBkTSzv44ZYv A7wXPQecCXA7mcz/yFnblj0sxyhcNOmWpS4n9mYd/BvOm/A7Bz8FqZPYr8OSwNO5 an334WTdWW82/5/dVo9WT3DB0du4Xz3EvvELlAeGQmOCBE015gXVaU1CGClKqMs/ xX8IA1mpEPnd55/RZDWng== 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=fm2; t=1719285492; x= 1719371892; bh=qyMxsdeLKsqCGO0IclrxiE5v5YNdkTFLsy/E7mJ/uUg=; b=J nhrGf2WJ/m0L+duIjxZyGDf8ToJ0y6Y94INd2My6VKG15cOi3x3/66TXSKVGUd/l 6Ft2nI7mFI3UHfUoHjQQqorl5liK6caQNgwmbMcEFgvQLD5wJ4rXH1QXG8edJdqY eZoN8f7W6Y59G4zKk9AMLzJE55x6fL5wv+3mKDkVr8+AQ9ekdtcrXKp7LtQsm2cy CTMaYAxh9/1UQA5IKRfqqof3AjC90bCD0FCp6NlFl3soMb421PzdrBmaODFGHiZP X3LrcLXqzl/wQaFGKDOJuIltYhLO6NFRNeb7DxJfT2Uz/GTfZ2O+BZE3rAskYkWJ dmmzHX0cY/WSa5Jn6qvHA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeegvddgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Jun 2024 23:18:11 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/2] firewire: ohci: add support for Linux kernel tracepoints Date: Tue, 25 Jun 2024 12:18:05 +0900 Message-ID: <20240625031806.956650-2-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625031806.956650-1-o-takashi@sakamocchi.jp> References: <20240625031806.956650-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" The Linux Kernel Tracepoints framework is enough useful to trace the interaction between 1394 OHCI hardware and its driver. This commit adds firewire_ohci subsystem to use the framework. It is defined as the different subsystem from the existing firewire subsystem. The definition file for the existing subsystem is slightly changed so that both subsystems are available in 1394 OHCI driver. Signed-off-by: Takashi Sakamoto --- drivers/firewire/ohci.c | 3 +++ include/trace/events/firewire.h | 1 + include/trace/events/firewire_ohci.h | 16 ++++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 include/trace/events/firewire_ohci.h diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index bdb206157118..07adb4ddd444 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -45,6 +45,9 @@ =20 #include =20 +#define CREATE_TRACE_POINTS +#include + #define ohci_info(ohci, f, args...) dev_info(ohci->card.device, f, ##args) #define ohci_notice(ohci, f, args...) dev_notice(ohci->card.device, f, ##a= rgs) #define ohci_err(ohci, f, args...) dev_err(ohci->card.device, f, ##args) diff --git a/include/trace/events/firewire.h b/include/trace/events/firewir= e.h index d9158a134beb..aa00c9f33551 100644 --- a/include/trace/events/firewire.h +++ b/include/trace/events/firewire.h @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later // Copyright (c) 2024 Takashi Sakamoto =20 +#undef TRACE_SYSTEM #define TRACE_SYSTEM firewire =20 #if !defined(_FIREWIRE_TRACE_EVENT_H) || defined(TRACE_HEADER_MULTI_READ) diff --git a/include/trace/events/firewire_ohci.h b/include/trace/events/fi= rewire_ohci.h new file mode 100644 index 000000000000..67fa3c1c8f6d --- /dev/null +++ b/include/trace/events/firewire_ohci.h @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// Copyright (c) 2024 Takashi Sakamoto + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM firewire_ohci + +#if !defined(_FIREWIRE_OHCI_TRACE_EVENT_H) || defined(TRACE_HEADER_MULTI_R= EAD) +#define _FIREWIRE_OHCI_TRACE_EVENT_H + +#include + +// Placeholder for future use. + +#endif // _FIREWIRE_OHCI_TRACE_EVENT_H + +#include --=20 2.43.0 From nobody Wed Dec 17 17:47:21 2025 Received: from fout3-smtp.messagingengine.com (fout3-smtp.messagingengine.com [103.168.172.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 C4C94433CB for ; Tue, 25 Jun 2024 03:18:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719285496; cv=none; b=JdOWbetOPzOdnZvqHmEPFIHhT6JOkqFDRUuxy+thGpP7OOMDOCcYnypQKg8ndn3N/K4sZd6bTqxSGbGHlgyKQN5LndPl49WuBs5BZYJBVOOXL2mFwCeHTqb3gfD+j5r3ABiozSqxpOVRE44/wVC5K5DNSSxEUQB+t+rd4eKe+64= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719285496; c=relaxed/simple; bh=TEIzI4v54LpbFPztuwFa8Mu6aoSZxY7d7Q3K+lgY9us=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Nr/PoRsSA/xa8PgSXVYdSsSfdzpx0WP2V9Gt0BBczPwMLXhJZOy41xu33zPjBpoIljjMYEoxrY0VAEN5glhhl23OklPU/fMc/9H4ddkwZ+yoN2CxDSknutAcNizbdy2OE02m0Ps4TjWJA2DCeidCrSsOhkS7EHZQUH/7FBPJ0qA= 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=TYiX2QH8; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=NPCpq3Ea; arc=none smtp.client-ip=103.168.172.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="TYiX2QH8"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="NPCpq3Ea" Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfout.nyi.internal (Postfix) with ESMTP id E8FAC13800F0; Mon, 24 Jun 2024 23:18:13 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 24 Jun 2024 23:18:13 -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=fm2; t=1719285493; x= 1719371893; bh=mSPkcXLIXHxec9tFgIIwhVMkJhD9BeYdevEsnZ7PZ/o=; b=T YiX2QH8Kz4C3qWWd/SVcj8XJqiQxjMOWQGHbIb3zeyP5MUtvTBENQG88UommJIKC 4mJbIYcIKsrkg/MTCySdpDBXv7yDIbfLNA6iosughbGPk7/ZlY0yfokNYnq6Dt9i EwpfitJJ2ZtL+xHDBJ1J0K0VVqMje+vZ5Urpiu94so/YNVw/RRZjg5dslRnOyFNH MoPJ4Tc9+7jR1Q8rDEDWn2yN9Yn9jEoXm6PMw/ZY/nDtNygcoBSOf1b8HG+1qRz9 sr4cArnVbr5PiADZviRtiykGQmjziFylYIG/tIQQy6FbpKbtxFxSpfW8DR7QvGEt RdDsguMtZAYeZ4TG6F2MA== 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=fm2; t=1719285493; x= 1719371893; bh=mSPkcXLIXHxec9tFgIIwhVMkJhD9BeYdevEsnZ7PZ/o=; b=N PCpq3EahVlcRjdX/gxyy0xfINKTn1Q99ymb/s6F0J7nno0YHBA6Dw3Q4gKYinfgy XjB58sVAeqp9h0wizEujcLzEnaYgX8QeWDR9nqpR/3/pcAh9d2EbhDW5UJyHeGp3 0V9Z4dWbkYBAEtwXU0Jt51ikx/iVdwyO1U47A5kC/tPZK+F6JVaWv2uqSxd2/WRp L9AvXtTpejFbzBpp8kCrIVZdEmn+03raDjhVuCEzpE6lk7dk0+V8POUQSr9ZSbD4 einRzgAM1H444qNnY0a8RjngWrWpakJJtH9t2eorPk2dylJyXVpznIrOVLdZgUPj hYvvcjsgQnjJtL1MLFQWw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeegvddgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Jun 2024 23:18:12 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] firewire: ohci: add tracepoints event for hardIRQ event Date: Tue, 25 Jun 2024 12:18:06 +0900 Message-ID: <20240625031806.956650-3-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625031806.956650-1-o-takashi@sakamocchi.jp> References: <20240625031806.956650-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" 1394 OHCI hardware triggers PCI interrupts to notify any events to software. Current driver for the hardware is programmed by the typical way to utilize top- and bottom- halves, thus it has a timing gap to handle the notification in softIRQ (tasklet). This commit adds a tracepoint event for the hardIRQ event. The comparison of the tracepoint event to tracepoints events in firewire subsystem is helpful to diagnose the timing gap. Signed-off-by: Takashi Sakamoto --- drivers/firewire/ohci.c | 1 + include/trace/events/firewire_ohci.h | 33 +++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 07adb4ddd444..df16a8f4ee7f 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -2185,6 +2185,7 @@ static irqreturn_t irq_handler(int irq, void *data) */ reg_write(ohci, OHCI1394_IntEventClear, event & ~(OHCI1394_busReset | OHCI1394_postedWriteErr)); + trace_irqs(ohci->card.index, event); log_irqs(ohci, event); // The flag is masked again at bus_reset_work() scheduled by selfID event. if (event & OHCI1394_busReset) diff --git a/include/trace/events/firewire_ohci.h b/include/trace/events/fi= rewire_ohci.h index 67fa3c1c8f6d..483aeeb033af 100644 --- a/include/trace/events/firewire_ohci.h +++ b/include/trace/events/firewire_ohci.h @@ -9,7 +9,38 @@ =20 #include =20 -// Placeholder for future use. +TRACE_EVENT(irqs, + TP_PROTO(unsigned int card_index, u32 events), + TP_ARGS(card_index, events), + TP_STRUCT__entry( + __field(u8, card_index) + __field(u32, events) + ), + TP_fast_assign( + __entry->card_index =3D card_index; + __entry->events =3D events; + ), + TP_printk( + "card_index=3D%u events=3D%s", + __entry->card_index, + __print_flags(__entry->events, "|", + { OHCI1394_selfIDComplete, "selfIDComplete" }, + { OHCI1394_RQPkt, "RQPkt" }, + { OHCI1394_RSPkt, "RSPkt" }, + { OHCI1394_reqTxComplete, "reqTxComplete" }, + { OHCI1394_respTxComplete, "respTxComplete" }, + { OHCI1394_isochRx, "isochRx" }, + { OHCI1394_isochTx, "isochTx" }, + { OHCI1394_postedWriteErr, "postedWriteErr" }, + { OHCI1394_cycleTooLong, "cycleTooLong" }, + { OHCI1394_cycle64Seconds, "cycle64Seconds" }, + { OHCI1394_cycleInconsistent, "cycleInconsistent" }, + { OHCI1394_regAccessFail, "regAccessFail" }, + { OHCI1394_unrecoverableError, "unrecoverableError" }, + { OHCI1394_busReset, "busReset" } + ) + ) +); =20 #endif // _FIREWIRE_OHCI_TRACE_EVENT_H =20 --=20 2.43.0