Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3300327lqp; Tue, 26 Mar 2024 05:47:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXuHDWdJZJpvZGXdFXAfQXDmFr0cGccCN1FkdhlpY306Rkv2P8oozYwUIdZDVms9xiMVI0lRugfKH+JhqFp9lYhihohcD01BFFZO3GL/Q== X-Google-Smtp-Source: AGHT+IEkaQzxSIbaexPMhrAVlj0AqJJW4FUIw0+BXocdVEfPayQF3NA/IG7XepDy3Lr3Bt7Weznp X-Received: by 2002:a50:d4c4:0:b0:56b:f352:d379 with SMTP id e4-20020a50d4c4000000b0056bf352d379mr6604887edj.2.1711457274069; Tue, 26 Mar 2024 05:47:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711457274; cv=pass; d=google.com; s=arc-20160816; b=mJqcgUd/9it2rnDTKIX2g8K9ZIvpsalYfmPjJAt2OrUWeODAV8Q+ZKsGTDxYHMSOhk tebE9TWuXGxXF3+dUqm2cjhZhOc9XlAiMuWmkLcHSaYpNxu7FuLahCBQjHuNWYTRSsJu gX5uV46swBouY9C8Gpcdg6fVHkIxNwsgN0JvpXXg+UtIHOBljNo4DEvikEMbCXiexuW9 pPgBLvcu1jAO8JtaBKpDBGqq1lBIPkXd2hjtRGMjxELXELiwdCH6v9wW9Ky+PqNY1lKe 9wIPqvTMFibc99ym1DA9/VKqOzP0/N7eRLXH8HU/Ifzyq3g1vzbcTp4jzeP4qfwIn4ws s2iA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:mail-followup-to :message-id:subject:cc:to:from:date:feedback-id:dkim-signature :dkim-signature; bh=SpN1i+9IU2YyhmBo6ufdJzLACq9EamCprJ4iEIQKtrI=; fh=7tCR2OY+o2tzhFP0PdsbGzYyG96Vzu3n/lYSO2E5INs=; b=qUDazXsxGNBkHzPM3jxvr7PrdtFFyYOgGru3wZRPmyh2tT912uiJ5ZcBMX8FD3ZCa3 WPPvVYXhU11eojWUZZogik9IVhuyoSgypQ8GjhipKVZ/j9sNmrjb+D/UUZgyC6d4kZPg 0KwdJASs67ROHwygbheSO4Z/XmIYPihZz4QbiC45K5KR6K3fhWs6aGVv7rKgtsUD7RsG KE9oVmGQESMtrbr3H14PuOVJzEOXE9Cs1Se3MvzyeJVvNSbgDn+Wmew3VFUqmoWkZHya EspD0+UqMUwgg4aUym7jO204RjSdt7xsr4r3kQStEB/l0mIGWBEx2+ALF9/ExeuDOUHa N4+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sakamocchi.jp header.s=fm2 header.b=E1hUty5a; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=RkZ3pIBz; 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-118990-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118990-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 ds5-20020a0564021cc500b0056bd2c1c153si950927edb.629.2024.03.26.05.47.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 05:47:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118990-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=fm2 header.b=E1hUty5a; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=RkZ3pIBz; 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-118990-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118990-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 28BFF1F6591A for ; Tue, 26 Mar 2024 12:39:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C71E6BFCC; Tue, 26 Mar 2024 12:39:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="E1hUty5a"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="RkZ3pIBz" Received: from wfout2-smtp.messagingengine.com (wfout2-smtp.messagingengine.com [64.147.123.145]) (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 05EFF5C8FF for ; Tue, 26 Mar 2024 12:38:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.145 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711456740; cv=none; b=R6yTtkOdqL41UzlJ7NSGPVLtht2KQ1gX5Cy6VBHET7ihvNIWAOlgBd00LLXl/QZ4NvFu/v2bqf0UjUs/C3ebyOW+97DPRT2OuqydD4Z8mS4FWn20Lbt0UsPyfk7Of4Ydw9PpOrWqHGi8LfcSyPlMJkd/4sQXiihHekWNR948asI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711456740; c=relaxed/simple; bh=5vpBVi8l5SdPJOEq8VnBU5XwcDzOC3AOa50PlgKFA/4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=T54SlwRWHC4cfuwCTMAhywc4XJYFjCBTqDdy63G6+uINrnOobNcesKXXWhULEDYUy7i0q9VbPMDVuj3SpHdUxXRspc68zTpJ739VvwCT9HlGXyvFyzsSxQ+mZouf2UNj9czwF/ZbtrSCJyLmYx8hZnvuWackZle8sxE/47Juv+U= 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=E1hUty5a; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=RkZ3pIBz; arc=none smtp.client-ip=64.147.123.145 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 mailfout.west.internal (Postfix) with ESMTP id B8A3E1C000B8; Tue, 26 Mar 2024 08:38:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 26 Mar 2024 08:38:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-type: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=1711456736; x= 1711543136; bh=SpN1i+9IU2YyhmBo6ufdJzLACq9EamCprJ4iEIQKtrI=; b=E 1hUty5az9b1XwLJYZVo+vl6MYqo/f3dzKyBovCvm1QOa0ZvTJ40tvcyfvT2QYzMW 2pGxLrX6vxNlg2zNPf5ZRy6WTVE0XChQgYKdbRj6MklSKvA1HRZiceVAGAaiTnCJ GIYeiw1rnuOx8XIDjsQcEQ0yoFy0gCeQuCER+dY6Kr6ImPIsMIu+OYSeVUcpt2so KIyDwjoufIy10Yu+Uev70OMi4A/hRjMNnk7svOmB2zje60YlrjSLQxpkGsEyMLCG 04L/X9m8HT3RhyNgTKASbI5rDY+nv9s9P3Dy3hJ9ol2gnAs6n9MgEkssA3cIrYhV tTNfJgB1NKKw34bOYEKNQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type: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=1711456736; x=1711543136; bh=SpN1i+9IU2YyhmBo6ufdJzLACq9E amCprJ4iEIQKtrI=; b=RkZ3pIBzdXiu38ljJxqXCxCpmCscnBZO5XWEXaN8XIuo ODBnOmql2DchhALur7xClxP/UnJcbMwimrKblUMyrdutVlPO4AgRfPvpDiW0yqC9 gPwXNuQAFn0hIW7JFymDp2b7DJO9q5Rg8KwuwZMxN9EffLsXjdk5TrsAxI+NexcB vxsBVbyGCmYb4O3JtEqYG3wIkTjc9W8w8y7N/NkanxHloqpnkn6lNfJWHW8lWr2A 5qv43O7il8Srbslub7CVmQ1bKUvlGAaievO0Zojt0jLfX2XfwwEf9quyyKzEfv/L zkhHq/0WGKA3GdftQYkyXRJC2ARfvovxULZzFT9HLg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledruddufedggedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepvfgrkhgr shhhihcuufgrkhgrmhhothhouceoohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhird hjpheqnecuggftrfgrthhtvghrnhepudehgeeuveetuedvkeekvdfgffelieeivdelhfet tedtveettefgffegjeefleeknecuffhomhgrihhnpehgihhthhhusgdrtghomhenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghs hhhisehsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 26 Mar 2024 08:38:54 -0400 (EDT) Date: Tue, 26 Mar 2024 21:38:52 +0900 From: Takashi Sakamoto To: Adam Goldman Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] firewire: core: option to log bus reset initiation Message-ID: <20240326123852.GA140364@workstation.local> Mail-Followup-To: Adam Goldman , linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20240325004134.GA21329@workstation.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi, On Tue, Mar 26, 2024 at 05:18:32AM -0700, Adam Goldman wrote: > Hi Takashi, > > On Mon, Mar 25, 2024 at 09:41:34AM +0900, Takashi Sakamoto wrote: > > Now we have two debug parameters per module for the slightly-similar > > purpose. In my opinion, it is a pretty cumbersome to enable them when > > checking bus-reset behaviour. I think it is time to investigate the other > > way. > > > > Linux Kernel Tracepoints[2] is one of options. Roughly describing, the > > tracepoints mechanism allows users to deliver structured data from kernel > > space to user space via ring-buffer when enabling it by either sysfs or > > kernel command-line parameters. Linux kernel also has a command-line > > parameter to redirect the human-readable formatted data to kernel log[3]. > > I think it is suitable in the case. > > > > It requires many work to replace the existent debug parameter of > > firewire-ohci, while it is a good start to work just for bus-reset debug. > > The data structure layout should be pre-defined in each subsystem, thus we > > need to decide it. In my opinion, it would be like: > > > > ``` > > struct bus_reset_event { > > enum reason { > > Initiate, > > Schedule, > > Postpone, > > Detect, > > }, > > // We can put any other data if prefering. > > } > > ``` > > Maybe these should be four separate trace events? > > > Would I ask your opinion about my idea? > > It seems that tracepoints are the modern way to make debugging logs, so > if we want to modernize the FireWire driver, we should replace the > existent logging with tracepoints. Thanks for your positive comment. I pushed my work-in-progress patches to the following specific topic branch:: https://github.com/takaswie/linux-firewire-dkms/tree/topic/backport-to-v6.8/tracepoints You can see some patches onto your commits: * 145da78e firewire: ohci: obsolete OHCI_PARAM_DEBUG_BUSRESETS from debug parameter with tracepoints event * 3bdad35d firewire: core: obsolete debug parameter with tracepoints event * 30f489af firewire: ohci: support bus_reset tracepoints event * 4937d9c8 firewire: core: support bus_reset tracepoints event * 0da26087 firewire: core: add support for Linux kernel tracepoints * 961cba18 firewire: core: option to log bus reset initiation * b3124560 firewire: ohci: mask bus reset interrupts between ISR and bottom half In the above, I added 'bus_reset' events in 'firewire' tracepoints subsystem. The structure is something like: ``` struct bus_reset { enum fw_trace_bus_reset_issue issue; bool short_reset; }; ``` The issue enumerations are in 'drivers/firewire/core.h': ``` enum fw_trace_bus_reset_issue { FW_TRACE_BUS_RESET_ISSUE_INITIATE = 0, FW_TRACE_BUS_RESET_ISSUE_SCHEDULE, FW_TRACE_BUS_RESET_ISSUE_POSTPONE, FW_TRACE_BUS_RESET_ISSUE_DETECT, }; ``` You can see the above event is trigerred by two kernel modules: * firewire-core * firewire-ohci When merging the above changes and build/load the kernel modules, we can see 'firewire:bus_reset' event in Linux Kernel tracepoints system, like: ``` $ ls /sys/kernel/debug/tracing/events/firewire/bus_reset ``` I currently consider about a pair of events for OHCI interrupts and PHY operation, instead of the above event. I'm happy if receiving your opinion about it or the other ideas. Regards Takashi Sakamoto