Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3929084rwi; Sat, 22 Oct 2022 02:23:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7gmmjeKf2RlgJ4jJAB7UV8KICRcVFC2//bLgpCrMlOFtODcTbh0Fojb8yiPgUiN+Xq6Unp X-Received: by 2002:a05:6a00:14d4:b0:563:9296:f320 with SMTP id w20-20020a056a0014d400b005639296f320mr23057301pfu.27.1666430604652; Sat, 22 Oct 2022 02:23:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666430604; cv=none; d=google.com; s=arc-20160816; b=gc3oM6EAlTGuOyzXsG58/1DZRUT0/TvfbS/2E6omeVUEBX9y7cxEVKcyc+AYv0mrww FBSTQ7ZWJZoVWEjxkcDbViVPT+VrKrtjt853l1IB0bqBmn0sUYq9avKkke0rSidGXCuE MmPOA7CWt+ntj7NtGSPt+8cmfQdNh3c2K+uen6Sp+llD4uG2fQpQStU89qNrYKrUVfDu MEJmQs7zJzbxA/5idxq5K+Ecs85TjSFyBJWqdIdUXxgV3KGjrsIA5kd5WH8ZHNemuNUC J29ybPHBdQhAncc7TYs7qli8GoCAX1ejdzqrzJetOFoimyjGdN16khgHDEomLoXoIVF/ yjtg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DoNt0pXLagS07yM6N8Kcij3wYWGEjnGqJUWKkOcKf7A=; b=07HRlG5CTQ4tzF/YD+qANznVGXMk84Ez+zWG80cwSm7U0W9As3C6Mr0FK0ofjr+c5E K1DsgJPq7HzaGwRBEkrJGkFvS1P0ak3gp6rFsqb9tBEj7FUTkVjK4LYJa5+hzBEaXplF z0p/6tBtGEVZ3AnNFd0wEOJczcIXxdDSqAGoAP0ySV2gX5xTXwD0KlrdvXPwigK9/Kyg PMa5oFxYcCsfVR5VkmthEkEWAT8nveqx6PIHM/EdAcRDpJYPpEtR9N6P0NiaqjjvAJAT Vlt3z1QuZLqodIoxo/GreKZexnjidBvv6YXPYnM1xMuEOjDOT7+4W0xW2HIPA3cbarcr ZFqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xGnNSd8+; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h10-20020a170902748a00b001865c55049dsi9728251pll.570.2022.10.22.02.23.13; Sat, 22 Oct 2022 02:23:24 -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=@linuxfoundation.org header.s=korg header.b=xGnNSd8+; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234733AbiJVIme (ORCPT + 99 others); Sat, 22 Oct 2022 04:42:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234608AbiJVIjT (ORCPT ); Sat, 22 Oct 2022 04:39:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DC141ACA8C; Sat, 22 Oct 2022 01:05:25 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 5F86A60B7B; Sat, 22 Oct 2022 07:53:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68D35C433D6; Sat, 22 Oct 2022 07:53:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425185; bh=sZH1AfOZE2dYsZSEtdB7yfve1BZph91UMlLwjQ5Fm+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xGnNSd8+Oroq4P8RUBkpgjvsgAZpiQ+gRGWTpVp7HrXUwUXn4kFx7ZBa3XipBKjnv 1Roh3IxHME7xP9fCGk7+/X5aUIqO+8aVoi7enWzpCXebWnFrF7+lAVsynup9mDnQ7E BaW9/yYvhkV18kXS/7HAO96oTyRhfy0U1+v3GVJc= 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 5.19 419/717] dyndbg: let query-modname override actual module name Date: Sat, 22 Oct 2022 09:24:58 +0200 Message-Id: <20221022072516.841235504@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 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="class DRM_UT_CORE +p" # get drm_helper too modprobe drm dyndbg="class DRM_UT_CORE module drm* +p" # get everything that knows DRM_UT_CORE modprobe drm dyndbg="class DRM_UT_CORE module * +p" # also for boot-args: drm.dyndbg="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 a56c1286ffa4..4d168efcf779 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -384,10 +384,6 @@ static int ddebug_parse_query(char *words[], int nwords, return -EINVAL; } - if (modname) - /* support $modname.dyndbg= */ - query->module = modname; - for (i = 0; i < nwords; i += 2) { char *keyword = words[i]; char *arg = words[i+1]; @@ -428,6 +424,13 @@ static int ddebug_parse_query(char *words[], int nwords, if (rc) return rc; } + if (!query->module && modname) + /* + * support $modname.dyndbg=, when + * not given in the query itself + */ + query->module = modname; + vpr_info_dq(query, "parsed"); return 0; } -- 2.35.1