From nobody Mon Dec 15 17:57:55 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53C52FA373E for ; Mon, 24 Oct 2022 12:10:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232482AbiJXMKH (ORCPT ); Mon, 24 Oct 2022 08:10:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232771AbiJXMH5 (ORCPT ); Mon, 24 Oct 2022 08:07:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81BC97E321; Mon, 24 Oct 2022 04:51:41 -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 ams.source.kernel.org (Postfix) with ESMTPS id CB166B81199; Mon, 24 Oct 2022 11:51:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E652C433C1; Mon, 24 Oct 2022 11:51:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612260; bh=R2o+Cu2UAOttf3+FN46CvIfUeo5oZyZa9B5Y8e4wXF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DTDZXVRN7Ia0idxc5hTBbOaGJde+B+B5WYo1CUiMDt2GMSe/vX/VJFBhlSSXcC8kv BPXxDaQlIUZGZCXPFrEU/g3+9INjJGMfhtM9vK2QhZ0xsavjGLkrmfEKtI9ooK/PF3 H3VnrkniBeBzH205vUYJogtp867OU0wa4SYPLjY0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jason Baron , Daniel Vetter , Jim Cromie , Sasha Levin Subject: [PATCH 4.14 129/210] dyndbg: let query-modname override actual module name Date: Mon, 24 Oct 2022 13:30:46 +0200 Message-Id: <20221024113001.172915017@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jim Cromie [ Upstream commit e75ef56f74965f426dd819a41336b640ffdd8fbc ] dyndbg's control-parser: ddebug_parse_query(), requires that search terms: module, func, file, lineno, are used only once in a query; a thing cannot be named both foo and bar. The cited commit added an overriding module modname, taken from the module loader, which is authoritative. So it set query.module 1st, which disallowed its use in the query-string. But now, its useful to allow a module-load to enable classes across a whole (or part of) a subsystem at once. # enable (dynamic-debug in) drm only modprobe drm dyndbg=3D"class DRM_UT_CORE +p" # get drm_helper too modprobe drm dyndbg=3D"class DRM_UT_CORE module drm* +p" # get everything that knows DRM_UT_CORE modprobe drm dyndbg=3D"class DRM_UT_CORE module * +p" # also for boot-args: drm.dyndbg=3D"class DRM_UT_CORE module * +p" So convert the override into a default, by filling it only when/after the query-string omitted the module. NB: the query class FOO handling is forthcoming. Fixes: 8e59b5cfb9a6 dynamic_debug: add modname arg to exec_query callchain Acked-by: Jason Baron Acked-by: Daniel Vetter Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20220904214134.408619-8-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- lib/dynamic_debug.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 91c451e0f474..01591a7b151f 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -327,10 +327,6 @@ static int ddebug_parse_query(char *words[], int nword= s, } memset(query, 0, sizeof(*query)); =20 - if (modname) - /* support $modname.dyndbg=3D */ - query->module =3D modname; - for (i =3D 0; i < nwords; i +=3D 2) { if (!strcmp(words[i], "func")) { rc =3D check_set(&query->function, words[i+1], "func"); @@ -379,6 +375,13 @@ static int ddebug_parse_query(char *words[], int nword= s, if (rc) return rc; } + if (!query->module && modname) + /* + * support $modname.dyndbg=3D, when + * not given in the query itself + */ + query->module =3D modname; + vpr_info_dq(query, "parsed"); return 0; } --=20 2.35.1