Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3943859rdg; Wed, 18 Oct 2023 10:08:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFQONrzSEHNKi4LiqvoGbelkKEOG3Q5kAPXsaeRJGGpZBppxzHjHbz/aI0eWnClndTvrVSI X-Received: by 2002:a05:6871:c03:b0:1ea:125f:cffa with SMTP id ve3-20020a0568710c0300b001ea125fcffamr6859827oab.34.1697648922583; Wed, 18 Oct 2023 10:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697648922; cv=none; d=google.com; s=arc-20160816; b=hB7K2V+I/x2GJ2xk8Y7CoynznARALNxaKxReTjsOrchizunry/YfUKypqVWSvldqds E+6UVDOgiWsIuqBkg1BEETcCP+wL7r4IWylTygs5rozsfZJ8SYw4FiEN/z6nnaewKeIw QoiLy5VsX94jWvbJvbImL11ehRRVX/HDa3B1nC8rlahPIbQdNnBYKjiKtECqVZb2Oepv GseKd7M+20ZZNBMFvHzpsK/9C0V3x2qj0uBMegkV+ewl6S/ME7meYDZ2S4wDHg74+IaE B83ibv+O/bepL1anN7MAe2S5xmH6ZmQlgU8n4DiIJDBtWoynPUM7tURaGVMJPRKO8BR6 Gn0Q== 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=X+YoaYP9Btr77N0brD8AfqI/lJY3W3ao1Z4fzgsncX4=; fh=dD4hpA3+YqlszWEwFTO+ADczjyhU7P27niWnWgZXhCU=; b=IAzmPQqsc/aFQjISZ8HKqzYGUgSH3mUonC+4bSIMF7CItW5VAVXvvtODOS6vMHAKgO Ls4Czue60D6MbzR0/c54TL5CWOjgD5sUcuHgPPQXwmO4DMJGWmkVHxE2Hna6B8Y51/RJ W7ckPR6UbUm29lozDi20PSVRoYwyzZXewJaiJFCbBqDzEyFF4RP09YpBtQE0yaIZRqDW rO8BiO4G+FfqrcYvHIg+ctKY+GrdXRQNjixOPtC28ibVs+LGslFR7X2NhPFg7bBe1Vmf iENuDGlaA2fKz0ZtG/6v5+87QWRBert0qmOdpHaXDdBK/NXEWFnIxxR7EobOTZMf8jiA 6/LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eMPANpfZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id bk13-20020a056a02028d00b005a9fde46fa1si2394647pgb.343.2023.10.18.10.08.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 10:08:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eMPANpfZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id AC7A9809C432; Wed, 18 Oct 2023 10:07:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231733AbjJRRGg (ORCPT + 99 others); Wed, 18 Oct 2023 13:06:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230296AbjJRRG0 (ORCPT ); Wed, 18 Oct 2023 13:06:26 -0400 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A57D3119; Wed, 18 Oct 2023 10:06:17 -0700 (PDT) Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-7a2a9e5451bso272253239f.1; Wed, 18 Oct 2023 10:06:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697648776; x=1698253576; 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=X+YoaYP9Btr77N0brD8AfqI/lJY3W3ao1Z4fzgsncX4=; b=eMPANpfZhwr/tdIu0+uz+RMMH226MP395+djiRY5DxxoOfkJ2GBTwLY6GGS8tMII2s slDRg7biJhDdjUfBtNdfAPTMQlJkx0Tkq93mP98VgJn4I5jLvXBMnhB5NV6Ah+TRbPyQ iItN87Tc5hmogOfWBsrUU2HISZPC3fzJbbYhYBBsjxpLhFGsclxE3WGMwu1yE52FqnOE a/3DbZr7qKlPgyj/00wnyT1bb4Fl5a2POIDcaHdNvfZHnUkn50uAILhw3Baay1r9+thn ISOEgN3eXMtjVk6pb32zWmXL8cRhEt3RyQ+g2xMXfqW5u9sAmvam+SH84YDuMjzo2z4H QX9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697648776; x=1698253576; 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=X+YoaYP9Btr77N0brD8AfqI/lJY3W3ao1Z4fzgsncX4=; b=u2qCmViYtyeL1V/JYIEgQl8qNeJ8hA01FVbbeH1jgJuFZb3bcxkeleHZjuG6Xirj9P 6eAmADECqruRI1z+YgWQMlRYzeHBeO39kIu53vvsumjDI/gkt3tmahQzYJc54vJtP7UA 5iLzNRhIWDWN8XoW2/tvMhZg6L1CR2IehlQ5gRDloT/Xwn9CeaQmz7AE7mK2O0Jn1zKF QwdSzmG3V0jAvMTlyhKnGujJWqX5ctotuNLo0Yl3PuwEH0trk+4y9hsYl+RHTeXjKYJF R+vJtceU6BEkp4Pu5FV/hHYRj91Gb1iAVjrIVwWS9Eb321UzxEwvZcyAVcpAplc5SVG5 C95w== X-Gm-Message-State: AOJu0Ywu2LNb9n/21/6c6xbNwELhpq5ZiDn1/UMN+p7cXe3kAfXzVj6G fOlQiOepUDvhVwDGU5lNwmvx5ebQp4kKVQ== X-Received: by 2002:a05:6602:1584:b0:79f:a25b:51c with SMTP id e4-20020a056602158400b0079fa25b051cmr7039686iow.11.1697648776525; Wed, 18 Oct 2023 10:06:16 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 10:06:16 -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 06/24] dyndbg: split param_set_dyndbg_classes to module/wrapper fns Date: Wed, 18 Oct 2023 11:05:46 -0600 Message-ID: <20231018170604.569042-7-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=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Wed, 18 Oct 2023 10:07:29 -0700 (PDT) rename param_set_dyndbg_classes: add _module_ name & arg, old name is wrapper to new. New arg allows caller to specify that only one module is affected by a prdbgs update. Outer fn preserves kernel_param interface, passing NULL to inner fn. This selectivity will be used later to narrow the scope of changes made. no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index ba41fdeaaf98..b67c9b137447 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -708,18 +708,9 @@ static int param_set_dyndbg_classnames(const char *instr, const struct kernel_pa return 0; } -/** - * param_set_dyndbg_classes - class FOO >control - * @instr: string echo>d to sysfs, input depends on map_type - * @kp: kp->arg has state: bits/lvl, map, map_type - * - * Enable/disable prdbgs by their class, as given in the arguments to - * DECLARE_DYNDBG_CLASSMAP. For LEVEL map-types, enforce relative - * levels by bitpos. - * - * Returns: 0 or <0 if error. - */ -int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp) +static int param_set_dyndbg_module_classes(const char *instr, + const struct kernel_param *kp, + const char *modnm) { const struct ddebug_class_param *dcp = kp->arg; const struct ddebug_class_map *map = dcp->map; @@ -756,8 +747,8 @@ int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp) KP_NAME(kp), inrep, CLASSMAP_BITMASK(map->length)); inrep &= CLASSMAP_BITMASK(map->length); } - v2pr_info("bits:%lx > %s\n", inrep, KP_NAME(kp)); - totct += ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, NULL); + v2pr_info("bits:0x%lx > %s.%s\n", inrep, modnm ?: "*", KP_NAME(kp)); + totct += ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, modnm); *dcp->bits = inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -770,7 +761,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, NULL); + totct += ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, modnm); *dcp->lvl = inrep; break; default: @@ -779,6 +770,22 @@ int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp) vpr_info("%s: total matches: %d\n", KP_NAME(kp), totct); return 0; } + +/** + * param_set_dyndbg_classes - class FOO >control + * @instr: string echo>d to sysfs, input depends on map_type + * @kp: kp->arg has state: bits/lvl, map, map_type + * + * Enable/disable prdbgs by their class, as given in the arguments to + * DECLARE_DYNDBG_CLASSMAP. For LEVEL map-types, enforce relative + * levels by bitpos. + * + * Returns: 0 or <0 if error. + */ +int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp) +{ + return param_set_dyndbg_module_classes(instr, kp, NULL); +} EXPORT_SYMBOL(param_set_dyndbg_classes); /** -- 2.41.0