From patchwork Fri Nov 11 22:17:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 19028 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp993746wru; Fri, 11 Nov 2022 14:20:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf4+Knp98+XD8kQpbCpjEjMoTdWlAefhdWshqe1uVraj47WLIIzjINUppYm1oSgwBdOUpF7p X-Received: by 2002:a17:90b:280b:b0:213:7d3d:a769 with SMTP id qb11-20020a17090b280b00b002137d3da769mr3976173pjb.22.1668205208185; Fri, 11 Nov 2022 14:20:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668205208; cv=none; d=google.com; s=arc-20160816; b=NU8mhB5pHxxzgrO8zv3PW+m2fjQK4d723qcC6lAwLXdZTTZVGQk+Id5x4vEm3VoFSy 62WX0DrChgoGIO6DxJU1CiSCNXc+YVc+p4N/qROYoWg0Nv9LnGscu8IMnAWigUYvS1T8 Hi0iNmkZNj66DXuE9qivwrwU9YWyEkQxk0XVtyas99TrtmFQhxeGIK7G2SNQyHgFprXx VcZWGxgHPiMhXHkSAI9VEQvEunVAVIDZUg0IWZz1PgFQtmsBNtpleczZQxpfpu/wmgkC PZ/KHDkavvUDDkM91og464QiM1Nj+QC0kbqxpntZfXskJX1SI14bQr+4XXDOi4niytRN 6N7A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fUjShxaIiHk85i1hB/Op8E8p5ddWSfs+Wma1PGPikFA=; b=d0USa9E69TbofnTLwubw4X+lhjxhX43RxUd79LJzojokXAdraCu6G4RBCyx4K6iApN MDhwL1ticuzy9cXdqKLpZKP2cdo0v9jUfGpQiCWKGAaJAcaplE3H3El86VXStnqQprVo g9JWA7+cFRlY5pSDQZKm41ZayJyhh4g1nxUNmG9hbDP4bE3oP6d8F6NBa92z5q9Y/tEZ w+fPpGsvDX0euSR/nYc0Swvh6H40dyQ/aYpusBkEqrhTZJH3Kg5ZLFXePLTKkw3H9aAt M6uG9PxM5YjbWpk6RZzVnTPfiDCnwgBOShy1GuzUd3f6wvGn/djOHjyHWHyzxAsF+ktD HA0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ePqtQ+3P; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w15-20020a62820f000000b00563798cf40dsi3152242pfd.224.2022.11.11.14.19.53; Fri, 11 Nov 2022 14:20:08 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=ePqtQ+3P; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234585AbiKKWRn (ORCPT + 99 others); Fri, 11 Nov 2022 17:17:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234494AbiKKWRa (ORCPT ); Fri, 11 Nov 2022 17:17:30 -0500 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C325B4D5CE for ; Fri, 11 Nov 2022 14:17:29 -0800 (PST) Received: by mail-il1-x130.google.com with SMTP id g7so1519878ile.0 for ; Fri, 11 Nov 2022 14:17:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fUjShxaIiHk85i1hB/Op8E8p5ddWSfs+Wma1PGPikFA=; b=ePqtQ+3P8xuuUT2qMIKVj3C58MIuBmAs/JSpDeoIZH5GlTWvZLlDgO5Zn8lN0zcT6z z1oLNPXvLCXeUkQg4MmGUdSiIhyVldO9sDmm+CvSz07Ay/JgI1NLlzr8cVJGqDXEhSkX HGs2sAOB78+EAFx8uY/q45a7BEcVdMq0sgzQRo+3tVUSv0Tz/zkAzz4OeGvB50pmZWx0 w/oQ+GbO6izGOnFR8/OV5iSolfskdwZcsG5ULxDO4AFQSOGhIf3hhpsobEkpE5oBpV9o AmDn1ligKQCSTbyZ2YTuL+LMjHwtiqLTs5hKjXCaylKQ3c7VTdRlFEWRM4FKgzBaKAmj aQ9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fUjShxaIiHk85i1hB/Op8E8p5ddWSfs+Wma1PGPikFA=; b=daB5znOBNKwQQ+tp9z8q4AW1nPXxkHAWtQzx5hV2wvbuS+Lo0R0XggUSIRaSuBOfWi t1DqkCMbnOXJuCq0YMQYTxbHOj2mpE85oBXhTlFAx20pxgeJ8nwhlVeNi/lFFPegsIQw BsPIqx13apIRO0a7NQE0H8AL/h895fStoiq9+FuoK9rTMwzzoWf7Nc+oD7cQ0WlzhDIU 4BGJARjs1VRJ2OcqEFAkCK55SY/ohbgoVv4+nNoTT4IRgFQKVnJDu6gn6B6/vUd8BUjd Vd6kplbSpxtwUMyXG1YlELvXvuG/6lxB3qAIVbXk4MB+/pwZKi9zuX19QgcgQbY+Q7xd 5DHQ== X-Gm-Message-State: ANoB5pn4TdMF05Pp6DSDuwdRAjfYmeuVAKL68KUYchIqwb7RoTW7tX3E ePbm0sPImB969q3/VGnPXiE= X-Received: by 2002:a92:d12:0:b0:300:c3d4:e9f5 with SMTP id 18-20020a920d12000000b00300c3d4e9f5mr1868728iln.317.1668205049139; Fri, 11 Nov 2022 14:17:29 -0800 (PST) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id c5-20020a928e05000000b002f611806ae9sm1113457ild.60.2022.11.11.14.17.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 14:17:28 -0800 (PST) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: daniel.vetter@ffwll.ch, seanpaul@chromium.org, robdclark@gmail.com, linux@rasmusvillemoes.dk, joe@perches.com, Jim Cromie Subject: [PATCH 4/7] test-dyndbg: show that DEBUG enables prdbgs at compiletime Date: Fri, 11 Nov 2022 15:17:12 -0700 Message-Id: <20221111221715.563020-5-jim.cromie@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111221715.563020-1-jim.cromie@gmail.com> References: <20220912052852.1123868-1-jim.cromie@gmail.com> <20221111221715.563020-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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?1749239944280918345?= X-GMAIL-MSGID: =?utf-8?q?1749239944280918345?= Dyndbg is required to enable prdbgs at compile-time if DEBUG is defined. Show this works; add the defn to test_dynamic_debug.c, and manually inspect/verify its effect at module load: [ 15.292810] dyndbg: module:test_dynamic_debug attached 4 classes [ 15.293189] dyndbg: 32 debug prints in module test_dynamic_debug [ 15.293715] test_dd: init start [ 15.293716] test_dd: doing categories [ 15.293716] test_dd: LOW msg ... [ 15.293733] test_dd: L6 msg [ 15.293733] test_dd: L7 msg [ 15.293733] test_dd: init done NOTES: As is observable above, define DEBUG enables all prdbgs, including those in mod_init-fn, and more notably, the "class"d ones (callsites with non-default class_ids). This differs from the >control interface, which in order to properly protect a client's class'd prdbgs, requires a "class FOO" in queries to change them. Note that the DEBUG is in the module source file. This yields an occaisional surprise; the following disables all the compile-time enabled plain prdbgs, but leaves the class'd ones enabled. :#> modprobe test_dynamic_debug dyndbg==_ Signed-off-by: Jim Cromie --- lib/test_dynamic_debug.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index a01f0193a419..9d48689dc0ab 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -8,6 +8,8 @@ #define pr_fmt(fmt) "test_dd: " fmt +#define DEBUG + #include /* run tests by reading or writing sysfs node: do_prints */