From patchwork Mon Oct 24 11:30:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9138 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp457485wru; Mon, 24 Oct 2022 06:36:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4V+5KDDTGZgz7Q65FR0epJ1p1Nq576iko/hJ+JJjS0y21c1NSbUXQOYF9LCF9wwog9HN6c X-Received: by 2002:a05:6402:1a48:b0:461:900a:7f0d with SMTP id bf8-20020a0564021a4800b00461900a7f0dmr9269351edb.125.1666618566326; Mon, 24 Oct 2022 06:36:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618566; cv=none; d=google.com; s=arc-20160816; b=VL332ZGPA44Lm3sf0refJdQSUXrM/dCY03q7q2tKktU+oyrBLhgXN4JelHd63XV4at 5yru3Okv/WOAR9MohImgrk5xfkLZyLSqe200YFfEiuC/L2L9Es4VfM4uhhckMQlp7PPe RfUs+geqBRp6ISfHSZKXixAakSHzdMXAgBBvCAWlvkg8l52Icc6vWeEAZkCMYU430Jm1 1DpmeJz3akwGQnBm/c7Pz1j9mmOhpO/UUfS8p0Ykir24s9tq89kdoLBOHNqOe8/jgw9w EyurUdLlreb/O3iYVUy+uz/VxjHOYKJkkjOnyvjfK/QlECAgd4j0qgjiy/x6Hw9Irzm9 mnYQ== 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=KyMnF07SAQvb08ZMW9IOT2S5TwkX1MmtFVteVr0xOD8=; b=nWvRANdpikp6JOnpFsm/E3CFAvZMLvybSgSo56BR0Z6KPQ0jhNoC1jf9ZSiB1JChId s45eXynG/iGJb/U6dbVYxPXfjKf0kjzcqEedJ9Iid49mXX6R04MZEnX8D+Pr4EpsN91B Addn/vjj2p/cPpUMYehp/2a18wXu/MwQf8qU5f1IDVLDHIrcjn0kl9EwgASEauj1sSUY A8Sx7asBi8R7XVYILi1W7/83gAMw5MeALkoWXJBUaC2HT48xFHgrASnBfOZWB4gAH2Ya 9yRpfJBVPbu4aqxYOU7o3szXU9MwHrJjgEaS7Hynu22CJbyAMz4GhNF8p5ShINnx9KcP f19g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YmXWKwWI; 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 qw5-20020a1709066a0500b00780a240cfd7si27883466ejc.493.2022.10.24.06.35.27; Mon, 24 Oct 2022 06:36:06 -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=YmXWKwWI; 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 S231283AbiJXNSM (ORCPT + 99 others); Mon, 24 Oct 2022 09:18:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235880AbiJXNR3 (ORCPT ); Mon, 24 Oct 2022 09:17:29 -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 7E5CDA4B99; Mon, 24 Oct 2022 05:26:32 -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 8C2AA612A3; Mon, 24 Oct 2022 12:26:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99C18C433D7; Mon, 24 Oct 2022 12:26:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614374; bh=NY2FTV8MYPyVidj22LBkEtsyCtWrOC2P1Y4dk3MvanQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YmXWKwWIxqK0NzQbemsuaCmYPFmtG5gQMBMPwdLmRqTj6aE5ujnkaYYTY2gcdMs/f 3HZxphW0VO5NBVdwRdRRUx9t59oSNN/pvq+pJtl1t6+eZysYmfmVrNRiFDjIGQDpOr YQJwTcNIFfNIFpn4W/ZtM3vsQsF9kiVZ7hWt3ZD0= 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.10 219/390] dyndbg: let query-modname override actual module name Date: Mon, 24 Oct 2022 13:30:16 +0200 Message-Id: <20221024113032.106109731@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747576230059426223?= X-GMAIL-MSGID: =?utf-8?q?1747576230059426223?= 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 e67655d7b7cb..02a1a6496375 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -380,10 +380,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]; @@ -424,6 +420,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; }