Received: by 2002:ac8:678b:0:b0:405:464a:c27a with SMTP id b11csp16298qtp; Tue, 1 Aug 2023 12:17:47 -0700 (PDT) X-Google-Smtp-Source: APBJJlEIc2DPbhrBqNAD7n6VeBtMuRnsGia7pooxCWdXjMtHUhYW52x2Cu1CFMz4yE0wHUss17o4 X-Received: by 2002:a05:6512:2394:b0:4fb:52f1:9ab4 with SMTP id c20-20020a056512239400b004fb52f19ab4mr3875410lfv.50.1690917467311; Tue, 01 Aug 2023 12:17:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690917467; cv=none; d=google.com; s=arc-20160816; b=QV68RBs35qFu1C0mrHuJ/4WSOHO/9dsM12hKmv5wYtm/HzSRkXAj8mBgz/JcTcuXQ6 7MfgGCc3lyWWvAvnJf08cbPri4e2qGSqu6Rs7xaBKyC5EWaWrDSGBDh3TZee4QVB0ZOB 6Wkpq1MQLDEstVNH2fwE+L1OhP7tskS0u2eK/h6587mdYaLPM6ijSuB3Z7pZcV4VSLdK TtFXTMszIRTo6YWq12yUk/5PxIBeYVHCUQIMLbGlbI4vI8ezTxVqkQdmk+i0JSPfNlyD r/waUlCLUf9ef61Dx/y1wUcAeXNOU0fCrYWjafV1GJf9HxAOOXkeW05axuorHQvbxiV5 8pVw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=K8UwYEhXGvMOm9hJtDT9yME4JurF5Y1Dv5ly2jFMGr8=; fh=u5vE1TE1dJB7o4IGsVvua16vnF8dhcoUHNlJ2pbkr7c=; b=RT99Ks2133eFJK4fN/K8exKAwkycH2Zz155rKIllpN6cB6CM02atJBaBW1FgbwWHow vRfdyTEYMqhLQKYn5Y+J+BLBI5LsUCoyu5QezeFDCvCC6/qUSJTqDqFgoxYPtVpYUnqg Gi4lCc8ABY1smOQe9erKZ84O2IO9oZ59/7SFQvxd6Ducca3hjXcOCtts6JiR0QMyO52X 6ileEv5wVOz8JSBLQWxz2x34OVKKsI1PSi6U8A8TW4+Aozn/hsIzKYs5SK1uunSqj1k+ 2c5jnc++czQZiXzNa81MW710BUnBoBICu5pF1EyxDDtHxdUDq9p8R5RCXyvvlAzwoc/M PGgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=HjGZKDSb; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m21-20020a50ef15000000b005223b6e4cf9si5334986eds.443.2023.08.01.12.17.22; Tue, 01 Aug 2023 12:17:47 -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=@gmail.com header.s=20221208 header.b=HjGZKDSb; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234194AbjHARDe (ORCPT + 99 others); Tue, 1 Aug 2023 13:03:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233970AbjHARDX (ORCPT ); Tue, 1 Aug 2023 13:03:23 -0400 Received: from mail-oa1-x30.google.com (mail-oa1-x30.google.com [IPv6:2001:4860:4864:20::30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44F5B26A1 for ; Tue, 1 Aug 2023 10:03:19 -0700 (PDT) Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-1bc479cc815so2495480fac.1 for ; Tue, 01 Aug 2023 10:03:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690909398; x=1691514198; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=K8UwYEhXGvMOm9hJtDT9yME4JurF5Y1Dv5ly2jFMGr8=; b=HjGZKDSbMbpsnEvtJKmORkbhymh+5w+8w9Qb9gOwtWq3hAh1CvP9bpz2RuOPGiW3AC RXBOyBCYtVUbzPG1nkx3S2bKIjZbTcWGWWh17GxpJ0WvwCcknqodhJshYgEnUg81G4of 1dt8hjuRzApX9ExwC7nrZeWaFxILtLSGbcutJBc22B2irQIno+CPaD91UL1XHGHk5VCK S8ax8Y3F7cBjQVziVMXdOD6vZMC9qb0Bv7xvKSO2qRIoz3XVh6zqLkNhX81oQhYSUwY1 VYpUVmurffbOdR9kZWuNC5hLf2Y7pLTyr4pNxh4PFxNqd2dkU6ppS/DIa8dAZwva7Udy 1r4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690909398; x=1691514198; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K8UwYEhXGvMOm9hJtDT9yME4JurF5Y1Dv5ly2jFMGr8=; b=hqNiD0EWEqiMG7YkulNxhb5SteLqdSAJl5aFMk4ob/DwHqEqAzt2W9lI6o1dfoqJvO aKiay5wFzFbIP/NAAX2bXKrylMSkoDZpq/wBekfyvlSS4iH5GnRVaHkqO1CpqtT6tr08 7TdXyVgmYKK+WjmEMjOpIXrzq0Mz4Ttp1965U9Ax33k5qq1GfL6udE9KtfJ6VEA2i3ef fhZE6+ZDG5+iZEQeDX2cOh2g+LRamSwF4sSlvxr+Id4SmKTVtwK6N6Wh8DzI0xeciwGZ jabD8WERhAsXLwyZpXAp1ywZViYWcg+zKCmEsNhklgg12Ruz5cY1ILzDk9jvsuLmPCFp 8Dwg== X-Gm-Message-State: ABy/qLbslUGNYlWGA+O/oJiZoqFfZguYzlecGHpJE1mOvnMn46Xdk1zt JzDmiVYaL3waRgbP7vyAVC0= X-Received: by 2002:a05:6870:c685:b0:1b7:4655:2ac9 with SMTP id cv5-20020a056870c68500b001b746552ac9mr16125728oab.6.1690909398089; Tue, 01 Aug 2023 10:03:18 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id o20-20020a02c6b4000000b0042b144abf71sm3768577jan.179.2023.08.01.10.03.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 10:03:17 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, daniel@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: linux@rasmusvillemoes.dk, joe@perches.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, Jim Cromie Subject: [PATCH v5 05/22] dyndbg: ddebug_apply_class_bitmap - add module arg, select on it Date: Tue, 1 Aug 2023 11:02:37 -0600 Message-ID: <20230801170255.163237-6-jim.cromie@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230801170255.163237-1-jim.cromie@gmail.com> References: <20230801170255.163237-1-jim.cromie@gmail.com> 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,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 Add query_module param to ddebug_apply_class_bitmap(). This allows its caller to update just one module, or all (as currently). We'll use this later to propagate drm.debug to each USEr as they're modprobed. No functional change. Signed-off-by: Jim Cromie --- after `modprobe i915`, heres the module dependencies, though not all on drm.debug. bash-5.2# lsmod Module Size Used by i915 3133440 0 drm_buddy 20480 1 i915 ttm 90112 1 i915 i2c_algo_bit 16384 1 i915 video 61440 1 i915 wmi 32768 1 video drm_display_helper 200704 1 i915 drm_kms_helper 208896 2 drm_display_helper,i915 drm 606208 5 drm_kms_helper,drm_display_helper,drm_buddy,i915,ttm cec 57344 2 drm_display_helper,i915 --- lib/dynamic_debug.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index b4b6c5111315..d875c4fa5335 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -600,7 +600,8 @@ static int ddebug_exec_queries(char *query, const char *modname) /* apply a new bitmap to the sys-knob's current bit-state */ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, - unsigned long *new_bits, unsigned long *old_bits) + unsigned long *new_bits, unsigned long *old_bits, + const char *query_modname) { #define QUERY_SIZE 128 char query[QUERY_SIZE]; @@ -608,7 +609,8 @@ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, int matches = 0; int bi, ct; - v2pr_info("apply: 0x%lx to: 0x%lx\n", *new_bits, *old_bits); + v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, *old_bits, + query_modname ?: ""); for (bi = 0; bi < map->length; bi++) { if (test_bit(bi, new_bits) == test_bit(bi, old_bits)) @@ -617,12 +619,15 @@ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, snprintf(query, QUERY_SIZE, "class %s %c%s", map->class_names[bi], test_bit(bi, new_bits) ? '+' : '-', dcp->flags); - ct = ddebug_exec_queries(query, NULL); + ct = ddebug_exec_queries(query, query_modname); matches += ct; v2pr_info("bit_%d: %d matches on class: %s -> 0x%lx\n", bi, ct, map->class_names[bi], *new_bits); } + v2pr_info("applied bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, *old_bits, + query_modname ?: ""); + return matches; } @@ -678,7 +683,7 @@ static int param_set_dyndbg_classnames(const char *instr, const struct kernel_pa continue; } curr_bits ^= BIT(cls_id); - totct += ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits); + totct += ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits, NULL); *dcp->bits = curr_bits; v2pr_info("%s: changed bit %d:%s\n", KP_NAME(kp), cls_id, map->class_names[cls_id]); @@ -688,7 +693,7 @@ static int param_set_dyndbg_classnames(const char *instr, const struct kernel_pa old_bits = CLASSMAP_BITMASK(*dcp->lvl); curr_bits = CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); - totct += ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits); + totct += ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits, NULL); *dcp->lvl = (cls_id + (wanted ? 1 : 0)); v2pr_info("%s: changed bit-%d: \"%s\" %lx->%lx\n", KP_NAME(kp), cls_id, map->class_names[cls_id], old_bits, curr_bits); @@ -751,7 +756,7 @@ int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp) inrep &= CLASSMAP_BITMASK(map->length); } v2pr_info("bits:%lx > %s\n", inrep, KP_NAME(kp)); - totct += ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits); + totct += ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, NULL); *dcp->bits = inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -764,7 +769,7 @@ int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp) old_bits = CLASSMAP_BITMASK(*dcp->lvl); new_bits = CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); - totct += ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits); + totct += ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, NULL); *dcp->lvl = inrep; break; default: -- 2.41.0