From patchwork Mon Oct 24 11:30:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10240 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp643301wru; Mon, 24 Oct 2022 13:41:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6VB7qTf0lMDIbTYO54VDEolzG8ZiZQ6Sy3ynCHov4NN9+9t7SGv1CHTmRImL7TfnusF5JC X-Received: by 2002:a63:eb4a:0:b0:46f:63f:a892 with SMTP id b10-20020a63eb4a000000b0046f063fa892mr6410280pgk.33.1666644071166; Mon, 24 Oct 2022 13:41:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666644071; cv=none; d=google.com; s=arc-20160816; b=htlg7nbmOQF8uIyt3TGVzjP3Kt82KfXko9+tCIu5KXcMK1lNPTPOEPhHXDozPyooWX AZ53GqJbeNxjmEW1+m6YAI0hROfYFajRqwup6xjWQ4kLZdw8a6DD/9KYMd8P2VePbUHr R66Cv+ceMvb1Kq8flAgAZQGW0/q9kj+A9cPLWke2oWpiQmsYkdZVCxNYtC6zFXqE8OX5 7B1Qikz/gWPxhx5Z7cS6pVNZ2LvBeugdJ2NA587SyrYTiFuf6+AWYXxfd4Ma/A1ickSZ L1Q/WCx8TH76PITikiLrY+5mXtd0hhd+h5qOMWfMalWPB5V6qcoyVBUDpuLOXDY3G//h 99Tg== 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=m5WkUi8wJv7Zssyb8sfWGwdx9DIysrGI1+TJEalaMCQ=; b=h9o/3Ke5qVXet40x1ouojT9ICOLp+U7Vg0c6TMRV1AO73rDB/wiCKs1agArNR8T38b ANkZ9nB2l/A8o00Jod64ZdRBNajk2/xPXMFd6rDFgAjOQyarFc/GWEvsFevC/Ze7A+Vw Xs0qBoXnK7dCSeY11mnuXtGS8Qo0bv9xOe+fP33/iBer1rXHQDxDdMruubLFd71JBx/V +b3h/v1zfgmxPU4ES7qnsoZIep3w6JYBEBnsJKO7FRMJ5TQlhni/tkc08N5V96fqMcnP mm+sQi+kn2RPNJfzUIW/CFOcidZpj6RpXZK7Otyk6q7CfIE+/3LMOja/5CayHkL0UOxj WBlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JUYwV+Se; 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 r8-20020a63e508000000b00462f77bcd1esi626007pgh.90.2022.10.24.13.40.58; Mon, 24 Oct 2022 13:41:11 -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=JUYwV+Se; 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 S234728AbiJXUk1 (ORCPT + 99 others); Mon, 24 Oct 2022 16:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234783AbiJXUjL (ORCPT ); Mon, 24 Oct 2022 16:39:11 -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 211352CDCF; Mon, 24 Oct 2022 11:50:05 -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 C1AE8B818C9; Mon, 24 Oct 2022 12:47:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FB3EC433D6; Mon, 24 Oct 2022 12:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615644; bh=g6JX/FbexTg6S5fdJfWEIODX30EZwBje8Fl6FaF8REw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JUYwV+SeTyyZp35HQ/9tiOLVAtGv9PmX1zdU4nu+Cx29RrAZPnQy1NOGEiSevxkV1 UkAsegJnboAAllqotXsAmRal45zwkdNRxEpifL0tNaObTvMT0ybyh7mB2G4DlJ0sSz InXRuB85KgSmVkpF8/TiIGehnXn4P4n+oVaGNgCs= 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.15 299/530] dyndbg: let query-modname override actual module name Date: Mon, 24 Oct 2022 13:30:43 +0200 Message-Id: <20221024113058.599805134@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@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?1747602973461908675?= X-GMAIL-MSGID: =?utf-8?q?1747602973461908675?= 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 00e6507972d8..60d453974155 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; }