Message ID | 20230118115810.21979-1-umang.jain@ideasonboard.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2313373wrn; Wed, 18 Jan 2023 04:40:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXsBMH52DTTA1qabirBfMET8cuJPTQhPw4XbjvVQffTuO4gicKzTS6w+oS9Xy11fw27erxcO X-Received: by 2002:a17:903:2306:b0:194:6e8d:89ac with SMTP id d6-20020a170903230600b001946e8d89acmr10418183plh.24.1674045652606; Wed, 18 Jan 2023 04:40:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674045652; cv=none; d=google.com; s=arc-20160816; b=CSbfRb33pZeZHl/cmF4zU1OhTJ6A9n3FO8QjNNwQAfONgH6tbxF4KCbZ/ploJ+ODV2 4j6ypnAA9Tz0nMpCri3ktCOd8m2Kg7pZ5489zm215RoBuDjtOJ47w6OtGG+rH+9CHNDP iVxmoLx11eNmjy7sRQE7qnHW63sjhfB6kOc8YhstUCLDvvseoCWtiLfnWa6VDGzVGj2r hcrHuKM/HcojkteD4p38c6de5OuA4/Hx1faKSZR3K9K28NU0kazEATGsRhtimLdbgx72 BuKXXn52fWTf6YHSm/ypj482V5rrNgxgh+qqAMIhyPwSLR65coKMHarjJjFAvxP15VJz /7rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=kzMIpMI79UF0+OpcHUH6+6IlBed9I+CF2lh/cnzzvOw=; b=uyiB0pz/A+D61jzcFuCvChnZWQjG65YMhP5xh9CwfQDj+umuZeyHtdYRu5N4r198PG UWinb5Zfdjm6mclUULbFr0k2CzdOaO3ZBvJvpFQH2P7kA+5A8t6z7OgJs8Sji3K4ur2B VvZjtfc+rC8WqPXYV/Ne3U3ejmUPqDK0p+40LKbWdS5Ha0nrGbBxaTHE8sH8yWNXDYth kMgVPm5zX3pVe9hpZG9G1P6B+YxTCcgIGLyOCr031PSL3KRbOo9PFYvSuM867ewiyt8S V1jhaMcAe4S23FxESsLRq03q1I1+jaHS9i3lAVU2zMoosI7lPle8FVhP7bBxeYKWWlGe SZ4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=mr0XK0dJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s9-20020a170902ea0900b00192f6c63f54si38884472plg.502.2023.01.18.04.40.39; Wed, 18 Jan 2023 04:40:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=mr0XK0dJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230090AbjARMfW (ORCPT <rfc822;pfffrao@gmail.com> + 99 others); Wed, 18 Jan 2023 07:35:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbjARMe7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 18 Jan 2023 07:34:59 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2FCE298F1; Wed, 18 Jan 2023 03:58:22 -0800 (PST) Received: from umang.jainideasonboard.com (unknown [103.86.18.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 408671643; Wed, 18 Jan 2023 12:58:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1674043099; bh=4ZkEehY0EKcMSSK/FWZM4yQ45U26CQ/uPHxtUY8/+Kw=; h=From:To:Cc:Subject:Date:From; b=mr0XK0dJNxcu3fFvP7C+BBGG9i618Wp2a6bHZ4j0KZhNxdYBGNuju4tgCE/dVaS5x vPradXpHtzLbV0a8YcUOCmv/JXCNWzYeUqGHYLkRfxp+CZoi9WUk3T7oNYeY+3lL// Zyx45aew3KRMeYAPPkqHCT1swWhfj2xxzQgXBMJw= From: Umang Jain <umang.jain@ideasonboard.com> To: linux-staging@lists.linux.dev, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stefan Wahren <stefan.wahren@i2se.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Florian Fainelli <f.fainelli@gmail.com>, Adrien Thierry <athierry@redhat.com>, Dan Carpenter <error27@gmail.com>, Dave Stevenson <dave.stevenson@raspberrypi.com>, Kieran Bingham <kieran.bingham@ideasonboard.com>, Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Umang Jain <umang.jain@ideasonboard.com> Subject: [RFC PATCH 0/4] Drop custom logging Date: Wed, 18 Jan 2023 17:28:06 +0530 Message-Id: <20230118115810.21979-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755364094442285642?= X-GMAIL-MSGID: =?utf-8?q?1755364094442285642?= |
Series | Drop custom logging | |
Message
Umang Jain
Jan. 18, 2023, 11:58 a.m. UTC
Drop custom logging from the vchiq interface. Mostly of them are replaced with dev_dbg and friends and/or pr_info and friends. The debugfs log levels (in 4/4) are mapped to kernel logs levels (coming from include/linux/kern_levels.h) Would like some thoughts on it as I am not sure (hence marking this is RFC) From drivers/staging/vc04_services/interface/TODO: """ * Cleanup logging mechanism The driver should probably be using the standard kernel logging mechanisms such as dev_info, dev_dbg, and friends. """ Umang Jain (4): staging: vc04_services: vchiq_core: Drop custom logging staging: vc04_services: vchiq_arm: Drop custom logging staging: vc04_services: Drop custom logging staging: vc04_services: Drop remnants of custom logging .../interface/vchiq_arm/vchiq_arm.c | 151 +++--- .../interface/vchiq_arm/vchiq_connected.c | 5 +- .../interface/vchiq_arm/vchiq_core.c | 479 ++++++++---------- .../interface/vchiq_arm/vchiq_core.h | 39 -- .../interface/vchiq_arm/vchiq_debugfs.c | 26 +- .../interface/vchiq_arm/vchiq_dev.c | 78 ++- 6 files changed, 329 insertions(+), 449 deletions(-)
Comments
Hi Umang, [add Phil] Am 18.01.23 um 12:58 schrieb Umang Jain: > Drop custom logging from the vchiq interface. > Mostly of them are replaced with dev_dbg and friends > and/or pr_info and friends. > > The debugfs log levels (in 4/4) are mapped to kernel > logs levels (coming from include/linux/kern_levels.h) > Would like some thoughts on it as I am not sure (hence > marking this is RFC) > > From drivers/staging/vc04_services/interface/TODO: > > """ > * Cleanup logging mechanism > > The driver should probably be using the standard kernel logging mechanisms > such as dev_info, dev_dbg, and friends. i don't have any experience with vchiq logging/debug. So i'm not sure if it's acceptable to lose the second log level dimension (like vchiq_arm_log_level) completely. Complex drivers like brcmfmac have a debug mask to avoid log spamming [1]. Maybe this is a compromise. Btw some loglevel locations has already been messed up during refactoring :-( [1] - drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h > """ > > Umang Jain (4): > staging: vc04_services: vchiq_core: Drop custom logging > staging: vc04_services: vchiq_arm: Drop custom logging > staging: vc04_services: Drop custom logging > staging: vc04_services: Drop remnants of custom logging > > .../interface/vchiq_arm/vchiq_arm.c | 151 +++--- > .../interface/vchiq_arm/vchiq_connected.c | 5 +- > .../interface/vchiq_arm/vchiq_core.c | 479 ++++++++---------- > .../interface/vchiq_arm/vchiq_core.h | 39 -- > .../interface/vchiq_arm/vchiq_debugfs.c | 26 +- > .../interface/vchiq_arm/vchiq_dev.c | 78 ++- > 6 files changed, 329 insertions(+), 449 deletions(-) >
On Wed, Jan 18, 2023 at 06:54:56PM +0100, Stefan Wahren wrote: > Hi Umang, > > [add Phil] > > Am 18.01.23 um 12:58 schrieb Umang Jain: > > Drop custom logging from the vchiq interface. > > Mostly of them are replaced with dev_dbg and friends > > and/or pr_info and friends. > > > > The debugfs log levels (in 4/4) are mapped to kernel > > logs levels (coming from include/linux/kern_levels.h) > > Would like some thoughts on it as I am not sure (hence > > marking this is RFC) > > > > From drivers/staging/vc04_services/interface/TODO: > > > > """ > > * Cleanup logging mechanism > > > > The driver should probably be using the standard kernel logging mechanisms > > such as dev_info, dev_dbg, and friends. > > i don't have any experience with vchiq logging/debug. So i'm not sure if > it's acceptable to lose the second log level dimension (like > vchiq_arm_log_level) completely. Complex drivers like brcmfmac have a debug > mask to avoid log spamming [1]. Maybe this is a compromise. > > Btw some loglevel locations has already been messed up during refactoring > :-( > > [1] - drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h > Kernel logging is actually has a bunch of features. You can turn them on for just a module or function or enable a specific message. See Documentation/admin-guide/dynamic-debug-howto.rst for more info. This vchiq logging is a re-implementation of a subset of the features that normal kernel logging infrastructure provides. Moving to normal logging will make it cleaner but also more flexible and powerful. It's better in every way. The broadcom stuff is different and more complicated than what this module is trying to do. They are sorting out their logging according to various components. I understand the motivation, but they would probably have been better just use standard logging like everyone else. regards, dan carpenter
On Wed, Jan 18, 2023 at 05:28:06PM +0530, Umang Jain wrote: > Drop custom logging from the vchiq interface. > Mostly of them are replaced with dev_dbg and friends > and/or pr_info and friends. Everything should be dev_*() calls, there should never be a pr_* call in a driver. > The debugfs log levels (in 4/4) are mapped to kernel > logs levels (coming from include/linux/kern_levels.h) > Would like some thoughts on it as I am not sure (hence > marking this is RFC) Do not have any "custom" debugging controls in a driver, they are not special and should follow the whole rest of the kernel. Just remove them all and rely on the existing dev_*() calls instead please. thanks, greg k-h
Hi all, On Wed, 18 Jan 2023 at 17:55, Stefan Wahren <stefan.wahren@i2se.com> wrote: > > Hi Umang, > > [add Phil] > > Am 18.01.23 um 12:58 schrieb Umang Jain: > > Drop custom logging from the vchiq interface. > > Mostly of them are replaced with dev_dbg and friends > > and/or pr_info and friends. > > > > The debugfs log levels (in 4/4) are mapped to kernel > > logs levels (coming from include/linux/kern_levels.h) > > Would like some thoughts on it as I am not sure (hence > > marking this is RFC) > > > > From drivers/staging/vc04_services/interface/TODO: > > > > """ > > * Cleanup logging mechanism > > > > The driver should probably be using the standard kernel logging mechanisms > > such as dev_info, dev_dbg, and friends. > > i don't have any experience with vchiq logging/debug. So i'm not sure if > it's acceptable to lose the second log level dimension (like > vchiq_arm_log_level) completely. Complex drivers like brcmfmac have a > debug mask to avoid log spamming [1]. Maybe this is a compromise. > > Btw some loglevel locations has already been messed up during > refactoring :-( > > [1] - drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h > > > """ > > > > Umang Jain (4): > > staging: vc04_services: vchiq_core: Drop custom logging > > staging: vc04_services: vchiq_arm: Drop custom logging > > staging: vc04_services: Drop custom logging > > staging: vc04_services: Drop remnants of custom logging > > > > .../interface/vchiq_arm/vchiq_arm.c | 151 +++--- > > .../interface/vchiq_arm/vchiq_connected.c | 5 +- > > .../interface/vchiq_arm/vchiq_core.c | 479 ++++++++---------- > > .../interface/vchiq_arm/vchiq_core.h | 39 -- > > .../interface/vchiq_arm/vchiq_debugfs.c | 26 +- > > .../interface/vchiq_arm/vchiq_dev.c | 78 ++- > > 6 files changed, 329 insertions(+), 449 deletions(-) > > Thanks for the nudge - this patch set hasn't yet made its way through the sluggish rpi-kernel moderation. I understand the desire to remove the custom logging. I don't welcome the loss of flexibility that comes with such a strategy, but I'm not going to argue about it. What's harder to understand is the state that this patchset leaves VCHIQ logging in. From what I can see, the per-service logging control has gone, but the code still contains macros that hint at something useful. Similarly, the debugfs support is completely vestigial, giving the appearance of control while actually achieving nothing. Phil
On Thu, Jan 19, 2023 at 01:31:12PM +0000, Phil Elwell wrote: > Hi all, > > > On Wed, 18 Jan 2023 at 17:55, Stefan Wahren <stefan.wahren@i2se.com> wrote: > > > > Hi Umang, > > > > [add Phil] > > > > Am 18.01.23 um 12:58 schrieb Umang Jain: > > > Drop custom logging from the vchiq interface. > > > Mostly of them are replaced with dev_dbg and friends > > > and/or pr_info and friends. > > > > > > The debugfs log levels (in 4/4) are mapped to kernel > > > logs levels (coming from include/linux/kern_levels.h) > > > Would like some thoughts on it as I am not sure (hence > > > marking this is RFC) > > > > > > From drivers/staging/vc04_services/interface/TODO: > > > > > > """ > > > * Cleanup logging mechanism > > > > > > The driver should probably be using the standard kernel logging mechanisms > > > such as dev_info, dev_dbg, and friends. > > > > i don't have any experience with vchiq logging/debug. So i'm not sure if > > it's acceptable to lose the second log level dimension (like > > vchiq_arm_log_level) completely. Complex drivers like brcmfmac have a > > debug mask to avoid log spamming [1]. Maybe this is a compromise. > > > > Btw some loglevel locations has already been messed up during > > refactoring :-( > > > > [1] - drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h > > > > > """ > > > > > > Umang Jain (4): > > > staging: vc04_services: vchiq_core: Drop custom logging > > > staging: vc04_services: vchiq_arm: Drop custom logging > > > staging: vc04_services: Drop custom logging > > > staging: vc04_services: Drop remnants of custom logging > > > > > > .../interface/vchiq_arm/vchiq_arm.c | 151 +++--- > > > .../interface/vchiq_arm/vchiq_connected.c | 5 +- > > > .../interface/vchiq_arm/vchiq_core.c | 479 ++++++++---------- > > > .../interface/vchiq_arm/vchiq_core.h | 39 -- > > > .../interface/vchiq_arm/vchiq_debugfs.c | 26 +- > > > .../interface/vchiq_arm/vchiq_dev.c | 78 ++- > > > 6 files changed, 329 insertions(+), 449 deletions(-) > > > > > Thanks for the nudge - this patch set hasn't yet made its way through > the sluggish rpi-kernel moderation. > > I understand the desire to remove the custom logging. I don't welcome > the loss of flexibility that comes with such a strategy What "loss of flexibility"? You now have access to the full dynamic debugging facilities that all of the rest of the kernel has. What is lacking? > , but I'm not > going to argue about it. What's harder to understand is the state that > this patchset leaves VCHIQ logging in. From what I can see, the > per-service logging control has gone, but the code still contains > macros that hint at something useful. Similarly, the debugfs support > is completely vestigial, giving the appearance of control while > actually achieving nothing. The debugfs files should also be removed if they don't do anything anymore. thanks, greg k-h
On Thu, 19 Jan 2023 at 13:37, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote: > > On Thu, Jan 19, 2023 at 01:31:12PM +0000, Phil Elwell wrote: > > Hi all, > > > > > > On Wed, 18 Jan 2023 at 17:55, Stefan Wahren <stefan.wahren@i2se.com> wrote: > > > > > > Hi Umang, > > > > > > [add Phil] > > > > > > Am 18.01.23 um 12:58 schrieb Umang Jain: > > > > Drop custom logging from the vchiq interface. > > > > Mostly of them are replaced with dev_dbg and friends > > > > and/or pr_info and friends. > > > > > > > > The debugfs log levels (in 4/4) are mapped to kernel > > > > logs levels (coming from include/linux/kern_levels.h) > > > > Would like some thoughts on it as I am not sure (hence > > > > marking this is RFC) > > > > > > > > From drivers/staging/vc04_services/interface/TODO: > > > > > > > > """ > > > > * Cleanup logging mechanism > > > > > > > > The driver should probably be using the standard kernel logging mechanisms > > > > such as dev_info, dev_dbg, and friends. > > > > > > i don't have any experience with vchiq logging/debug. So i'm not sure if > > > it's acceptable to lose the second log level dimension (like > > > vchiq_arm_log_level) completely. Complex drivers like brcmfmac have a > > > debug mask to avoid log spamming [1]. Maybe this is a compromise. > > > > > > Btw some loglevel locations has already been messed up during > > > refactoring :-( > > > > > > [1] - drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h > > > > > > > """ > > > > > > > > Umang Jain (4): > > > > staging: vc04_services: vchiq_core: Drop custom logging > > > > staging: vc04_services: vchiq_arm: Drop custom logging > > > > staging: vc04_services: Drop custom logging > > > > staging: vc04_services: Drop remnants of custom logging > > > > > > > > .../interface/vchiq_arm/vchiq_arm.c | 151 +++--- > > > > .../interface/vchiq_arm/vchiq_connected.c | 5 +- > > > > .../interface/vchiq_arm/vchiq_core.c | 479 ++++++++---------- > > > > .../interface/vchiq_arm/vchiq_core.h | 39 -- > > > > .../interface/vchiq_arm/vchiq_debugfs.c | 26 +- > > > > .../interface/vchiq_arm/vchiq_dev.c | 78 ++- > > > > 6 files changed, 329 insertions(+), 449 deletions(-) > > > > > > > > Thanks for the nudge - this patch set hasn't yet made its way through > > the sluggish rpi-kernel moderation. > > > > I understand the desire to remove the custom logging. I don't welcome > > the loss of flexibility that comes with such a strategy > > What "loss of flexibility"? You now have access to the full dynamic > debugging facilities that all of the rest of the kernel has. What is > lacking? Perhaps I've missed something, either in this patch set or the kernel as a whole, but how is one supposed to set different logging levels on different facilities within a driver/module, or even for the module as a whole? I don't consider anything that requires reference to individual lines in the source code to be a suitable replacement, clever though it is. > > , but I'm not > > going to argue about it. What's harder to understand is the state that > > this patchset leaves VCHIQ logging in. From what I can see, the > > per-service logging control has gone, but the code still contains > > macros that hint at something useful. Similarly, the debugfs support > > is completely vestigial, giving the appearance of control while > > actually achieving nothing. > > The debugfs files should also be removed if they don't do anything > anymore. > > thanks, > > greg k-h
On Thu, Jan 19, 2023 at 01:47:44PM +0000, Phil Elwell wrote: > > > I understand the desire to remove the custom logging. I don't welcome > > > the loss of flexibility that comes with such a strategy > > > > What "loss of flexibility"? You now have access to the full dynamic > > debugging facilities that all of the rest of the kernel has. What is > > lacking? > > Perhaps I've missed something, either in this patch set or the kernel > as a whole, but how is one supposed to set different logging levels on > different facilities within a driver/module, or even for the module as > a whole? Yeah. You will be still able to do that and more besides after the transition. Cleaning this up makes the code better in every way. Documentation/admin-guide/dynamic-debug-howto.rst regards, dan carpenter
On Thu, 19 Jan 2023 at 14:25, Dan Carpenter <error27@gmail.com> wrote: > > On Thu, Jan 19, 2023 at 01:47:44PM +0000, Phil Elwell wrote: > > > > I understand the desire to remove the custom logging. I don't welcome > > > > the loss of flexibility that comes with such a strategy > > > > > > What "loss of flexibility"? You now have access to the full dynamic > > > debugging facilities that all of the rest of the kernel has. What is > > > lacking? > > > > Perhaps I've missed something, either in this patch set or the kernel > > as a whole, but how is one supposed to set different logging levels on > > different facilities within a driver/module, or even for the module as > > a whole? > > Yeah. You will be still able to do that and more besides after the > transition. Cleaning this up makes the code better in every way. > > Documentation/admin-guide/dynamic-debug-howto.rst Are you saying this patch set gets us to that point?
On Thu, Jan 19, 2023 at 02:31:50PM +0000, Phil Elwell wrote: > On Thu, 19 Jan 2023 at 14:25, Dan Carpenter <error27@gmail.com> wrote: > > > > On Thu, Jan 19, 2023 at 01:47:44PM +0000, Phil Elwell wrote: > > > > > I understand the desire to remove the custom logging. I don't welcome > > > > > the loss of flexibility that comes with such a strategy > > > > > > > > What "loss of flexibility"? You now have access to the full dynamic > > > > debugging facilities that all of the rest of the kernel has. What is > > > > lacking? > > > > > > Perhaps I've missed something, either in this patch set or the kernel > > > as a whole, but how is one supposed to set different logging levels on > > > different facilities within a driver/module, or even for the module as > > > a whole? > > > > Yeah. You will be still able to do that and more besides after the > > transition. Cleaning this up makes the code better in every way. > > > > Documentation/admin-guide/dynamic-debug-howto.rst > > Are you saying this patch set gets us to that point? Yes. The patch has some issues, but yes. regards, dan carpenter
On Thu, 19 Jan 2023 at 14:37, Dan Carpenter <error27@gmail.com> wrote: > > On Thu, Jan 19, 2023 at 02:31:50PM +0000, Phil Elwell wrote: > > On Thu, 19 Jan 2023 at 14:25, Dan Carpenter <error27@gmail.com> wrote: > > > > > > On Thu, Jan 19, 2023 at 01:47:44PM +0000, Phil Elwell wrote: > > > > > > I understand the desire to remove the custom logging. I don't welcome > > > > > > the loss of flexibility that comes with such a strategy > > > > > > > > > > What "loss of flexibility"? You now have access to the full dynamic > > > > > debugging facilities that all of the rest of the kernel has. What is > > > > > lacking? > > > > > > > > Perhaps I've missed something, either in this patch set or the kernel > > > > as a whole, but how is one supposed to set different logging levels on > > > > different facilities within a driver/module, or even for the module as > > > > a whole? > > > > > > Yeah. You will be still able to do that and more besides after the > > > transition. Cleaning this up makes the code better in every way. > > > > > > Documentation/admin-guide/dynamic-debug-howto.rst > > > > Are you saying this patch set gets us to that point? > > Yes. The patch has some issues, but yes. OK, thanks. I'll be watching how this plays out with interest. Phil
On Thu, Jan 19, 2023 at 05:37:48PM +0300, Dan Carpenter wrote: > On Thu, Jan 19, 2023 at 02:31:50PM +0000, Phil Elwell wrote: > > On Thu, 19 Jan 2023 at 14:25, Dan Carpenter wrote: > > > On Thu, Jan 19, 2023 at 01:47:44PM +0000, Phil Elwell wrote: > > > > > > I understand the desire to remove the custom logging. I don't welcome > > > > > > the loss of flexibility that comes with such a strategy > > > > > > > > > > What "loss of flexibility"? You now have access to the full dynamic > > > > > debugging facilities that all of the rest of the kernel has. What is > > > > > lacking? > > > > > > > > Perhaps I've missed something, either in this patch set or the kernel > > > > as a whole, but how is one supposed to set different logging levels on > > > > different facilities within a driver/module, or even for the module as > > > > a whole? > > > > > > Yeah. You will be still able to do that and more besides after the > > > transition. Cleaning this up makes the code better in every way. > > > > > > Documentation/admin-guide/dynamic-debug-howto.rst > > > > Are you saying this patch set gets us to that point? > > Yes. The patch has some issues, but yes. I think I'm missing something too then. Dynamic debug provides the ability to easily switch dev_dbg() messages on and off at runtime, but it doesn't provide, as far as I'm aware, log levels or log categories. Log levels are currently used by the vchiq code to suppress messages below a certain level. Kernel log levels are not an exact replacement, as the messages still end up in the kernel log (except for debug messages). Log categories are used to group messages in categories and control their log level per category. As far as I know, dynamic debug doesn't provide any such feature.
On Fri, Jan 20, 2023 at 02:53:17AM +0200, Laurent Pinchart wrote: > On Thu, Jan 19, 2023 at 05:37:48PM +0300, Dan Carpenter wrote: > > On Thu, Jan 19, 2023 at 02:31:50PM +0000, Phil Elwell wrote: > > > On Thu, 19 Jan 2023 at 14:25, Dan Carpenter wrote: > > > > On Thu, Jan 19, 2023 at 01:47:44PM +0000, Phil Elwell wrote: > > > > > > > I understand the desire to remove the custom logging. I don't welcome > > > > > > > the loss of flexibility that comes with such a strategy > > > > > > > > > > > > What "loss of flexibility"? You now have access to the full dynamic > > > > > > debugging facilities that all of the rest of the kernel has. What is > > > > > > lacking? > > > > > > > > > > Perhaps I've missed something, either in this patch set or the kernel > > > > > as a whole, but how is one supposed to set different logging levels on > > > > > different facilities within a driver/module, or even for the module as > > > > > a whole? > > > > > > > > Yeah. You will be still able to do that and more besides after the > > > > transition. Cleaning this up makes the code better in every way. > > > > > > > > Documentation/admin-guide/dynamic-debug-howto.rst > > > > > > Are you saying this patch set gets us to that point? > > > > Yes. The patch has some issues, but yes. > > I think I'm missing something too then. Dynamic debug provides the > ability to easily switch dev_dbg() messages on and off at runtime, but > it doesn't provide, as far as I'm aware, log levels or log categories. > > Log levels are currently used by the vchiq code to suppress messages > below a certain level. Kernel log levels are not an exact replacement, > as the messages still end up in the kernel log (except for debug > messages). > > Log categories are used to group messages in categories and control > their log level per category. As far as I know, dynamic debug doesn't > provide any such feature. After a bit more research (which I should have done before replying, sorry), it looks like dynamic debug has support for classes, which are used by, for instance, the DRM logging infrastructure (see include/drm/drm_print.h). I don't see that being wired up to dev_*() print macros though, am I missing something, or would vchiq need to keep using custom logging macros (with dynamic debug used as a backend, replacing the current custom implementation) to make use of this feature ?
Hi Umang, Am 18.01.23 um 12:58 schrieb Umang Jain: > Drop custom logging from the vchiq interface. > Mostly of them are replaced with dev_dbg and friends > and/or pr_info and friends. > > The debugfs log levels (in 4/4) are mapped to kernel > logs levels (coming from include/linux/kern_levels.h) > Would like some thoughts on it as I am not sure (hence > marking this is RFC) > > From drivers/staging/vc04_services/interface/TODO: > > """ > * Cleanup logging mechanism > > The driver should probably be using the standard kernel logging mechanisms > such as dev_info, dev_dbg, and friends. > """ at first i want to thank you for the work on vchiq so far. There is something which is not directly related to this series, but it is also about debugging. The driver has a buffer which is accessed by it's own DEBUG_* macros. The content of this debug buffer can be dumped via the /dev/vchiq which is also used by ioctl. I would appreciate to move this dump feature into a new debugfs entry. Best regards
Hi Stefan, Quoting Stefan Wahren (2023-01-22 14:21:05) > Hi Umang, > > Am 18.01.23 um 12:58 schrieb Umang Jain: > > Drop custom logging from the vchiq interface. > > Mostly of them are replaced with dev_dbg and friends > > and/or pr_info and friends. > > > > The debugfs log levels (in 4/4) are mapped to kernel > > logs levels (coming from include/linux/kern_levels.h) > > Would like some thoughts on it as I am not sure (hence > > marking this is RFC) > > > > From drivers/staging/vc04_services/interface/TODO: > > > > """ > > * Cleanup logging mechanism > > > > The driver should probably be using the standard kernel logging mechanisms > > such as dev_info, dev_dbg, and friends. > > """ > > at first i want to thank you for the work on vchiq so far. > > There is something which is not directly related to this series, but it > is also about debugging. The driver has a buffer which is accessed by > it's own DEBUG_* macros. The content of this debug buffer can be dumped > via the /dev/vchiq which is also used by ioctl. I would appreciate to > move this dump feature into a new debugfs entry. Do you have a full list of the tasks you'd like to see completed ? (including/or above drivers/staging/vc04_services/interface/TODO) It would help to have a clear picture of tasks needed to get this driver destaged, so that we can support the ISP upstream. Regards -- Kieran
Hi Kieran, Am 22.01.23 um 17:26 schrieb Kieran Bingham: > Hi Stefan, > > Quoting Stefan Wahren (2023-01-22 14:21:05) >> Hi Umang, >> >> Am 18.01.23 um 12:58 schrieb Umang Jain: >>> Drop custom logging from the vchiq interface. >>> Mostly of them are replaced with dev_dbg and friends >>> and/or pr_info and friends. >>> >>> The debugfs log levels (in 4/4) are mapped to kernel >>> logs levels (coming from include/linux/kern_levels.h) >>> Would like some thoughts on it as I am not sure (hence >>> marking this is RFC) >>> >>> From drivers/staging/vc04_services/interface/TODO: >>> >>> """ >>> * Cleanup logging mechanism >>> >>> The driver should probably be using the standard kernel logging mechanisms >>> such as dev_info, dev_dbg, and friends. >>> """ >> at first i want to thank you for the work on vchiq so far. >> >> There is something which is not directly related to this series, but it >> is also about debugging. The driver has a buffer which is accessed by >> it's own DEBUG_* macros. The content of this debug buffer can be dumped >> via the /dev/vchiq which is also used by ioctl. I would appreciate to >> move this dump feature into a new debugfs entry. > Do you have a full list of the tasks you'd like to see completed ? > (including/or above drivers/staging/vc04_services/interface/TODO) i consider every point except of point 1 (importing new drivers) as necessary to leave staging. Additionally there is the additional point (i can add them to the TODO) above. Unfortunately i don't have a complete insight, how vchiq should be to be acceptable. Sorry, if i can't help you further with possible resource planning. Are some points on the TODO list unclear? Thanks > > It would help to have a clear picture of tasks needed to get this driver > destaged, so that we can support the ISP upstream. > > Regards > -- > Kieran
On Fri, Jan 20, 2023 at 02:53:15AM +0200, Laurent Pinchart wrote: > Log categories are used to group messages in categories and control > their log level per category. As far as I know, dynamic debug doesn't > provide any such feature. One idea is you could put the category in the format string. Then you could just grep /proc/dynamic_debug/control for it and enable the printks like that. regards, dan carpenter
Hi Stefan, Quoting Stefan Wahren (2023-01-22 18:07:03) > Hi Kieran, > > Am 22.01.23 um 17:26 schrieb Kieran Bingham: > > Hi Stefan, > > > > Quoting Stefan Wahren (2023-01-22 14:21:05) > >> Hi Umang, > >> > >> Am 18.01.23 um 12:58 schrieb Umang Jain: > >>> Drop custom logging from the vchiq interface. > >>> Mostly of them are replaced with dev_dbg and friends > >>> and/or pr_info and friends. > >>> > >>> The debugfs log levels (in 4/4) are mapped to kernel > >>> logs levels (coming from include/linux/kern_levels.h) > >>> Would like some thoughts on it as I am not sure (hence > >>> marking this is RFC) > >>> > >>> From drivers/staging/vc04_services/interface/TODO: > >>> > >>> """ > >>> * Cleanup logging mechanism > >>> > >>> The driver should probably be using the standard kernel logging mechanisms > >>> such as dev_info, dev_dbg, and friends. > >>> """ > >> at first i want to thank you for the work on vchiq so far. > >> > >> There is something which is not directly related to this series, but it > >> is also about debugging. The driver has a buffer which is accessed by > >> it's own DEBUG_* macros. The content of this debug buffer can be dumped > >> via the /dev/vchiq which is also used by ioctl. I would appreciate to > >> move this dump feature into a new debugfs entry. > > Do you have a full list of the tasks you'd like to see completed ? > > (including/or above drivers/staging/vc04_services/interface/TODO) > > i consider every point except of point 1 (importing new drivers) as > necessary to leave staging. Thanks > Additionally there is the additional point (i can add them to the TODO) > above. Unfortunately i don't have a complete insight, how vchiq should > be to be acceptable. Sorry, if i can't help you further with possible > resource planning. > > Are some points on the TODO list unclear? I believe the list is fine, but I was enquiring if there were anymore additional tasks above the scope listed in drivers/staging/vc04_services/interface/TODO which are required. I don't think you need to send a patch for the task above - unless there are a lot more tasks required, or it becomes too much to do now. The goal is to get the ISP upstream to support libcamera, and it would help to know how deep the rabbit hole really is ;-) -- Kieran