From patchwork Mon Oct 24 11:30:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8461 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp402821wru; Mon, 24 Oct 2022 04:50:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6zMZAKIlJPm3bh84+xBXnkVExmZWAXJV6c8/a9jCpF/C/PNeWar6nltjW6SHq9lLndbRTm X-Received: by 2002:a63:234c:0:b0:46f:1b7:438b with SMTP id u12-20020a63234c000000b0046f01b7438bmr4745065pgm.516.1666612244768; Mon, 24 Oct 2022 04:50:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666612244; cv=none; d=google.com; s=arc-20160816; b=jJn9o7k2+dfSVDpep2lqcJaWjQCtMZ7+1i0mQ+xfdJ2pBpQRF0XBhNmmopFS4pIwP6 tOdO/13JV9TzAaylrTp/aC6y/tmZxa6tLY67jRJYFFeAqQMY3M6f53s8NByJtegPYOtV skD1+TrYGsuylFuecpPen6QPTWRXZU9EMrAjsEQkP963W5zhufg+Auar30HXoYVI/3Tn yAgkK18X2SbOE9RvnEOfGrkmgtJ8Q1dj9G8YJCuQgLUgsRI+Z2cX+njRKJ+E+yxpLYU+ zj+Pu8QVDas4XZwNw/IEfPzKdx17M4JKkaqKpHPsh/4H+qr4kYRCAOExqyfBJc3JP6xn jTxw== 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=AhxWyfrE54TY4jmdPKQVatS23utZeDCqIjqDLjrHWFY=; b=Iuwk/FWJrk87O7PLVmCRV8tD/Lc4P/9hfFMSu4TIZPr5gw/Yrj+Q3a/NNrc1fzsIza wZvN27v+WQmIvD53Kqb4xcIKrdCUrM2PEb8ppBQSPX3eFBmndc9wao7dswfLwmSt7U+B HuBJvrzhPmdZyFnH+fASjhlfmEKqTwHaLQaroVNbtmESGLQs0EmGRa1VpbmyBRJx+6co YNZXvCJRa9Z+EptgAM7rkE8KFjkuf0yX8r1zLSVqmcD8nqj6Mbu8QiaRudrPQDZ0MAVg K+OMHx+Rbo0ELXdyxW87vol994u/nGiRfIXlL/SswLiYy/NNRmZ5a+rb5rZLSKMQ0Ab1 QhSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JNG7aefQ; 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 l6-20020a656806000000b0045f9f5763c4si35048239pgt.437.2022.10.24.04.50.32; Mon, 24 Oct 2022 04:50:44 -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=JNG7aefQ; 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 S231825AbiJXLuD (ORCPT + 99 others); Mon, 24 Oct 2022 07:50:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231733AbiJXLsB (ORCPT ); Mon, 24 Oct 2022 07:48:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AC033A161; Mon, 24 Oct 2022 04:43:22 -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 A9383612A0; Mon, 24 Oct 2022 11:42:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B744DC433D6; Mon, 24 Oct 2022 11:42:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611768; bh=R2o+Cu2UAOttf3+FN46CvIfUeo5oZyZa9B5Y8e4wXF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JNG7aefQfLXn9od6GWQWvgJY2AKw3MBmlmjHpBPr/T1ByszvXnAs5vWgBEkSE9eZw yhvQvSBtFR6KVUAdkgeJ25uHJZ7oNs8qGQ6cVs6HbTE1dtFgYRDM8EWLJ2JnC3bsE7 2xpndMXyNZWAZe/vZ2S0U4MIALHURf6+qEpxBnfw= 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.9 103/159] dyndbg: let query-modname override actual module name Date: Mon, 24 Oct 2022 13:30:57 +0200 Message-Id: <20221024112953.207373954@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112949.358278806@linuxfoundation.org> References: <20221024112949.358278806@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?1747569601054729669?= X-GMAIL-MSGID: =?utf-8?q?1747569601054729669?= 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 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 nwords, } memset(query, 0, sizeof(*query)); - if (modname) - /* support $modname.dyndbg= */ - query->module = modname; - for (i = 0; i < nwords; i += 2) { if (!strcmp(words[i], "func")) { rc = check_set(&query->function, words[i+1], "func"); @@ -379,6 +375,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; }