From patchwork Wed Oct 19 08:30:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4895 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp225527wrs; Wed, 19 Oct 2022 02:43:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4U8dHMK3P4Fhv7Yvc1b+oueEz7jn0d7HzxbaKsuImQzsfoexL0NdcTkBCdFpq3j96xHWkw X-Received: by 2002:a05:6402:42cf:b0:457:ae6f:e443 with SMTP id i15-20020a05640242cf00b00457ae6fe443mr6623426edc.299.1666172601247; Wed, 19 Oct 2022 02:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172601; cv=none; d=google.com; s=arc-20160816; b=CWQalE9od/DwMDhq7iHPDfpkUoYxltqoKcSNfCPhDe+iR9isJS7aYLL6Vw3LQyMIAg hv6M6QxnMQ2sPvk9ilfGA8TeW+d0elY9LBMCP/R5iZFqdbc3xZjQjx4p6Y8Ge2+gFeJE ByfT562QIWTyYLsv1x8Wg15IikgNoiN51/T5i9Dm9+9L8ssGb1Zvk+p/sdLzSaF+jkXE Rxgv4ZHeqHCeRLm7A/4NTYK2wbU12m7w77+tDCwiRFPEVO9HjkhQH6Ja/8YHQKHEVGSI LYMzHoprWQIb2mXpLGWXtxgJpvgjzQhLyI0kh2FcN8zr+IVB7LOxUTDbFWqTkrLFK/E4 XjjA== 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=vehExIM9Vt8+xvbOrhG8igTiklQvtxnrMSK4BINQxiGk5QhJEpuTABy2Dj9Ful0law Jc6E5kJQTtTU70XExkzQYxj2rwP2mHDxCMxLBaAnAtnUB5lBOoCMFtHp+x52+BeLNhsm 7/fWcHq8W/G04b3skoebwW7Sp2vm4cLTRxd7JSblZwiBoY4i/XaW3oyaKOCYi2lwXsWa AM/Us7nuKNxCzG5vBZUIHG3uGShSrf1gDOB23bBN0/8liFcIDgQjZXEXoo60zG0FB4Dk OlCVKydrqoBit8o1sZeOcxMSRIzRysUBS8uYtVPWrXo1bQ9ZID/f46Z/qFxAXmet6Ill 10HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sHjNkpa6; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s18-20020a1709067b9200b0078df19995e4si12705827ejo.241.2022.10.19.02.42.55; Wed, 19 Oct 2022 02:43:21 -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=sHjNkpa6; 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 S233950AbiJSJeJ (ORCPT + 99 others); Wed, 19 Oct 2022 05:34:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233783AbiJSJ30 (ORCPT ); Wed, 19 Oct 2022 05:29:26 -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 E2A98EB754; Wed, 19 Oct 2022 02:13:01 -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 5A5BC617D6; Wed, 19 Oct 2022 09:01:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EDECC433D7; Wed, 19 Oct 2022 09:01:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170072; bh=sZH1AfOZE2dYsZSEtdB7yfve1BZph91UMlLwjQ5Fm+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sHjNkpa6e5a0u+HJDm5tRpflfcZ+lpB8yBISLUjPU7pSrz+79ZPn853nxRTiocPO+ nWDknSZJbbyu6sULJAdTxS6Gnhw5NiSic0EsuPySdABJfgZffXU3ioEtMtwpM/4wWC sUf439e3a2017o8oNbXvdHxHPxwXettmXM6Fgsrw= 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 6.0 515/862] dyndbg: let query-modname override actual module name Date: Wed, 19 Oct 2022 10:30:02 +0200 Message-Id: <20221019083312.742710490@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747108601360369876?= X-GMAIL-MSGID: =?utf-8?q?1747108601360369876?= 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; }