From nobody Tue Dec 16 19:44:53 2025 Received: from fout1-smtp.messagingengine.com (fout1-smtp.messagingengine.com [103.168.172.144]) (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 7D84718508D for ; Sun, 23 Jun 2024 22:09:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.144 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719180549; cv=none; b=evBssix/WgJWk4IqUdNiWJZe07hAg+AcR2IUiJLiKnnWstLvAXGo6tMNWrhwxcvI9KZQdiHUPOdH4q6hHwIkB9P6R9Aq3FIqK6XWDHKjzn8XMYAaKDieLdtLlh5TzoHQD6w99kP1ymosQ9zpCOn1rluS5+S2eagbNJ3BwshN+GY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719180549; c=relaxed/simple; bh=XJFw1xMnMXR2LHmRhzOLGhcnU619r3UCq1C7J9NU/xw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nI8mzT8EwB+r+wbNEd7tBL/eqHNJVqdbFaQrPPbPOvZDf9S6QFrQFlnKPkXSbUpO9NOZtEg08mbz1irjflSdkwT867jQ1VWX9ktYEf6O99sBfA0V5txwoDIDCsIj5hU3j21b2v2e7F/fg/K+kGbxbQ4yirJgrLrtytEsgLEOV5Q= 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=bL4dBHfY; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=svkd+hGR; arc=none smtp.client-ip=103.168.172.144 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="bL4dBHfY"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="svkd+hGR" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id 87C7C1380230; Sun, 23 Jun 2024 18:09:06 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 23 Jun 2024 18:09:06 -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=1719180546; x= 1719266946; bh=4jv+vH9w4muGcg/CaV1mNrjjlpC8b6fJLqUg5lO7nd8=; b=b L4dBHfY9jNVzuFy/lfbTazdIWgx4o/l7Bx2VpdSJiZtB+kAVAVAADr8ahUNyWRqp aF69/jKl2M0Iv+Kb35ZFMUti2MrCZgPdXzpjCXs+6Q+QUMhsXD1INtIhhiioIGQV ilsS0YCeOHuHGKZrC/S8S30ge+Ik4A36/n6N8qTnCljkctBwXmbxovq5I2jYUNwL WbjMIL4axQT5LN4eji9AiHkz0pa9RKpXU6+er6UtFvy16yYqv8lZ3Ob8+XEjS3yr g1NC/WRnWQ4iw0Zm2zg2aLrcLTEEvjBkTsgmmw8ZNNl8p9rx1PiCK7lpx2VtxkFb ZVdWhln/AxbRaN+iWkg+A== 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=1719180546; x= 1719266946; bh=4jv+vH9w4muGcg/CaV1mNrjjlpC8b6fJLqUg5lO7nd8=; b=s vkd+hGRkKbx5V8pLbMMmTF6WW/Lr1SdFfsApmPP6pp3DgN5I4sS2swc++xyaAobC VUXcHWzaADMZAiBd3S7i90caufHSWBbP6P7ljUcDCSIVCBbhqDZlcS9x9NO3NiuS xq4s8CStvlgW2FoaPW80HYA4ijLQAnktQvvKafbb3m/F0IfZf704N2enA3beD2wv SuQkPGlol2Om9GMA42iAOOcVMa6K/Y4yaRAcc7bmyQklD2lEc7LxNq4hNGMmV96B mgUOn858WZYj9FvAYJMiiJWcn1Vd+OivjiOSEeLZALaqnYjh9Il5dNprEHFsH4ZO orJmoxw20qDdsY9iKlOKQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeegtddgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 23 Jun 2024 18:09:05 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/7] firewire: core: add tracepoints events for allocation/deallocation of isochronous context Date: Mon, 24 Jun 2024 07:08:52 +0900 Message-ID: <20240623220859.851685-2-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240623220859.851685-1-o-takashi@sakamocchi.jp> References: <20240623220859.851685-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" It is helpful to trace the allocation and dealocation of isochronous when the core function is requested them by both in-kernel unit drivers and userspace applications. This commit adds some tracepoints events for the aim. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-iso.c | 10 +++ include/trace/events/firewire.h | 105 ++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c index af70e74f9a7e..ddb999297c72 100644 --- a/drivers/firewire/core-iso.c +++ b/drivers/firewire/core-iso.c @@ -22,6 +22,8 @@ =20 #include "core.h" =20 +#include + /* * Isochronous DMA context management */ @@ -148,12 +150,20 @@ struct fw_iso_context *fw_iso_context_create(struct f= w_card *card, ctx->callback.sc =3D callback; ctx->callback_data =3D callback_data; =20 + trace_isoc_outbound_allocate(ctx, channel, speed); + trace_isoc_inbound_single_allocate(ctx, channel, header_size); + trace_isoc_inbound_multiple_allocate(ctx); + return ctx; } EXPORT_SYMBOL(fw_iso_context_create); =20 void fw_iso_context_destroy(struct fw_iso_context *ctx) { + trace_isoc_outbound_destroy(ctx); + trace_isoc_inbound_single_destroy(ctx); + trace_isoc_inbound_multiple_destroy(ctx); + ctx->card->driver->free_iso_context(ctx); } EXPORT_SYMBOL(fw_iso_context_destroy); diff --git a/include/trace/events/firewire.h b/include/trace/events/firewir= e.h index 25289a063deb..0cca1ef841f3 100644 --- a/include/trace/events/firewire.h +++ b/include/trace/events/firewire.h @@ -436,6 +436,111 @@ TRACE_EVENT(self_id_sequence, #undef PHY_PACKET_SELF_ID_GET_POWER_CLASS #undef PHY_PACKET_SELF_ID_GET_INITIATED_RESET =20 +TRACE_EVENT_CONDITION(isoc_outbound_allocate, + TP_PROTO(const struct fw_iso_context *ctx, unsigned int channel, unsigned= int scode), + TP_ARGS(ctx, channel, scode), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_TRANSMIT), + TP_STRUCT__entry( + __field(u64, context) + __field(u8, card_index) + __field(u8, channel) + __field(u8, scode) + ), + TP_fast_assign( + __entry->context =3D (uintptr_t)ctx; + __entry->card_index =3D ctx->card->index; + __entry->channel =3D channel; + __entry->scode =3D scode; + ), + TP_printk( + "context=3D0x%llx card_index=3D%u channel=3D%u scode=3D%u", + __entry->context, + __entry->card_index, + __entry->channel, + __entry->scode + ) +); + +TRACE_EVENT_CONDITION(isoc_inbound_single_allocate, + TP_PROTO(const struct fw_iso_context *ctx, unsigned int channel, unsigned= int header_size), + TP_ARGS(ctx, channel, header_size), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE), + TP_STRUCT__entry( + __field(u64, context) + __field(u8, card_index) + __field(u8, channel) + __field(u8, header_size) + ), + TP_fast_assign( + __entry->context =3D (uintptr_t)ctx; + __entry->card_index =3D ctx->card->index; + __entry->channel =3D channel; + __entry->header_size =3D header_size; + ), + TP_printk( + "context=3D0x%llx card_index=3D%u channel=3D%u header_size=3D%u", + __entry->context, + __entry->card_index, + __entry->channel, + __entry->header_size + ) +); + +TRACE_EVENT_CONDITION(isoc_inbound_multiple_allocate, + TP_PROTO(const struct fw_iso_context *ctx), + TP_ARGS(ctx), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL), + TP_STRUCT__entry( + __field(u64, context) + __field(u8, card_index) + ), + TP_fast_assign( + __entry->context =3D (uintptr_t)ctx; + __entry->card_index =3D ctx->card->index; + ), + TP_printk( + "context=3D0x%llx card_index=3D%u", + __entry->context, + __entry->card_index + ) +); + +DECLARE_EVENT_CLASS(isoc_destroy_template, + TP_PROTO(const struct fw_iso_context *ctx), + TP_ARGS(ctx), + TP_STRUCT__entry( + __field(u64, context) + __field(u8, card_index) + ), + TP_fast_assign( + __entry->context =3D (uintptr_t)ctx; + __entry->card_index =3D ctx->card->index; + ), + TP_printk( + "context=3D0x%llx card_index=3D%u", + __entry->context, + __entry->card_index + ) +) + +DEFINE_EVENT_CONDITION(isoc_destroy_template, isoc_outbound_destroy, + TP_PROTO(const struct fw_iso_context *ctx), + TP_ARGS(ctx), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_TRANSMIT) +); + +DEFINE_EVENT_CONDITION(isoc_destroy_template, isoc_inbound_single_destroy, + TP_PROTO(const struct fw_iso_context *ctx), + TP_ARGS(ctx), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE) +); + +DEFINE_EVENT_CONDITION(isoc_destroy_template, isoc_inbound_multiple_destro= y, + TP_PROTO(const struct fw_iso_context *ctx), + TP_ARGS(ctx), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL) +); + #undef QUADLET_SIZE =20 #endif // _FIREWIRE_TRACE_EVENT_H --=20 2.43.0 From nobody Tue Dec 16 19:44:53 2025 Received: from fout1-smtp.messagingengine.com (fout1-smtp.messagingengine.com [103.168.172.144]) (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 7A1BE1850B9 for ; Sun, 23 Jun 2024 22:09:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.144 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719180551; cv=none; b=RRjMlDtakhFGCAjo6gSESU9iLwW6vhJjTcv+TJ7N2B1GIHA177SagM2COiXlXswIxOeBS0y5cqKfiTMtAKVO0+3P97Y4CyH++UBIN3bk5S1ep3ZW9KVl3qC1K2J2P6+XCOWs/kGat3BMvA9czw/hG4XTmatPNKG5b4zKmHhUhGs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719180551; c=relaxed/simple; bh=HXrtdMUXU39wpFP+4ZpRUgY7DK+YqaxnrygaUGqq2k8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dUjKP9YwXfFIHwFNDAUQ1Z2AAb8lJhOzOS6PLDnEgbPqqSqvGglZC5A13hl2YI0Fe2de1gqPggxV9JzFAVa0sgz52MVa8OE8yZ+CDmXP8CoX/p/+mVgwKAt1LAbX3PNfkvgcglJwoayvvKWVduCJKPq9MbzxIt/tIfrY/Nq59Vk= 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=POKsJ8Hz; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=AvIQiElL; arc=none smtp.client-ip=103.168.172.144 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="POKsJ8Hz"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="AvIQiElL" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id 77EF8138022D; Sun, 23 Jun 2024 18:09:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sun, 23 Jun 2024 18:09:08 -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=1719180548; x= 1719266948; bh=WCYv0QpMzYje5FW2V+N1G/dKlMR0j9LxZBRZVImqLBc=; b=P OKsJ8HzyQF7U8fIh+Npa1z131vIyr9so5aJRtWSmp+4dCJFD0pVbo76G6I6KP1qb Zzgyzim6XI9Z68oFEF2LzNO4JGWVoFLEopJYJcJnQXk9jUysjuaJ2SkhC+khoug3 OKWvuB0MMTSFgpJSvRdOaYCXwx7iQGRKQyV8r6yHHXJxBbHGBEb5modsQ9ehYqQb 6Qw2xI9unUgWwjftK4noyqTGKXsJMaIIfS6jBKZ5Rx3D8bPKy7ChUwII7V3JSgBR Tgm9PiZqBc1mv8jh+5dG5UI58qqPXWUEWHEilWToxCiDc3nw5B7nxwmWiLgXEOGh iE/0TAZXfw6LG7RRhsy/A== 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=1719180548; x= 1719266948; bh=WCYv0QpMzYje5FW2V+N1G/dKlMR0j9LxZBRZVImqLBc=; b=A vIQiElLcy5LFYPIePEummmHGY8n+b894HsXt4RL62lcH9kVV55sS/DMd60ibaRg9 m93if47vKqeD9BSnAk923JhIekeLHWUk8mFsZhLhNPNEdUCWkpfOpOE0y/1DyX1b cNVOsFeHFl/O8NNJxKPdEur980Y7k6tq5JUA9282bQzDjl/4y7xC2CCPjY8f2XvI k58ySyW8AauSpAX+6SNkbpbXcUZbpq/Kc5m2zxP6+HIcLU+Ra99+JP98c8rdBDKh ZJ1xm3nU5Tr/jm/cp4R/pC+IE0Yrlg/8aVi6YF3caF08iLR5B+/DCD1P/HUexCNR XmeIL2imyNZrKUJvbC+6Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeegtddgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 23 Jun 2024 18:09:06 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/7] firewire: core: add tracepoints events for setting channels of multichannel context Date: Mon, 24 Jun 2024 07:08:53 +0900 Message-ID: <20240623220859.851685-3-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240623220859.851685-1-o-takashi@sakamocchi.jp> References: <20240623220859.851685-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" It is helpful to trace the channel setting for the multichannel isochronous context when the core function is requested it by both in-kernel unit drivers and userspace applications. This commit adds some tracepoints events for the aim. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-iso.c | 2 ++ include/trace/events/firewire.h | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c index ddb999297c72..7ec84de846e6 100644 --- a/drivers/firewire/core-iso.c +++ b/drivers/firewire/core-iso.c @@ -177,6 +177,8 @@ EXPORT_SYMBOL(fw_iso_context_start); =20 int fw_iso_context_set_channels(struct fw_iso_context *ctx, u64 *channels) { + trace_isoc_inbound_multiple_channels(ctx, *channels); + return ctx->card->driver->set_iso_channels(ctx, channels); } =20 diff --git a/include/trace/events/firewire.h b/include/trace/events/firewir= e.h index 0cca1ef841f3..0334e02f9d94 100644 --- a/include/trace/events/firewire.h +++ b/include/trace/events/firewire.h @@ -541,6 +541,27 @@ DEFINE_EVENT_CONDITION(isoc_destroy_template, isoc_inb= ound_multiple_destroy, TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL) ); =20 +TRACE_EVENT(isoc_inbound_multiple_channels, + TP_PROTO(const struct fw_iso_context *ctx, u64 channels), + TP_ARGS(ctx, channels), + TP_STRUCT__entry( + __field(u64, context) + __field(u8, card_index) + __field(u64, channels) + ), + TP_fast_assign( + __entry->context =3D (uintptr_t)ctx; + __entry->card_index =3D ctx->card->index; + __entry->channels =3D channels; + ), + TP_printk( + "context=3D0x%llx card_index=3D%u channels=3D0x%016llx", + __entry->context, + __entry->card_index, + __entry->channels + ) +); + #undef QUADLET_SIZE =20 #endif // _FIREWIRE_TRACE_EVENT_H --=20 2.43.0 From nobody Tue Dec 16 19:44:53 2025 Received: from fout1-smtp.messagingengine.com (fout1-smtp.messagingengine.com [103.168.172.144]) (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 ED871185E66 for ; Sun, 23 Jun 2024 22:09:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.144 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719180552; cv=none; b=Kva24Yl17T+KZE7DS4dC+w5VaWN2MJbcETX8tdnqIiyFu4IOt109EE/SUEyk8j1k9YZBEW9J6Gld1AwPMP4JhTy3l5HBf6r7lwew7KEy9sdwZL+2+wcj6kQ1Vqa4VTIRY2MvPXQqUp50Ou/riywfknAruCabG0AMW2boQwvRVGc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719180552; c=relaxed/simple; bh=UHZf4DkIz3as8Oybk157dv9ChvYFm9Xg6KnMsa6QnDM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Pqe3w/4316hxXoyWTFaE6BCmpcmNZEOpmPrgAP3bZWiLGSNOnvLIchYFuIzZ+5+nX6Kbm+uNPrPtQk1W0nBCfySFAsnvTO8Vs2fY1Id6WM2AfCTdmtoHksn9rZ7K2mEfmOr0j8nyGFzDiNuvycq4zLdB7/UmZUgs1BiRt+BYV7s= 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=TF3yDkXf; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=KMqvP78S; arc=none smtp.client-ip=103.168.172.144 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="TF3yDkXf"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="KMqvP78S" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id 040171380232; Sun, 23 Jun 2024 18:09:10 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 23 Jun 2024 18:09: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=fm2; t=1719180550; x= 1719266950; bh=AvtSoU7JkDe4YxYSHa6AAW4/NgOQlPr+OLHzR+pHBxM=; b=T F3yDkXffdBoyOKifVdzrSFLRuGBTG4IS1ampLDU3MZDXdDN+D41a8s2NZYwWhlFQ irSBf3OSVRFsKPgiwWvSvUAIqAD1A49SrElTylwgFma4vMrZwdY7LjZwxexyrpHQ chRUvtRvLvPV89giRsrM0C3X3FVlf/+P4wp/eOhSqUJMYbKFvsOMJkyA/wbu0j+3 2Ob1tVjnv6HkBpa0bodgxj4t2nXapn6CMpcB5t7hvm26hH8stuz7FSS/MriD5vUO uYNjJOdhjZMsr9BwS0FOgZcX1L0jMJ3KkcdaPNd+BxX8Izsna/pXKatIsPDMgfL6 hBJNbn6ZPhaE1NntYttmA== 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=1719180550; x= 1719266950; bh=AvtSoU7JkDe4YxYSHa6AAW4/NgOQlPr+OLHzR+pHBxM=; b=K MqvP78SZ7XUbLLQKokCJZQVUVv2zq1bNt/hZxNs4apBlFyzu1xh8xd3477PObgSG 47x7pqSmox4kO8qA6Oi6S2+OqoHhR0RpL6kRREhAW78GgztGcMhRaI5lW324j5sE Y0S+I74tPBY2BokjTCR12de2AmMl6ZilMP3GJSzZGj8TdYkNYqYdOAdjltr2ivjg xFQ12S4qDbeIKnKXL7gNw+kphQp8gvzh6MMYLZPY20gwih0+vZXXCo66QYlpDWh+ /nxu6IpfRFIqdp2HoVqS8aar1O1QiMEwFCkeqzsqXJcbAG1IeMJKdiMahY2E3hkt 4texSQTa4ce2DccWHOnHg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeegtddgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 23 Jun 2024 18:09:08 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 3/7] firewire: core: add tracepoints events for starting/stopping of isochronous context Date: Mon, 24 Jun 2024 07:08:54 +0900 Message-ID: <20240623220859.851685-4-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240623220859.851685-1-o-takashi@sakamocchi.jp> References: <20240623220859.851685-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" It is helpful to trace the starting and stopping of isochronous context when the core function is requested them by both in-kernel unit drivers and userspace applications. This commit adds some tracepoints events for the aim. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-iso.c | 8 +++ include/trace/events/firewire.h | 108 ++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c index 7ec84de846e6..49feb4c28224 100644 --- a/drivers/firewire/core-iso.c +++ b/drivers/firewire/core-iso.c @@ -171,6 +171,10 @@ EXPORT_SYMBOL(fw_iso_context_destroy); int fw_iso_context_start(struct fw_iso_context *ctx, int cycle, int sync, int tags) { + trace_isoc_outbound_start(ctx, cycle); + trace_isoc_inbound_single_start(ctx, cycle, sync, tags); + trace_isoc_inbound_multiple_start(ctx, cycle, sync, tags); + return ctx->card->driver->start_iso(ctx, cycle, sync, tags); } EXPORT_SYMBOL(fw_iso_context_start); @@ -205,6 +209,10 @@ EXPORT_SYMBOL(fw_iso_context_flush_completions); =20 int fw_iso_context_stop(struct fw_iso_context *ctx) { + trace_isoc_outbound_stop(ctx); + trace_isoc_inbound_single_stop(ctx); + trace_isoc_inbound_multiple_stop(ctx); + return ctx->card->driver->stop_iso(ctx); } EXPORT_SYMBOL(fw_iso_context_stop); diff --git a/include/trace/events/firewire.h b/include/trace/events/firewir= e.h index 0334e02f9d94..c984b7d6380f 100644 --- a/include/trace/events/firewire.h +++ b/include/trace/events/firewire.h @@ -562,6 +562,114 @@ TRACE_EVENT(isoc_inbound_multiple_channels, ) ); =20 +TRACE_EVENT_CONDITION(isoc_outbound_start, + TP_PROTO(const struct fw_iso_context *ctx, int cycle_match), + TP_ARGS(ctx, cycle_match), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_TRANSMIT), + TP_STRUCT__entry( + __field(u64, context) + __field(u8, card_index) + __field(bool, cycle_match) + __field(u16, cycle) + ), + TP_fast_assign( + __entry->context =3D (uintptr_t)ctx; + __entry->card_index =3D ctx->card->index; + __entry->cycle_match =3D cycle_match < 0 ? false : true; + __entry->cycle =3D __entry->cycle_match ? (u16)cycle_match : 0; + ), + TP_printk( + "context=3D0x%llx card_index=3D%u cycle_match=3D%s cycle=3D0x%04x", + __entry->context, + __entry->card_index, + __entry->cycle_match ? "true" : "false", + __entry->cycle + ) +); + +DECLARE_EVENT_CLASS(isoc_inbound_start_template, + TP_PROTO(const struct fw_iso_context *ctx, int cycle_match, unsigned int = sync, unsigned int tags), + TP_ARGS(ctx, cycle_match, sync, tags), + TP_STRUCT__entry( + __field(u64, context) + __field(u8, card_index) + __field(bool, cycle_match) + __field(u16, cycle) + __field(u8, sync) + __field(u8, tags) + ), + TP_fast_assign( + __entry->context =3D (uintptr_t)ctx; + __entry->card_index =3D ctx->card->index; + __entry->cycle_match =3D cycle_match < 0 ? false : true; + __entry->cycle =3D __entry->cycle_match ? (u16)cycle_match : 0; + __entry->sync =3D sync; + __entry->tags =3D tags; + ), + TP_printk( + "context=3D0x%llx card_index=3D%u cycle_match=3D%s cycle=3D0x%04x sync= =3D%u tags=3D%s", + __entry->context, + __entry->card_index, + __entry->cycle_match ? "true" : "false", + __entry->cycle, + __entry->sync, + __print_flags(__entry->tags, "|", + { FW_ISO_CONTEXT_MATCH_TAG0, "0" }, + { FW_ISO_CONTEXT_MATCH_TAG1, "1" }, + { FW_ISO_CONTEXT_MATCH_TAG2, "2" }, + { FW_ISO_CONTEXT_MATCH_TAG3, "3" } + ) + ) +); + +DEFINE_EVENT_CONDITION(isoc_inbound_start_template, isoc_inbound_single_st= art, + TP_PROTO(const struct fw_iso_context *ctx, int cycle_match, unsigned int = sync, unsigned int tags), + TP_ARGS(ctx, cycle_match, sync, tags), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE) +); + +DEFINE_EVENT_CONDITION(isoc_inbound_start_template, isoc_inbound_multiple_= start, + TP_PROTO(const struct fw_iso_context *ctx, int cycle_match, unsigned int = sync, unsigned int tags), + TP_ARGS(ctx, cycle_match, sync, tags), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL) +); + +DECLARE_EVENT_CLASS(isoc_stop_template, + TP_PROTO(const struct fw_iso_context *ctx), + TP_ARGS(ctx), + TP_STRUCT__entry( + __field(u64, context) + __field(u8, card_index) + ), + TP_fast_assign( + __entry->context =3D (uintptr_t)ctx; + __entry->card_index =3D ctx->card->index; + ), + TP_printk( + "context=3D0x%llx card_index=3D%u", + __entry->context, + __entry->card_index + ) +) + +DEFINE_EVENT_CONDITION(isoc_stop_template, isoc_outbound_stop, + TP_PROTO(const struct fw_iso_context *ctx), + TP_ARGS(ctx), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_TRANSMIT) +); + +DEFINE_EVENT_CONDITION(isoc_stop_template, isoc_inbound_single_stop, + TP_PROTO(const struct fw_iso_context *ctx), + TP_ARGS(ctx), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE) +); + +DEFINE_EVENT_CONDITION(isoc_stop_template, isoc_inbound_multiple_stop, + TP_PROTO(const struct fw_iso_context *ctx), + TP_ARGS(ctx), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL) +); + #undef QUADLET_SIZE =20 #endif // _FIREWIRE_TRACE_EVENT_H --=20 2.43.0 From nobody Tue Dec 16 19:44:53 2025 Received: from fout1-smtp.messagingengine.com (fout1-smtp.messagingengine.com [103.168.172.144]) (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 7B2541862A3 for ; Sun, 23 Jun 2024 22:09:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.144 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719180554; cv=none; b=MacRvmoQLF7hgl4uHy91Py8B3q5kQSCzjcejIuwuepOBLQDwaOSXXvSp7+sa+OIPIPvSfy4J+8tN9/MW7nO1+cXwzh4e+L8wpuXATM/EPPucz0d1PoE2SEyjcuwwULXobMeAvcl1R+e6h3S6Du8pjPcY+C0a17D2uq6QG43Xo7g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719180554; c=relaxed/simple; bh=CQ6NzmF9egpcqvZCRqIyhgjTx6e9q2/Ev2fAB6oinL8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A9gIr1OFemaRNxVeOqJnE3E2SgxMKqzEiBtHyHbYWPYpmlYMF1/pVg4lhAI9MhhXcRyNM6h/JeJHqSHMFkanpzpVaIgO/mmkiY/rn8vig9OZpJyMC5dX2dM3sXrkOTKL8FABiBrkXuoaNnedPDVZj16mmNxNS+bQhM6y5euD46k= 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=jXJ4mpZl; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=kHzSj2sb; arc=none smtp.client-ip=103.168.172.144 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="jXJ4mpZl"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="kHzSj2sb" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id 8266F1380233; Sun, 23 Jun 2024 18:09:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sun, 23 Jun 2024 18:09:11 -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=1719180551; x= 1719266951; bh=vrAz9favDBg/4g1lGjoFO1edTxLzgyyvZvPQK9eEMNc=; b=j XJ4mpZlZ5dBJbjgmJhE4nUhnyUdOa7KsSL45cckZV+hCLfbZfnp++TX4YtXUQyDe mMDE7g8Ll3b9gNUAIt6+cjZwSHdCEv5OYsBcsHf7wEQQuPXdD/MeXHjmOlEfYwaP ycD8/HHkwWyFBl7eM55C4L92Ef0zZFZtPpYfMxyfUlUwOq2XMIHKQNQp2P47bI+B IljBQUYYKXvW7UNVAHSg2XTv6kmv+wbp8My1OcJlg0xALAFckPz7MQC+XwxGQ50c 7FAS/6pwbsspK6VGKB54gZZ86TEhD5F7VLpkwD96aaZ1IfmUTwWgbfAc1I8PjrG3 9CoohDdDr6FlfaAT0BKAQ== 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=1719180551; x= 1719266951; bh=vrAz9favDBg/4g1lGjoFO1edTxLzgyyvZvPQK9eEMNc=; b=k HzSj2sb45KzER1tg7D1be/vhCesFlEPIsUX276cnyX5S5rpa8MUjUP9Qjl7Eia9Y 48JojUXjznWL+ggK+8SW51QecR3FyhBdYzCoAfttR/t/i+Nnq4zp+Q/gn2iTHBDB /0B/HKLm3z/t/OXi2YBKSwUxisVOddG9qtITHJs3SAmOQWMlxXT6pxjVG28Kc3tN MxYNVmaYuc3QZR8/2IzIn0pA0UJm5ZROOIPzgRqhuk+LtoqEWz1rFhJG53JWHMkg X+30p7DP5Vm6rUf3TU2TKnNpCAlK1FrX58EUtJZrPVBeeXP0HC7zw42ggYGtRLjb DKI+CP/Jsl/X1gV6CtP3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeegtddgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 23 Jun 2024 18:09:10 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 4/7] firewire: core: add tracepoints events for flushing of isochronous context Date: Mon, 24 Jun 2024 07:08:55 +0900 Message-ID: <20240623220859.851685-5-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240623220859.851685-1-o-takashi@sakamocchi.jp> References: <20240623220859.851685-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" It is helpful to trace the flushing of isochronous context when the core function is requested them by both in-kernel unit drivers and userspace applications. This commit adds some tracepoints events for the aim. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-iso.c | 4 ++++ include/trace/events/firewire.h | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c index 49feb4c28224..5bad23fcce0c 100644 --- a/drivers/firewire/core-iso.c +++ b/drivers/firewire/core-iso.c @@ -197,6 +197,10 @@ EXPORT_SYMBOL(fw_iso_context_queue); =20 void fw_iso_context_queue_flush(struct fw_iso_context *ctx) { + trace_isoc_outbound_flush(ctx); + trace_isoc_inbound_single_flush(ctx); + trace_isoc_inbound_multiple_flush(ctx); + ctx->card->driver->flush_queue_iso(ctx); } EXPORT_SYMBOL(fw_iso_context_queue_flush); diff --git a/include/trace/events/firewire.h b/include/trace/events/firewir= e.h index c984b7d6380f..b404e6324671 100644 --- a/include/trace/events/firewire.h +++ b/include/trace/events/firewire.h @@ -670,6 +670,42 @@ DEFINE_EVENT_CONDITION(isoc_stop_template, isoc_inboun= d_multiple_stop, TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL) ); =20 +DECLARE_EVENT_CLASS(isoc_flush_template, + TP_PROTO(const struct fw_iso_context *ctx), + TP_ARGS(ctx), + TP_STRUCT__entry( + __field(u64, context) + __field(u8, card_index) + ), + TP_fast_assign( + __entry->context =3D (uintptr_t)ctx; + __entry->card_index =3D ctx->card->index; + ), + TP_printk( + "context=3D0x%llx card_index=3D%u", + __entry->context, + __entry->card_index + ) +); + +DEFINE_EVENT_CONDITION(isoc_flush_template, isoc_outbound_flush, + TP_PROTO(const struct fw_iso_context *ctx), + TP_ARGS(ctx), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_TRANSMIT) +); + +DEFINE_EVENT_CONDITION(isoc_flush_template, isoc_inbound_single_flush, + TP_PROTO(const struct fw_iso_context *ctx), + TP_ARGS(ctx), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE) +); + +DEFINE_EVENT_CONDITION(isoc_flush_template, isoc_inbound_multiple_flush, + TP_PROTO(const struct fw_iso_context *ctx), + TP_ARGS(ctx), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL) +); + #undef QUADLET_SIZE =20 #endif // _FIREWIRE_TRACE_EVENT_H --=20 2.43.0 From nobody Tue Dec 16 19:44:53 2025 Received: from fhigh6-smtp.messagingengine.com (fhigh6-smtp.messagingengine.com [103.168.172.157]) (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 EA4D6186E4B for ; Sun, 23 Jun 2024 22:09:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719180555; cv=none; b=YRYDcz2mpH/ofCrVx/xUlNKMoR3L4eTlZYwdAjlNgMK3LJrxYqhJyP0oNxu+1319jKNPGQ5Ul9/9cjdhmXc78UMImKtnfqmjEfUAx7ok2qj2/bV4wYTCb5rYuui6pxBCBiIct9C3enSeKvqcaAa+agk9mTVJLL+RKKKUSmRpObM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719180555; c=relaxed/simple; bh=d6W03WsiWlJpqJD6mVx2ojF+rW7LlSqdIoao/ezGAVU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dBFXH4OKYtadDl1DyVgYcfxuIFFNspEzT8QUlJ5y34sBjOJhDu3MzTeuUnoIVHZbUctsHM9q6nMH6GXvw6OmGWRc5IVMuj2uKAG/xUEm77Pz9Syy3VKOnG7vs7MgYoRzIqVFx4pOlMGz7p8g93pstkRaLkYkB4grT4q4rOV09og= 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=jZ0p9enb; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=bKKjYlbX; arc=none smtp.client-ip=103.168.172.157 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="jZ0p9enb"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="bKKjYlbX" Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 1D524114008B; Sun, 23 Jun 2024 18:09:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sun, 23 Jun 2024 18:09: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=1719180553; x= 1719266953; bh=o6KF/Qat9pVrpE9/pXeE4DRfuJY+mnOlsa6Bs6Hh1zo=; b=j Z0p9enbC++IesQkkK4n53WT2rju4d84i1uRfEnKjIMJ+U6My+I+qO1Z8sKC/R9FT qGJjNfuTrUPfYXZ4cE2vjkikjfr9CyNcPlnvbnyF5GMWPx0cqGtn3fG1rgMiLQWe CxB7cimW7DDlRJEAyt+cbLcFemmrJT5kxR/ql2XlqrP/fspo8Wsn9wxSom1nEmPt ESxdO6ozW9r32/RnTQRgjOdIbMiJP5FJHqwrvh2qLkvScs9+K9+HEHNzH9rHb49q ZYXvBn3KqIw0OOhTlg9ZwhIuqLcwL/NvR9IMCPtfCSqMn1hhoBg/v8e0uAdJQjWL 8uvtVe5B49hqekYEYTMTA== 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=1719180553; x= 1719266953; bh=o6KF/Qat9pVrpE9/pXeE4DRfuJY+mnOlsa6Bs6Hh1zo=; b=b KKjYlbXe54YocNlVVbRXW/B9uK1ZteP57FpMWXZYIwBSVioB6Be4MxrG2OfGYiMg YlsEKLw316O7f9yIcxWwj8K5IdKIDwkjC2rE7MWS49j8G3eZWiXIi0HCH5kK0rTF 29vq2bEBoK6bZeb+aM0z+di4/Kolfz/tHZWaqoJdthSwwvv3IOxpofef+X1ssR6v pYvq/GbaupJzf6sMQvEWpqcYphwgqewNYBvwp+dOrcNudZvjzfK/mU27PfRxlgv9 a59M6X82A9dCQrMnmr5vOStKUX05WYGr2jLOb/orHl7aWTXC6deWpE+a7QnuKLZH pR9FSDWj1fSiauG7IpNEg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeegtddgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 23 Jun 2024 18:09:11 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 5/7] firewire: core: add tracepoints events for flushing completions of isochronous context Date: Mon, 24 Jun 2024 07:08:56 +0900 Message-ID: <20240623220859.851685-6-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240623220859.851685-1-o-takashi@sakamocchi.jp> References: <20240623220859.851685-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" It is helpful to trace the flushing completions of isochronous context when the core function is requested them by both in-kernel unit drivers and userspace applications. This commit adds some tracepoints events for the aim. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-iso.c | 4 ++++ drivers/firewire/ohci.c | 2 ++ include/trace/events/firewire.h | 36 +++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c index 5bad23fcce0c..93ca0dec1805 100644 --- a/drivers/firewire/core-iso.c +++ b/drivers/firewire/core-iso.c @@ -207,6 +207,10 @@ EXPORT_SYMBOL(fw_iso_context_queue_flush); =20 int fw_iso_context_flush_completions(struct fw_iso_context *ctx) { + trace_isoc_outbound_flush_completions(ctx); + trace_isoc_inbound_single_flush_completions(ctx); + trace_isoc_inbound_multiple_flush_completions(ctx); + return ctx->card->driver->flush_iso_completions(ctx); } EXPORT_SYMBOL(fw_iso_context_flush_completions); diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 1f6097a6366c..f35d6e193bcb 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -43,6 +43,8 @@ #include "packet-header-definitions.h" #include "phy-packet-definitions.h" =20 +#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 b404e6324671..ad1546120aa3 100644 --- a/include/trace/events/firewire.h +++ b/include/trace/events/firewire.h @@ -706,6 +706,42 @@ DEFINE_EVENT_CONDITION(isoc_flush_template, isoc_inbou= nd_multiple_flush, TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL) ); =20 +DECLARE_EVENT_CLASS(isoc_flush_completions_template, + TP_PROTO(const struct fw_iso_context *ctx), + TP_ARGS(ctx), + TP_STRUCT__entry( + __field(u64, context) + __field(u8, card_index) + ), + TP_fast_assign( + __entry->context =3D (uintptr_t)ctx; + __entry->card_index =3D ctx->card->index; + ), + TP_printk( + "context=3D0x%llx card_index=3D%u", + __entry->context, + __entry->card_index + ) +); + +DEFINE_EVENT_CONDITION(isoc_flush_completions_template, isoc_outbound_flus= h_completions, + TP_PROTO(const struct fw_iso_context *ctx), + TP_ARGS(ctx), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_TRANSMIT) +); + +DEFINE_EVENT_CONDITION(isoc_flush_completions_template, isoc_inbound_singl= e_flush_completions, + TP_PROTO(const struct fw_iso_context *ctx), + TP_ARGS(ctx), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE) +); + +DEFINE_EVENT_CONDITION(isoc_flush_completions_template, isoc_inbound_multi= ple_flush_completions, + TP_PROTO(const struct fw_iso_context *ctx), + TP_ARGS(ctx), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL) +); + #undef QUADLET_SIZE =20 #endif // _FIREWIRE_TRACE_EVENT_H --=20 2.43.0 From nobody Tue Dec 16 19:44:53 2025 Received: from fhigh6-smtp.messagingengine.com (fhigh6-smtp.messagingengine.com [103.168.172.157]) (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 99EC018754B for ; Sun, 23 Jun 2024 22:09:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719180557; cv=none; b=TTE0QUg80UOp/w06SePgLzvcvKiNrGDJvtsaY2v9Qf1cGTc9jL8AZ3K3b6lcTPpw7mU8ijFkQtQim76kyF8Og2sJiuIWdKXWifvYXQZHhZzLLDoYI4HiRveGTRFD032LuXl8VtrpAtK285Ch8lmvetZRNKLM/2mMQQOHx2RRdHc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719180557; c=relaxed/simple; bh=v252W92RzXy8ORK5dMJxqUSL0uBdYHFGHrhFVPRouig=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=glYTAJHnIpdXAyyZ9KtB4xZqH+tJkiRQZv9BWViq2Ol2UgdutvicuCUG4n4Q5RhKvXmT4T1H7JQVU/wJwAnm3/p7La9PU8wJmoKI1Qsee430n+zNVNrcUlj/cltvkgUtBYkE+0uXwxOO8dfMBactDovFUumGtEChOkA28GApQ2Y= 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=NPryTV9r; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=o8A1V56X; arc=none smtp.client-ip=103.168.172.157 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="NPryTV9r"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="o8A1V56X" Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfhigh.nyi.internal (Postfix) with ESMTP id A0963114011D; Sun, 23 Jun 2024 18:09:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sun, 23 Jun 2024 18:09:14 -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=1719180554; x= 1719266954; bh=5fRKzoSigHUcRzL6hQHux4tv35XsJTJ3RfGKgiIvETE=; b=N PryTV9rG7lIrRx0eVKEz58uKC/DwC6x40hqXqI06BwttE2x8IZ2CBmjcPgMYWmjk LgfBlpeeyuQFCK+0MxVlQbo1ufQBL+dn5CiHMrE4VkaPkHWSgE7l21obGr6OlshJ OUrxqTRNJxMeWTjAEawgl7HpgIGycKTdpdroKFTAaV58ECYVZLT1/I2VU5J/szut iXk+/oB7D/l20O/SBSfWfqDWz+Doq91iLsbMdWCDnT/Qc219jn7KXFC4StPcNvIw VowC6EiIQbkgEXpvEUanI1dgEdyZxm916Lp5ZuwiWvmEG2qEyVWDURfLx2YoViSK x/1OEf8voKnD3M77l3Z0w== 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=1719180554; x= 1719266954; bh=5fRKzoSigHUcRzL6hQHux4tv35XsJTJ3RfGKgiIvETE=; b=o 8A1V56XedFurg9Vf+oYtF1DYxuCyDovNA3rRxp2LIQGpl3E3TfCJufr8WVAB+E+I lHwKuyZzPAll8Pl91wRAKavTl4L3KFMPdrFiCw13x5tS1ulxKqwY/I3KoRI3160q Hs/Jiq2kbjpsanaj6ygnWJGfJ736YBbtNY9JMxkJPvC3IQ07r0nkVFOPK15BoNwW DEg/xN12W05BDK17mPqhUBV+mY5b9MWE48R5XAiVS93vnvX9Ln41lmzPbVAFTigL D6Jzl0gRDzoTh/5hExfyGjoTAlKuzN0yNdwLtWPdAhfpptzmZOyJP+rBn8aHbE45 2Zy/baX37yXiDdbMeu7rg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeegtddgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 23 Jun 2024 18:09:13 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 6/7] firewire: core: add tracepoints events for queueing packets of isochronous context Date: Mon, 24 Jun 2024 07:08:57 +0900 Message-ID: <20240623220859.851685-7-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240623220859.851685-1-o-takashi@sakamocchi.jp> References: <20240623220859.851685-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" It is helpful to trace the queueing packets of isochronous context when the core function is requested them by both in-kernel unit drivers and userspace applications. This commit adds some tracepoints events for the aim. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-iso.c | 4 ++ include/trace/events/firewire.h | 79 +++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c index 93ca0dec1805..b3eda38a36f3 100644 --- a/drivers/firewire/core-iso.c +++ b/drivers/firewire/core-iso.c @@ -191,6 +191,10 @@ int fw_iso_context_queue(struct fw_iso_context *ctx, struct fw_iso_buffer *buffer, unsigned long payload) { + trace_isoc_outbound_queue(ctx, payload, packet); + trace_isoc_inbound_single_queue(ctx, payload, packet); + trace_isoc_inbound_multiple_queue(ctx, payload, packet); + return ctx->card->driver->queue_iso(ctx, packet, buffer, payload); } EXPORT_SYMBOL(fw_iso_context_queue); diff --git a/include/trace/events/firewire.h b/include/trace/events/firewir= e.h index ad1546120aa3..0381b3ca4d0e 100644 --- a/include/trace/events/firewire.h +++ b/include/trace/events/firewire.h @@ -742,6 +742,85 @@ DEFINE_EVENT_CONDITION(isoc_flush_completions_template= , isoc_inbound_multiple_fl TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL) ); =20 +#define TP_STRUCT__entry_iso_packet(ctx, buffer_offset, packet) \ + TP_STRUCT__entry( \ + __field(u64, context) \ + __field(u8, card_index) \ + __field(u32, buffer_offset) \ + __field(bool, interrupt) \ + __field(bool, skip) \ + __field(u8, sy) \ + __field(u8, tag) \ + __dynamic_array(u32, header, packet->header_length / QUADLET_SIZE) \ + ) + +#define TP_fast_assign_iso_packet(ctx, buffer_offset, packet) \ + TP_fast_assign( \ + __entry->context =3D (uintptr_t)ctx; \ + __entry->card_index =3D ctx->card->index; \ + __entry->buffer_offset =3D buffer_offset; \ + __entry->interrupt =3D packet->interrupt; \ + __entry->skip =3D packet->skip; \ + __entry->sy =3D packet->sy; \ + __entry->tag =3D packet->tag; \ + memcpy(__get_dynamic_array(header), packet->header, \ + __get_dynamic_array_len(header)); \ + ) + +TRACE_EVENT_CONDITION(isoc_outbound_queue, + TP_PROTO(const struct fw_iso_context *ctx, unsigned long buffer_offset, c= onst struct fw_iso_packet *packet), + TP_ARGS(ctx, buffer_offset, packet), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_TRANSMIT), + TP_STRUCT__entry_iso_packet(ctx, buffer_offset, packet), + TP_fast_assign_iso_packet(ctx, buffer_offset, packet), + TP_printk( + "context=3D0x%llx card_index=3D%u buffer_offset=3D0x%x interrupt=3D%s sk= ip=3D%s sy=3D%d tag=3D%u header=3D%s", + __entry->context, + __entry->card_index, + __entry->buffer_offset, + __entry->interrupt ? "true" : "false", + __entry->skip ? "true" : "false", + __entry->sy, + __entry->tag, + __print_array(__get_dynamic_array(header), + __get_dynamic_array_len(header) / QUADLET_SIZE, QUADLET_SIZE) + ) +); + +TRACE_EVENT_CONDITION(isoc_inbound_single_queue, + TP_PROTO(const struct fw_iso_context *ctx, unsigned long buffer_offset, c= onst struct fw_iso_packet *packet), + TP_ARGS(ctx, buffer_offset, packet), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE), + TP_STRUCT__entry_iso_packet(ctx, buffer_offset, packet), + TP_fast_assign_iso_packet(ctx, buffer_offset, packet), + TP_printk( + "context=3D0x%llx card_index=3D%u buffer_offset=3D0x%x interrupt=3D%s sk= ip=3D%s", + __entry->context, + __entry->card_index, + __entry->buffer_offset, + __entry->interrupt ? "true" : "false", + __entry->skip ? "true" : "false" + ) +); + +TRACE_EVENT_CONDITION(isoc_inbound_multiple_queue, + TP_PROTO(const struct fw_iso_context *ctx, unsigned long buffer_offset, c= onst struct fw_iso_packet *packet), + TP_ARGS(ctx, buffer_offset, packet), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL), + TP_STRUCT__entry_iso_packet(ctx, buffer_offset, packet), + TP_fast_assign_iso_packet(ctx, buffer_offset, packet), + TP_printk( + "context=3D0x%llx card_index=3D%u buffer_offset=3D0x%x interrupt=3D%s", + __entry->context, + __entry->card_index, + __entry->buffer_offset, + __entry->interrupt ? "true" : "false" + ) +); + +#undef TP_STRUCT__entry_iso_packet +#undef TP_fast_assign_iso_packet + #undef QUADLET_SIZE =20 #endif // _FIREWIRE_TRACE_EVENT_H --=20 2.43.0 From nobody Tue Dec 16 19:44:53 2025 Received: from fout1-smtp.messagingengine.com (fout1-smtp.messagingengine.com [103.168.172.144]) (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 D5F5D187573 for ; Sun, 23 Jun 2024 22:09:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.144 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719180558; cv=none; b=X4TH2rGMfsLzxZ1Uj3D3/sj4SDXl1p3Lwb2kginkS06JsKnTkwji26qtoEAdku6kSHTpckddgWyBhBxnxPTLgsSplzH58GKaQqcbCy6gWsRgKe8y7N4oAAJTCrlk5GwUipCqqfFpsEvrk83BI/IXsM9df8af/yTUqhHintWOeCs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719180558; c=relaxed/simple; bh=QCgUK82MWDAlz/HQWXxZhii7gy5IIftiFfTP2ZuLnUQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BgFyrgR4svzqHYRTg7cXT6XScGa0ZOGS0yF1dTRRW92RDxpPjrACbSX/XD+nkiqgC7uZ/RIFrmHA/L/U+FjbMzu0zPXq4bwOILD67gAbGA32VwlvpHCeAboV2GrA5ctlOA5eYzWtjTk9K1COjbV+DYVZvNsV/2QubODY0m6Ll/Q= 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=cr8kAC5S; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=m2w/O2Lz; arc=none smtp.client-ip=103.168.172.144 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="cr8kAC5S"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="m2w/O2Lz" Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfout.nyi.internal (Postfix) with ESMTP id 2CE3C1380223; Sun, 23 Jun 2024 18:09:16 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 23 Jun 2024 18:09:16 -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=1719180556; x= 1719266956; bh=SbytbCOXN4nSm+jv3TMP9PFpjfKgobFm/O7hJMPsTzI=; b=c r8kAC5SCVHYxDqnXRStkbHyGSblKdYnjcaEDQtnaUF0J2w/5pTrwzFP6wcst/J3g i7dUMSs5+X5EN6gsw2B45Lqgld17NxutYPkUj7UfTrulQZu/+ZtXhrZu84WzuI6r +DHK/7vKSqvVuoyTKpTUzhqnLY6Lkb1p7hZRy3AkhH5CqP5TpviHbY/SUcHWjHm0 XTOScLx5hdy1LRTxlKy2gTS1laiilSGoy7e96xloEMqATdIC08+NLPLWO7xjh+Wk LR4dURf6I5SOjYCvrsTwGNkfGOEX5GpEqazZzGzWWr39n3WNGvx5DZ2K9W+eTBfA FC+Ygm/Ckw/03VIWnEzLQ== 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=1719180556; x= 1719266956; bh=SbytbCOXN4nSm+jv3TMP9PFpjfKgobFm/O7hJMPsTzI=; b=m 2w/O2LzPTudsaeGdGuw71cvMaiYS/19PzzdwsflrLljs1Ccq+9+V3q3RhAjOfJRN Fy6nuzcoydoVHDBcDrUPvWiMaa5f4DHzbho3xrMto2hdDt0baIZb9cIxTVWS+viI RiytrToH5BT4j7+aNAsJ0zBOzYBKYS4A3a3TZ9x43fqTq9XhfJvdBuDeMvE7tVYy SUzgsu+uI4cwp+qaoEJ1hPUPb1GBdOWOtWibkOx1uo+M7i5ODzMKKdsZl4B97l+o M9nqPc28f5LjHYDLXVTIGenpSqAYeWu6UqDjAqMXDH98xzWst/7bsvUcIpuzrlmv /aOfGVMyAXOO1mT65p6dQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeegtddgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpeeufedtge fhvdettefhgffhgedttdekveejudefledtgeekjedtgedthfeljedvleenucffohhmrghi nheptggrlhhlsggrtghkrdhstgdptggrlhhlsggrtghkrdhmtgenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhisehsrghk rghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 23 Jun 2024 18:09:14 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 7/7] firewire: core: add tracepoints events for completions of packets in isochronous context Date: Mon, 24 Jun 2024 07:08:58 +0900 Message-ID: <20240623220859.851685-8-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240623220859.851685-1-o-takashi@sakamocchi.jp> References: <20240623220859.851685-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" It is helpful to trace completion of packets in isochronous context when the core function is requested them by both in-kernel units driver and userspace applications. This commit adds some tracepoints events for the aim. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-trace.c | 4 ++ drivers/firewire/ohci.c | 23 +++++++--- include/trace/events/firewire.h | 78 +++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+), 6 deletions(-) diff --git a/drivers/firewire/core-trace.c b/drivers/firewire/core-trace.c index c9bc4990d66e..5acb02c18a47 100644 --- a/drivers/firewire/core-trace.c +++ b/drivers/firewire/core-trace.c @@ -20,4 +20,8 @@ void copy_port_status(u8 *port_status, unsigned int port_= capacity, self_id_sequence_get_port_status(self_id_sequence, quadlet_count, port_= index); } } + +EXPORT_TRACEPOINT_SYMBOL_GPL(isoc_inbound_single_completions); +EXPORT_TRACEPOINT_SYMBOL_GPL(isoc_inbound_multiple_completions); +EXPORT_TRACEPOINT_SYMBOL_GPL(isoc_outbound_completions); #endif diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index f35d6e193bcb..bdb206157118 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -2833,8 +2833,13 @@ static void ohci_write_csr(struct fw_card *card, int= csr_offset, u32 value) } } =20 -static void flush_iso_completions(struct iso_context *ctx) +static void flush_iso_completions(struct iso_context *ctx, enum fw_iso_con= text_completions_cause cause) { + trace_isoc_inbound_single_completions(&ctx->base, ctx->last_timestamp, ca= use, ctx->header, + ctx->header_length); + trace_isoc_outbound_completions(&ctx->base, ctx->last_timestamp, cause, c= tx->header, + ctx->header_length); + ctx->base.callback.sc(&ctx->base, ctx->last_timestamp, ctx->header_length, ctx->header, ctx->base.callback_data); @@ -2848,7 +2853,7 @@ static void copy_iso_headers(struct iso_context *ctx,= const u32 *dma_hdr) if (ctx->header_length + ctx->base.header_size > PAGE_SIZE) { if (ctx->base.drop_overflow_headers) return; - flush_iso_completions(ctx); + flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_HEADER_OVERF= LOW); } =20 ctx_hdr =3D ctx->header + ctx->header_length; @@ -2897,7 +2902,7 @@ static int handle_ir_packet_per_buffer(struct context= *context, copy_iso_headers(ctx, (u32 *) (last + 1)); =20 if (last->control & cpu_to_le16(DESCRIPTOR_IRQ_ALWAYS)) - flush_iso_completions(ctx); + flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_IRQ); =20 return 1; } @@ -2932,6 +2937,9 @@ static int handle_ir_buffer_fill(struct context *cont= ext, completed, DMA_FROM_DEVICE); =20 if (last->control & cpu_to_le16(DESCRIPTOR_IRQ_ALWAYS)) { + trace_isoc_inbound_multiple_completions(&ctx->base, completed, + FW_ISO_CONTEXT_COMPLETIONS_CAUSE_IRQ); + ctx->base.callback.mc(&ctx->base, buffer_dma + completed, ctx->base.callback_data); @@ -2948,6 +2956,9 @@ static void flush_ir_buffer_fill(struct iso_context *= ctx) ctx->mc_buffer_bus & ~PAGE_MASK, ctx->mc_completed, DMA_FROM_DEVICE); =20 + trace_isoc_inbound_multiple_completions(&ctx->base, ctx->mc_completed, + FW_ISO_CONTEXT_COMPLETIONS_CAUSE_FLUSH); + ctx->base.callback.mc(&ctx->base, ctx->mc_buffer_bus + ctx->mc_completed, ctx->base.callback_data); @@ -3012,7 +3023,7 @@ static int handle_it_packet(struct context *context, if (ctx->header_length + 4 > PAGE_SIZE) { if (ctx->base.drop_overflow_headers) return 1; - flush_iso_completions(ctx); + flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_HEADER_OVERF= LOW); } =20 ctx_hdr =3D ctx->header + ctx->header_length; @@ -3023,7 +3034,7 @@ static int handle_it_packet(struct context *context, ctx->header_length +=3D 4; =20 if (last->control & cpu_to_le16(DESCRIPTOR_IRQ_ALWAYS)) - flush_iso_completions(ctx); + flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_IRQ); =20 return 1; } @@ -3588,7 +3599,7 @@ static int ohci_flush_iso_completions(struct fw_iso_c= ontext *base) case FW_ISO_CONTEXT_TRANSMIT: case FW_ISO_CONTEXT_RECEIVE: if (ctx->header_length !=3D 0) - flush_iso_completions(ctx); + flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_FLUSH); break; case FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL: if (ctx->mc_completed !=3D 0) diff --git a/include/trace/events/firewire.h b/include/trace/events/firewir= e.h index 0381b3ca4d0e..d9158a134beb 100644 --- a/include/trace/events/firewire.h +++ b/include/trace/events/firewire.h @@ -821,6 +821,84 @@ TRACE_EVENT_CONDITION(isoc_inbound_multiple_queue, #undef TP_STRUCT__entry_iso_packet #undef TP_fast_assign_iso_packet =20 +#ifndef show_cause +enum fw_iso_context_completions_cause { + FW_ISO_CONTEXT_COMPLETIONS_CAUSE_FLUSH =3D 0, + FW_ISO_CONTEXT_COMPLETIONS_CAUSE_IRQ, + FW_ISO_CONTEXT_COMPLETIONS_CAUSE_HEADER_OVERFLOW, +}; +#define show_cause(cause) \ + __print_symbolic(cause, \ + { FW_ISO_CONTEXT_COMPLETIONS_CAUSE_FLUSH, "FLUSH" }, \ + { FW_ISO_CONTEXT_COMPLETIONS_CAUSE_IRQ, "IRQ" }, \ + { FW_ISO_CONTEXT_COMPLETIONS_CAUSE_HEADER_OVERFLOW, "HEADER_OVERFLOW" } \ + ) +#endif + +DECLARE_EVENT_CLASS(isoc_single_completions_template, + TP_PROTO(const struct fw_iso_context *ctx, u16 timestamp, enum fw_iso_con= text_completions_cause cause, const u32 *header, unsigned int header_length= ), + TP_ARGS(ctx, timestamp, cause, header, header_length), + TP_STRUCT__entry( + __field(u64, context) + __field(u8, card_index) + __field(u16, timestamp) + __field(u8, cause) + __dynamic_array(u32, header, header_length / QUADLET_SIZE) + ), + TP_fast_assign( + __entry->context =3D (uintptr_t)ctx; + __entry->card_index =3D ctx->card->index; + __entry->timestamp =3D timestamp; + __entry->cause =3D cause; + memcpy(__get_dynamic_array(header), header, __get_dynamic_array_len(head= er)); + ), + TP_printk( + "context=3D0x%llx card_index=3D%u timestap=3D0x%04x cause=3D%s header=3D= %s", + __entry->context, + __entry->card_index, + __entry->timestamp, + show_cause(__entry->cause), + __print_array(__get_dynamic_array(header), + __get_dynamic_array_len(header) / QUADLET_SIZE, QUADLET_SIZE) + ) +) + +DEFINE_EVENT_CONDITION(isoc_single_completions_template, isoc_outbound_com= pletions, + TP_PROTO(const struct fw_iso_context *ctx, u16 timestamp, enum fw_iso_con= text_completions_cause cause, const u32 *header, unsigned int header_length= ), + TP_ARGS(ctx, timestamp, cause, header, header_length), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_TRANSMIT) +); + +DEFINE_EVENT_CONDITION(isoc_single_completions_template, isoc_inbound_sing= le_completions, + TP_PROTO(const struct fw_iso_context *ctx, u16 timestamp, enum fw_iso_con= text_completions_cause cause, const u32 *header, unsigned int header_length= ), + TP_ARGS(ctx, timestamp, cause, header, header_length), + TP_CONDITION(ctx->type =3D=3D FW_ISO_CONTEXT_RECEIVE) +); + +TRACE_EVENT(isoc_inbound_multiple_completions, + TP_PROTO(const struct fw_iso_context *ctx, unsigned int completed, enum f= w_iso_context_completions_cause cause), + TP_ARGS(ctx, completed, cause), + TP_STRUCT__entry( + __field(u64, context) + __field(u8, card_index) + __field(u16, completed) + __field(u8, cause) + ), + TP_fast_assign( + __entry->context =3D (uintptr_t)ctx; + __entry->card_index =3D ctx->card->index; + __entry->completed =3D completed; + __entry->cause =3D cause; + ), + TP_printk( + "context=3D0x%llx card_index=3D%u comleted=3D%u cause=3D%s", + __entry->context, + __entry->card_index, + __entry->completed, + show_cause(__entry->cause) + ) +); + #undef QUADLET_SIZE =20 #endif // _FIREWIRE_TRACE_EVENT_H --=20 2.43.0