Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3942788rdg; Wed, 18 Oct 2023 10:07:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPg+8l+5El2HQw7lwk/r6GGrVlCKeg65I5sUWhSMxWl0EIs31TK+lS5nkHIYz+JownDcBk X-Received: by 2002:a17:902:e844:b0:1c2:193e:1126 with SMTP id t4-20020a170902e84400b001c2193e1126mr7550448plg.28.1697648828017; Wed, 18 Oct 2023 10:07:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697648828; cv=none; d=google.com; s=arc-20160816; b=LxtT4pD/rAyAfgs9YjDfXxBWdOoF9ggImhh7c+KVMqQDKYfezVP7YbdiC3BmQ1W00Y cmtUS+UriUtf9bB3j5qt++Q3UGeri4EQLboxAa2fjSo9av/NwIvhDdUKCiD0m7Wt03GM wIbxORRtfr/gi9Xj6OZtdkwkmHei51JwZoasowS/LYuRwK3BSlMPJFrev2B6qIcYPVnD kjrRRewrC/c4Sc2T+CunyfkTRsTfYxmYMWYZgC63oDhHRuuI/eAyVjV6WJ11NPzbh5zB Qtx0kHEpkLfiP6LZqx8nBk5xRI7HkV8pgQu2DriU287i7Zkjh6vMLFWyBxKISA09912E 0omg== 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=nT2UcGPT6Cy6K92hgVjA+Vm5zzO1oFmjE5g1Jwvt+zM=; fh=dD4hpA3+YqlszWEwFTO+ADczjyhU7P27niWnWgZXhCU=; b=YJsyreZPcpYGQcO1gWw94sDtagKJYdu+cr43Rbnkom04paJnkQRXGucR1rFoKd794W swFjVwArLLOCMLYSFW6djEi6JLX6Q9G+xL265FLg/0eKb5JjCglfhNaeKlj0eHKVqM9R 0X/3XyNq6NbllUU1IkDiKAHApDSoL0GY5ih4Ms8LlYCSHUzVNRyd5KFlv5KdJ+0GHLTO uwNSCLyTN+0rQRcYOOG+BJNIJcS9UDiZkMVxkJRoSomnyk5QlcbHj0f76BjQqvoEFqb8 P8fcoQ7pagPwRjzEdb+Ph2o6fQofaQZBNqMpZM2QZ/6TfvSusytD7fAnVswd5dXlrXzL O3Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RrGGEGeu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h12-20020a170902f54c00b001bf1a9dbcc9si271174plf.549.2023.10.18.10.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 10:07:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RrGGEGeu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 308078134CF1; Wed, 18 Oct 2023 10:06:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231708AbjJRRGc (ORCPT + 99 others); Wed, 18 Oct 2023 13:06:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231365AbjJRRGT (ORCPT ); Wed, 18 Oct 2023 13:06:19 -0400 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D271B0; Wed, 18 Oct 2023 10:06:16 -0700 (PDT) Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-7a66ff282baso22445439f.0; Wed, 18 Oct 2023 10:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697648775; x=1698253575; darn=vger.kernel.org; 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=nT2UcGPT6Cy6K92hgVjA+Vm5zzO1oFmjE5g1Jwvt+zM=; b=RrGGEGeuPXuoDT8tE/d0v05LNYvNxDhlBWz3IVoIDUY2IW2IrZneWn8aDvjwT/BiNR jzhJv+6wYL3CR4e1Ix4ct98zrnHGMyL2sEw4oWD6OBZaP9Sp8JNGuOyGw+EN23PvS8Kb m4qsIk4pd9WMy29lj37b9ZBLsUH/U8RqA8vULUdMaqXbWBTOyNTQl6TWYg8sBNAS5Kcp YZvvUyGNFLHSAfGGE/UWkIwDrE3uwO8f0ZZasQ0pgNTB1zuAPA2ln7iMvS2ytUvt3fWd 3ENOHLs6ec92HMHr68xUSajcPwrHgfYKmdMALxeZ5wOGeRUknANtn+cg6U8PNmspgk0R dN+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697648775; x=1698253575; 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=nT2UcGPT6Cy6K92hgVjA+Vm5zzO1oFmjE5g1Jwvt+zM=; b=unuL7c7UsQHFpgaEwkFBGq7gLUCwLujE6+0LlSmUGzaiJEsF7YxyVQMurtCKXCQAAD x158T+IlJa1E4PCLt28dcBu7ggfRAAkK2jCFECAtSGs71WSWvoCFoKZPsyyF7JQlyqbD BFL19vNdfY8pU9iCI6ysq6GFXP/yA6wSxfMNuFUcdjduHZ1rl0rETzG3gARlZEi7D4vc vpDoEIvkZkzwFnfxxR2MlpVKxjsz3gEvD5uqwHqyQJlQbZsGljTTuuh26eDOlbwNbXg/ ZJe/HToTG4z5YcZw5FHYpzmj5PUYT3XAgbcT3Up9VgGKULcfWfToMwyuo21paPnULU87 6vMw== X-Gm-Message-State: AOJu0YxdPG0KZIDO1Dk5ltfn5tAarPJFoYjUR9JKLEv0OxfpJXD/6wG0 9JiWxVodgr7LQEeDZfVdbveNk+u+TmA9Kg== X-Received: by 2002:a05:6602:160a:b0:794:eb37:b0da with SMTP id x10-20020a056602160a00b00794eb37b0damr5194062iow.2.1697648775455; Wed, 18 Oct 2023 10:06:15 -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 n4-20020a5d8244000000b0079fa1a7cd36sm1228944ioo.30.2023.10.18.10.06.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 10:06:15 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: lb@semihalf.com, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, daniel.vetter@ffwll.ch, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, rostedt@goodmis.org, linux-doc@vger.kernel.org, Jim Cromie Subject: [PATCH v7c 05/24] dyndbg: ddebug_apply_class_bitmap - add module arg, select on it Date: Wed, 18 Oct 2023 11:05:45 -0600 Message-ID: <20231018170604.569042-6-jim.cromie@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231018170604.569042-1-jim.cromie@gmail.com> References: <20231018170604.569042-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_BLOCKED,SPF_HELO_NONE,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: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 18 Oct 2023 10:06:36 -0700 (PDT) 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 a3be2e7c8c84..ba41fdeaaf98 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -601,7 +601,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]; @@ -609,7 +610,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)) @@ -618,12 +620,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; } @@ -679,7 +684,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]); @@ -689,7 +694,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); @@ -752,7 +757,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: @@ -765,7 +770,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