Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1256816rdg; Fri, 13 Oct 2023 15:49:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEMEecLtua3Nuhe8iVyKOPQCJ2rRz/1Llzd3e/zn1ZQsW6QK6fg1Sk8Kcf+FVpl0meP8PYp X-Received: by 2002:a17:902:e0c2:b0:1ca:2c3b:7744 with SMTP id e2-20020a170902e0c200b001ca2c3b7744mr165011pla.17.1697237344011; Fri, 13 Oct 2023 15:49:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697237343; cv=none; d=google.com; s=arc-20160816; b=e2MnfWEwUnvnIuoU5vxjxL1EIQLGpl9U4Y81K7FRnUtcbMfvgops9w/Qi/aHyTjoMf iPR4rB+dxcYh1DybCr98cod3W/e5/QB0P2yOV+UR159MbKnQkLXLvzr97sFam2R1ZoRh roj99lLcloNtQw7IvH9LRgb95mmZdo8WJlE/6lWvwl/qg+kvW3u/pYik9kFJo7Zpy9NR VXBdcIIT8NGDXOE+eglbstuzYYcTXzFKPIa6oJjpt7khXuGqcSoEkb3TOCsFUcqxkacD Ko+5Br7OizQiAmoo0JvH/s0KtwEXnQOlk2G1ZvfTIV28lG+21rq/OA63tWROJFkJqz28 J0Bg== 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=z8A2UgI9Ozi/zM+meU3S7fSTeKB52ixSkA1q1cGr6xs=; b=LoGD88VsFHDT1Ccc2qYSoEm7Ryz1Z6z+Ly5ujZ/wemL9nK8PCG5Yk1Tgws6idFKwVa Vb0kYjbyANlQY3XD0x+l85J1BFpveWK8vSuneXPqLf4Ut62Wv0PDkRHHgV9Mnu36MT+h 6fNVKw4asH3s6Fd5s0ZRGH3x5QOT+m7t+3W7K0RSDPwyNZRgPZtoSCM26nwHjh4rABHu nrO8PR1+oDX7PDkRV0dNrgTTJ57y0vSDu4fLpjpVACbkVrqX66qyBXJ7pq1j3rk8O0as 18FDxbcdJhVgkabdeoHCICKJ2hl8hixvyATnZy7AlNybLLDupvRdIQVdw/lG5S1gOzed aHsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iDt1LYJt; 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 g8-20020a1709026b4800b001c60c552a66si5190247plt.302.2023.10.13.15.49.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 15:49:03 -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=iDt1LYJt; 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 E3A748311BC3; Fri, 13 Oct 2023 15:49:02 -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 S232559AbjJMWsz (ORCPT + 99 others); Fri, 13 Oct 2023 18:48:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231500AbjJMWsj (ORCPT ); Fri, 13 Oct 2023 18:48:39 -0400 Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA63DC9; Fri, 13 Oct 2023 15:48:37 -0700 (PDT) Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-35749fd39b6so10016005ab.1; Fri, 13 Oct 2023 15:48:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697237317; x=1697842117; 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=iDt1LYJt9ZxDz/gtXZgpouTgwn7l9RAeulZ1F2A8eyxLPmx4GecX8+itixJuOHAssA F6Y6K9xIwaXXEkQwKG2LLp6S/I33oQBrqLAID2WbkgOFxfSE6e0XQLptHn3llFPtlQuT BTcRPsQDN24TGbnArzUn534quo5sVv+SGWWlc9zzbRabCDCTvE9JyvCskrLm6QZHljkQ 5siSONPcNU8KRE6XuQZrme0Y86HfbhHjvH97ToWPbsl9694p7ChpdiSGLDxa58gPIzJt w5zlTOQX0NUX+r5hAnviM367/f+/dfoMyEb6qEufzAzH9nUuAsejng/Dm7U31kbVtkmp eX8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697237317; x=1697842117; 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=iRysrjV+OmyG8TSYliNs3DH50fgSx3JYoeKs2jQhooqJAhetvSkSGLDu1YqccG+eld ibyXGeOiV6XArtWV8X6PWxf04tfFUjYl7DFpqdKlVflG9EBtBpkyTJgx9nhHvBdL5Mck hwwjzD5vf1OkorSUGRPgS4wO8MeW62Jc4TnhNNpsPO28D/8x8/BSirYFzny7141SJX7z k9NrpmoYC0dGUPONnP2UEEurM6ziX6tiepOdfDdAdSffiwU156nsnkTjZRSE5K9VLQeC 34z+1Z2R85v3pGkkTZOfm1B4727is65t7Jkg2Yk/vtXiD6TjIPBBBS397dRxmdyZJdl8 FNJw== X-Gm-Message-State: AOJu0YxvAqB7VO3VGy1XjUEUYwipPRb+C4hHW3y08aadZJB8hkT+TjCu hZShCk4h1ezXcVc47rdrwAI9/2IWVkM0xA== X-Received: by 2002:a92:d482:0:b0:357:5751:7aa9 with SMTP id p2-20020a92d482000000b0035757517aa9mr6317829ilg.2.1697237316825; Fri, 13 Oct 2023 15:48:36 -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 t10-20020a92dc0a000000b003512c3e8809sm1683071iln.71.2023.10.13.15.48.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 15:48:36 -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, linux-doc@vger.kernel.org, Jim Cromie Subject: [PATCH v7b 06/25] dyndbg: split param_set_dyndbg_classes to module/wrapper fns Date: Fri, 13 Oct 2023 16:47:58 -0600 Message-ID: <20231013224818.3456409-7-jim.cromie@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231013224818.3456409-1-jim.cromie@gmail.com> References: <20231013224818.3456409-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]); Fri, 13 Oct 2023 15:49:03 -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