Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5817129rwb; Wed, 7 Sep 2022 08:22:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR4L4X8UrGTCR8QVKR3jkYzmT2/1b3jpyGuoaqhuO/OaBoSy5vtx0xwEQSIa8IZ5sXcRKVbd X-Received: by 2002:a63:2ace:0:b0:434:ebd5:e18e with SMTP id q197-20020a632ace000000b00434ebd5e18emr2514811pgq.79.1662564172046; Wed, 07 Sep 2022 08:22:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662564172; cv=none; d=google.com; s=arc-20160816; b=Wh9YpgYXAKAjprG7QU7w61/k5DEsHjOlewd4ANmxVIykBMATKEcOEAqmOIiub3hkT4 +xix2Bfg7f7pVVyOwKC18+Dp3bY40nY8HYcVVIjddUzRDvBGXkcXTpVKtIF0HQYDU9Gj nR5V5Iq0ieFXwCUziVCpdpsfvIjSTqTHJCI7o8/Pq9Z3gtXA7VbZvEQktpkA3/jE78dc IyNSM8qpNLaTCEOSOGbKTvuEHboLHT2TQcg9rMr2DZ6btNe+5LM9BMPooofhtwMpDXBy 4ykZjOARCSs8ifhMwy6eAUHZ16AlmFEziQsfOOdgdNJW/4N5q4IJKR8iMCtLZ+AaHpXU ONnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ijjc2Ts590IaXEQ8GyhPvaO5ZG+1GuvvjyW4aP5oWJ8=; b=mAJRlPMo2m6hTXId/qPTolGZp77J6WjFqq3akXeLosarJP4IfUc6YW+kbsiyvZHHTN Kq18j9nEm10cieUqWC99/DzKwvyk/MEo0pw1EjCeIweqciuhEry3wlyM9CbaLyXlKicV 1Qlrpp/pSkCmI1HnKfZGlsgPSWAu+m2q4Q4jxkGTC1gxulRnvFcMxEoJYR4QzaxyuwFF M6bqPMC75r6qG+p0nb/yQmlH1Iqv139lCcqJn0aFkr2Ewv+/iuQk81t6zVQp66RtBEhA c/JRDAoyiOU50AQfY83xBvdHVwjz0bKIOtzu71C/HY3ouMnoPSlHIFjPWZ4uQMsqOaVo 5WUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oblWhgsO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x10-20020a63310a000000b00434dfe7b75esi3139979pgx.223.2022.09.07.08.22.39; Wed, 07 Sep 2022 08:22:52 -0700 (PDT) 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 header.i=@linuxfoundation.org header.s=korg header.b=oblWhgsO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229910AbiIGPIt (ORCPT + 99 others); Wed, 7 Sep 2022 11:08:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230270AbiIGPIl (ORCPT ); Wed, 7 Sep 2022 11:08:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 845FAB530A for ; Wed, 7 Sep 2022 08:08:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 09B1161934 for ; Wed, 7 Sep 2022 15:08:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7C37C433D7; Wed, 7 Sep 2022 15:08:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662563319; bh=Mx0jPGtZh9KvHJBXC3DHP2hFP5jcs+G6XteAFAWh5CM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oblWhgsO9Emx5t58TgoBHwCAfEnh9f3kgA3t8244JcZe//QinXf9lm0yHywCt0zdx BCQad5AvvhmDGmJbdVs5KE0D532+jb0IFykXbujP2bvqem4jFzXKV0UZSPG12naGxS k3nzgVSEyUrhVPJP6b4wNHVFZbeEx0LD4062s2yQ= Date: Wed, 7 Sep 2022 17:08:36 +0200 From: Greg KH To: Jim Cromie Cc: jbaron@akamai.com, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, daniel.vetter@ffwll.ch, seanpaul@chromium.org, robdclark@gmail.com, linux@rasmusvillemoes.dk, joe@perches.com Subject: Re: [PATCH v6 00/57] DYNDBG: opt-in class'd debug for modules, use in drm. Message-ID: References: <20220904214134.408619-1-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220904214134.408619-1-jim.cromie@gmail.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 04, 2022 at 03:40:37PM -0600, Jim Cromie wrote: > hi Greg, Jason, DRM-folk, Steven, > > If Im not too late for linux-next in this cycle, heres V6. Diffs are minor: > > - rebased onto e47eb90a0a9a (tag: next-20220901, linux-next/master) > gets past Kconfig conflict, same for drm-tip. > - uint debug_level, not ulong. to fit nouveau. > - -1 on param-read-back, to match prev write val. > - added back tracefs parts, missing from -V5 > updated for tracing/events: Add __vstring() and __assign_vstr() helper macros > no decorations-lite in TP_printk, do it right later. > - commit-msg tweaks > > Theres also new RFC stuff with the potential to reduce the size of the > __dyndbgs section by 20%. Not ready for prime time, or linux-next, > but I hope compelling. > > FEATURE DESCRIPTION > > dyndbg provides DECLARE_DYNAMIC_DEBUG_CLASSMAP() which allows module > authors to declare "good" class-names, of 4 types. > > DYNAMIC_DEBUG_CLASSMAP(drm_debug_classes, > DD_CLASS_TYPE_DISJOINT_BITS, offset, > "DRM_UT_CORE", > "DRM_UT_DRIVER", > "DRM_UT_KMS", > "DRM_UT_PRIME", > "DRM_UT_ATOMIC", > "DRM_UT_VBL", > "DRM_UT_STATE", > "DRM_UT_LEASE", > "DRM_UT_DP", > "DRM_UT_DRMRES"); > > That usage authorizes dyndbg to set class'd pr_debugs accordingly: > > echo class DRM_UT_CORE +p > /proc/dynamic_debug/control > echo class DRM_UT_KMS +p > /proc/dynamic_debug/control > > Because the DRM modules declare the same classes, they each authorize > dyndbg with the same classnames, which allows dyndbg to effect changes > to its selected class'd prdbgs. > > Opting in by using the macro effectively privatizes the limited > 63-classes available per module; only modules which share classnames > must coordinate their use of the common range, and they can > independently use the remaining id-space. > > Other dyndbg filtering pertains too, so single sites can be selected. > > > 4 DD_CLASS_TYPE_*_*s determine 2 behaviors: > > DISJOINT bits are independent, like drm.debug categories > LEVELs 3>2, turns on level-2, like nouveau debug-levels > NUM/BITS numeric input, bitmap if disjoint, else 0-32. > NAMES accept proper names, like DRM_UT_CORE > > Dyndbg provides param-callbacks which enforce those behaviors: > > # DISJOINT_BITS > echo 0x03 > /sys/module/drm/parameters/debug > > # LEVEL_NUM > echo 3 > /sys/module/drm/nouveau/debug-mumble* > > # DISJOINT_NAMES > echo +DRM_UT_CORE,+DRM_UT_KMS,-DRM_UT_DRIVER > /sys/module/drm/parameters/debug_categories > > # LEVEL_NAMES > echo NV_TRACE > /sys/module/nouveau/parameters/debug-mumble* > > That design choice is allowed cuz verbosity is always attached to a > (user visible) interface, and theres no reason not to put the > implementation there (in the callback). It also considerably > simplifies things; ddebug_change can treat class_id's as disjoint, > period. > I've applied the first 21 patches in this series to my driver-core-testing branch, and if 0-day doesn't blow up on it, I'll move it to my -next branch tomorrow and it will get a wider testing range in the linux-next releases. Feel free to rebase the rest of the series on top of my tree and resubmit after addressing Daniel's comments. thanks, greg k-h