Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1267961ybg; Thu, 11 Jun 2020 05:37:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2r/Ih+k9mDjm7Wb94hHvjuXeWXIpVG0Cju/bdi8cdEfZi89pb6bO/KAPn03WMoZBp4Ffx X-Received: by 2002:a17:906:4e59:: with SMTP id g25mr7962461ejw.60.1591879059766; Thu, 11 Jun 2020 05:37:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591879059; cv=none; d=google.com; s=arc-20160816; b=bPlm/koOOuqvqjK6a2muXOBXNCKqulwbbrJ6UEvEzor8sGYcK7VoOlC+8w5jgRbAnK S8xjFF7h5bQD3Miv0SCdins1YnahuDnGw4mX/RLFKMSHzTUBbex7zUjfafWKKt6cOtTi TFVpfd9bKB7yzt2+Ki8LUY2bcjmgDIIoMwqhvkuvHmQLMaFf2eS84nZ+bEjmBRzYUtrw 2eYQPxpvmckGgs973UDbVYP7NgNlBqPX4ip2lUXWb/eusM0Fu4o7MepwZ4hkxDB1wT4e Zf+8V8FJVoLL5eR4XSA72K/eW8Nwxne4hDEjVcHvCf4jyocS9khhk+elj8kAigqV69XH pxCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=sRWbDkWYC9nAJ025IRpbFE/lsotHSaYZvRXdkx9meq8=; b=qns9mQp7rAQbtPeNOJRxkdkI2TBi7CySokBMDZMU7LSFHWHTKnOwnjo62XKnQDKLwM UFBELFNK/nGqR/gVVfZMhlp4UUQJFwetZAreUooImy71fwXdUDHnlWXPIGf3Jv4u8cAp 3/+sS8TkOKGiiXP5MOAymKWRmdpc2tQ6ClcO/hEJRjUWUhdFkv7VRUUKBri4fbOfwWpL KBgyVKiykzCRHBjMsNlbjlZ6zoSFOfEy7HhIa7NVkcC+3Lnxy82UiySpTRNpX4U13Rby 8SUMCUUBrvOFBcyHjuVWE5pLWY8M57qpCeXRyi4DFcs1z5EhsLZtynd+2U1SbHM+gpYl Nlxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h9ZDfCmR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s23si1679788ejq.306.2020.06.11.05.37.15; Thu, 11 Jun 2020 05:37:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h9ZDfCmR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728111AbgFKMSa (ORCPT + 99 others); Thu, 11 Jun 2020 08:18:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727097AbgFKMS1 (ORCPT ); Thu, 11 Jun 2020 08:18:27 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3B8BC08C5C8 for ; Thu, 11 Jun 2020 05:18:22 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id x14so5936669wrp.2 for ; Thu, 11 Jun 2020 05:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=sRWbDkWYC9nAJ025IRpbFE/lsotHSaYZvRXdkx9meq8=; b=h9ZDfCmR0YS08+PTFkGw2gZVSqhrHw/UmrHbYlzU9f0Dn5QXGMVMJftpUyXymoA0VI fPKaRMj6HsWvV84ZyaZzyPK1eJWeHtQObzPllZBdrEo27HzZIXGuU/6suX4aKPZXb63e DPPrSW4DFI5LAb4EO/zU6AqUY9QKoS6x+bt3pkp5w6u/M4sRHCLdBBF0lxYW1eyPr3ZT Cq7tm/SVcjqkObP5Wvr9NCkYPXiUioOaGWG3guBsAN0wFcQ9SmHH2hZhgvUS06e2N2LH vIsc/gydaUHLiYzn0EcPLCH+iuqnv3es7iiKSfsi599GMuZAmNAFpJkQ7fZb4fAG4kMK s+fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=sRWbDkWYC9nAJ025IRpbFE/lsotHSaYZvRXdkx9meq8=; b=Vv7w+8lYSWsCrzSHkpRS9J3ZzbG/Aij86r5+Uz31T39M+S/awcRCo8p0IqXPyCSkrh t38ph9cLuz2G+OYYa1/EsE89Alb9PoPQ747fp+Mrwgfytq5bIxeDG39+UvawFxRpHU/v 4hVbwL790GQtDxHp+HXToyXsGDfDu1uhnAfLLkV2o60UxBfIPRFz4iGnn5NAHkrXVAW5 CLoXZjdjE2/GxU9XNaD0kN+7/MUGcQ2KLPohsqvgM0B90aN6kOAqj9otaNT4hLZRF96a 7O6YhaT6YoQ0XTV1SWOzd4UOmxeWLydirLDD3mL5pga876gIPYoS3qs5Ni9s1r38Un5z 4duQ== X-Gm-Message-State: AOAM531CWOkiA9/4oZXEubqn70De5fvRCs2HG988KWgFCVruiwdK5N+1 hRx+03pWF9AynHRrFAUZoMfpaQ== X-Received: by 2002:adf:ab09:: with SMTP id q9mr9041005wrc.79.1591877901073; Thu, 11 Jun 2020 05:18:21 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id v19sm3769655wml.26.2020.06.11.05.18.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2020 05:18:19 -0700 (PDT) Date: Thu, 11 Jun 2020 13:18:17 +0100 From: Daniel Thompson To: Stanimir Varbanov Cc: Joe Perches , Greg Kroah-Hartman , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-acpi@vger.kernel.org, netdev@vger.kernel.org, Jason Baron Subject: Re: [PATCH v3 6/7] venus: Make debug infrastructure more flexible Message-ID: <20200611121817.narzkqf5x7cvl6hp@holly.lan> References: <20200609104604.1594-7-stanimir.varbanov@linaro.org> <20200609111414.GC780233@kroah.com> <20200610133717.GB1906670@kroah.com> <31e1aa72b41f9ff19094476033511442bb6ccda0.camel@perches.com> <2fab7f999a6b5e5354b23d06aea31c5018b9ce18.camel@perches.com> <20200611062648.GA2529349@kroah.com> <20200611105217.73xwkd2yczqotkyo@holly.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 11, 2020 at 02:31:07PM +0300, Stanimir Varbanov wrote: > On 6/11/20 1:52 PM, Daniel Thompson wrote: > > On Wed, Jun 10, 2020 at 11:42:43PM -0700, Joe Perches wrote: > >> On Thu, 2020-06-11 at 08:26 +0200, Greg Kroah-Hartman wrote: > >>> On Wed, Jun 10, 2020 at 01:23:56PM -0700, Joe Perches wrote: > >>>> On Wed, 2020-06-10 at 12:49 -0700, Joe Perches wrote: > >>>>> On Wed, 2020-06-10 at 15:37 +0200, Greg Kroah-Hartman wrote: > >>>>>> Please work with the infrastructure we have, we have spent a lot of time > >>>>>> and effort to make it uniform to make it easier for users and > >>>>>> developers. > >>>>> > >>>>> Not quite. > >>>>> > >>>>> This lack of debug grouping by type has been a > >>>>> _long_ standing issue with drivers. > >>>>> > >>>>>> Don't regress and try to make driver-specific ways of doing > >>>>>> things, that way lies madness... > >>>>> > >>>>> It's not driver specific, it allows driver developers to > >>>>> better isolate various debug states instead of keeping > >>>>> lists of specific debug messages and enabling them > >>>>> individually. > >>>> > >>>> For instance, look at the homebrew content in > >>>> drivers/gpu/drm/drm_print.c that does _not_ use > >>>> dynamic_debug. > >>>> > >>>> MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug category.\n" > >>>> "\t\tBit 0 (0x01) will enable CORE messages (drm core code)\n" > >>>> "\t\tBit 1 (0x02) will enable DRIVER messages (drm controller code)\n" > >>>> "\t\tBit 2 (0x04) will enable KMS messages (modesetting code)\n" > >>>> "\t\tBit 3 (0x08) will enable PRIME messages (prime code)\n" > >>>> "\t\tBit 4 (0x10) will enable ATOMIC messages (atomic code)\n" > >>>> "\t\tBit 5 (0x20) will enable VBL messages (vblank code)\n" > >>>> "\t\tBit 7 (0x80) will enable LEASE messages (leasing code)\n" > >>>> "\t\tBit 8 (0x100) will enable DP messages (displayport code)"); > >>>> module_param_named(debug, __drm_debug, int, 0600); > >>>> > >>>> void drm_dev_dbg(const struct device *dev, enum drm_debug_category category, > >>>> const char *format, ...) > >>>> { > >>>> struct va_format vaf; > >>>> va_list args; > >>>> > >>>> if (!drm_debug_enabled(category)) > >>>> return; > >>> > >>> Ok, and will this proposal be able to handle stuff like this? > >> > >> Yes, that's the entire point. > > > > Currently I think there not enough "levels" to map something like > > drm.debug to the new dyn dbg feature. I don't think it is intrinsic > > but I couldn't find the bit of the code where the 5-bit level in struct > > _ddebug is converted from a mask to a bit number and vice-versa. > > Here [1] is Joe's initial suggestion. But I decided that bitmask is a > good start for the discussion. > > I guess we can add new member uint "level" in struct _ddebug so that we > can cover more "levels" (types, groups). I don't think it is allocating only 5 bits that is the problem! The problem is that those 5 bits need not be encoded as a bitmask by dyndbg, that can simply be the category code for the message. They only need be converted into a mask when we compare them to the mask provided by the user. Daniel.