From patchwork Tue Jul 2 21:56:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720370 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E32C1C30658 for ; Tue, 2 Jul 2024 21:58:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 583F810E6B8; Tue, 2 Jul 2024 21:58:17 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="js06m16f"; dkim-atps=neutral Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2BE1B10E6A9; Tue, 2 Jul 2024 21:58:16 +0000 (UTC) Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-376243a11a2so17111015ab.2; Tue, 02 Jul 2024 14:58:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957495; x=1720562295; darn=lists.freedesktop.org; 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=5R1ZNEsygnLGTQO2NIWkjU0SF7pc6VSZuM8NRzidmQA=; b=js06m16f8oV/cb8k8B+CM4WFI0IO7+WT0xoA6SXvf9id/risQgnrH5hM371K8SYhJJ ji6tzNjoGTwj8TTo09BeGLwkuqEiXDh2EI81CuiTb9pAIIgK3DENOSor4zMK9EoJhVOS arI8O46nAGMMFGZ5c7yuVPJA8BGGivvJG0MoT0JESOCZK/KRGg6s5QWJdyyImPclmcdV Y4hMGgrjqIehhEz66vPH2ElBCFKcV56Ayd9eVjeOw7guvVjzZcMlXgV1dVvBNzrhK5k6 fZlIXFjVXEjp4J7AJFXC1QtE2Rt6LEWAciH6EdJfUl7mD4qlUhaWUyHWNht2/7z2uLaW xZgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957495; x=1720562295; 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=5R1ZNEsygnLGTQO2NIWkjU0SF7pc6VSZuM8NRzidmQA=; b=eJnE9AGUiurLoyBUM+ssuwU8f+X3lW0HI+V+XmfsqhLBfh5svsFEQ79WCNSBfntl1W 4HvoIIFybyd2lpltVuKBCCOeJIM1oF3fDX10qQ+spioAuIVmBZTK8HLIQUDZqv0nCvbF Pd84T3+Hg3YRSG5KHg9/KTyxS0npwLAC8w9plR/wxIRJbVPAQNlVlEbupJ3Ne7B1+5ZA akPcov9z+/0k7u+yqFSpvGbR0zS6BHKwPANDz8W0dKM2UCs7RKf+pWQLKERIC8M2vkGL veXSWZI44p4+S0/Th+CQ6ika4P79KRauz6mtSHqdNp7Bp1GCrtM4KR+RnuvvKfUG4D9i pJPw== X-Forwarded-Encrypted: i=1; AJvYcCUAYWR1gbt9SoHrI/Tc12EEVmBca0nWYqrdJIj1eF2HDVjA3vyxJ+Q8suXzW6im6XQewHT7Qae9BUBOvkASwkbd+PBP++7PCZKOOOTjoSSKgOZjJ6/6He8t5V+wIhpsXUOCLd4k/BcxKg1h9bf8DhyJk0WMJvDxRd3OvZifaXmNse0pfcaqVBnWsAKsTwd9m1pcopBfPSE9A0ff8gdtobnULFqnRbsLcz2TJ80KDS5Wz5GTMq8= X-Gm-Message-State: AOJu0YysYjE0yycWkQ0NseFErafhJ+bKNT44FcAa0IlvVhcMRhibQV+T EcHwK8ssJs2wsILJkOI08KxFFfijOwMK0Gs/W54e8X0XANEnZHPK X-Google-Smtp-Source: AGHT+IE+ttIbCy0SMKnbv8P5dir5+2/h1iAP1anhrhtyYoJ/ag2FDZflxmfE4svH4Uxez+4Zs/MseA== X-Received: by 2002:a5d:9541:0:b0:7f3:cb2a:a1b2 with SMTP id ca18e2360f4ac-7f62ee85397mr1239939539f.13.1719957495211; Tue, 02 Jul 2024 14:58:15 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:14 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 01/52] docs/dyndbg: update examples \012 to \n Date: Tue, 2 Jul 2024 15:56:51 -0600 Message-ID: <20240702215804.2201271-2-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" commit 47ea6f99d06e ("dyndbg: use ESCAPE_SPACE for cat control") changed the control-file to display format strings with "\n" rather than "\012". Update the docs to match the new reality. Signed-off-by: Jim Cromie --- Documentation/admin-guide/dynamic-debug-howto.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst index 0e9b48daf690..6a8ce5a34382 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -52,12 +52,12 @@ query/commands to the control file. Example:: # grease the interface :#> alias ddcmd='echo $* > /proc/dynamic_debug/control' - :#> ddcmd '-p; module main func run* +p' + :#> ddcmd '-p; module main func run* +p' # disable all, then enable main :#> grep =p /proc/dynamic_debug/control - init/main.c:1424 [main]run_init_process =p " with arguments:\012" - init/main.c:1426 [main]run_init_process =p " %s\012" - init/main.c:1427 [main]run_init_process =p " with environment:\012" - init/main.c:1429 [main]run_init_process =p " %s\012" + init/main.c:1424 [main]run_init_process =p " with arguments:\n" + init/main.c:1426 [main]run_init_process =p " %s\n" + init/main.c:1427 [main]run_init_process =p " with environment:\n" + init/main.c:1429 [main]run_init_process =p " %s\n" Error messages go to console/syslog:: From patchwork Tue Jul 2 21:56:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720371 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6D4ADC3065C for ; Tue, 2 Jul 2024 21:58:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C4C5910E6BC; Tue, 2 Jul 2024 21:58:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YKpoiFmo"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2A1B010E6BE; Tue, 2 Jul 2024 21:58:18 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7f3d59ff826so173085239f.3; Tue, 02 Jul 2024 14:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957497; x=1720562297; darn=lists.freedesktop.org; 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=0jicnEuSikysNdrvNl4Iye9B1q1hn5wCOtgRQWjJh+Y=; b=YKpoiFmo0fKBTeU+3fL34cgk/h7y99HDYYOVhg0JbjgjdmcPFlztBc8EEkADORx5io ZU7UJcAXTLsVWUfmy7Dg9IG0mfaG2XjKzPYYzpTYKET27y8ODO56qlgDRQKUgMM088Gn W/R5d+8qa+FEeCVTQayVe1KKaYCGaYBeKl8UJOPu+7PRFvOQc2RQs2VYAuLrXrsU7ApB fAEYesA2JKOHytq0DI6MqYn4c7jdjALMDDDo8mLJ5cyRK03a1LP5AC8OIeaNjy9PRBmo XVTEE0SlqZ7NNIddaEZPpve7l6XwiFHyf+tTVwlLmsp6KQXElM3U1EQ2lgujvrc9FI5H tlMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957497; x=1720562297; 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=0jicnEuSikysNdrvNl4Iye9B1q1hn5wCOtgRQWjJh+Y=; b=Svngbt3I6K5WNfJRamMjSG9cMjx23QgcosHBnKi0T6HG5C0ZakpVf6Vf6da+BQGMra amQYIr+Xmdfbstr7Ko6qVi3jSm7/kVOrlTG2IKqouoSyL1TcR5E/16Mo7hjSHCS8kNYm dK9WAuxqNSl9rNIfyDHevnHJdMNBgNxbyd26MwxZpcQb0s/tjBCeKxy7qYjbLn/twbKt dBoee2/g4jOVc5c+9ESGTSXmcP3ApuXbMFv+sQFY0+M+rDlAXtheP82uaHPr//GMkFYU 6CxeWFNPohQ/E0Drkv5HayYBJ3EP1gGhisD/qcs0kYTFgoxM9s9bic+5MS1lavSizHg3 OfRg== X-Forwarded-Encrypted: i=1; AJvYcCVeL6oI8R+dOOQSEubNR0NMGZUfTRKAlAGXBRS74YNyRakH+TylgFxEhPep4DzMlcCFOn6lTBCmp5d9LY5B9e1frJJIFaT3aalbUc8ozwC380MIs+yABDYwqWKAbBD2yUQbHTwZ8kPdZHggnT6OxDOMiG0i7atd/yjj8o3g0u7hSw4MtvUInBnO6B8fUnSEy5WbZgo6LSvB+DRMdV0PtdEoRC6CsxcJFLwASCTAObHMD8uKWis= X-Gm-Message-State: AOJu0Yzaj/LjF3x2Xgl8t1SsKVIBTE1IoxQF7FKiy1n8eds7azcA2o0f deefvPJ/WZIswZBjBeBXB0NpmXDTGeUgp4CxxwQKJEa85DU0RjNV X-Google-Smtp-Source: AGHT+IGgEpsraXVf8DsSJ53T9EEmQ2VNyi43sZWgM3hFXw7ayPt2A1BBLWk8VrVLBa5eFbK21ld0jQ== X-Received: by 2002:a05:6602:1224:b0:7f6:1ea5:de97 with SMTP id ca18e2360f4ac-7f62ee3d6bdmr1057195239f.3.1719957497302; Tue, 02 Jul 2024 14:58:17 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:15 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 02/52] test-dyndbg: fixup CLASSMAP usage error Date: Tue, 2 Jul 2024 15:56:52 -0600 Message-ID: <20240702215804.2201271-3-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" A more careful reading of logging output from test_dynamic_debug.ko reveals: lib/test_dynamic_debug.c:103 [test_dynamic_debug]do_cats =pmf "doing categories\n" lib/test_dynamic_debug.c:105 [test_dynamic_debug]do_cats =p "LOW msg\n" class:MID lib/test_dynamic_debug.c:106 [test_dynamic_debug]do_cats =p "MID msg\n" class:HI lib/test_dynamic_debug.c:107 [test_dynamic_debug]do_cats =_ "HI msg\n" class unknown, _id:13 107 says: HI is unknown, 105,106 have LOW/MID and MID/HI skew. The enum's 1st val (explicitly initialized) was wrong; it must be _base, not _base+1 (a DECLARE_DYNDBG_CLASSMAP param). So the last enumeration exceeded the range of mapped class-id's, which triggered the "class unknown" report. I coded in an error, intending to verify err detection, then forgot, and missed that it was there. So this patch fixes a bad usage of DECLARE_DYNDBG_CLASSMAP(), showing that it is too error-prone. As noted in test-mod comments: * Using the CLASSMAP api: * - classmaps must have corresponding enum * - enum symbols must match/correlate with class-name strings in the map. * - base must equal enum's 1st value * - multiple maps must set their base to share the 0-62 class_id space !! Signed-off-by: Jim Cromie --- lib/test_dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 8dd250ad022b..a01f0193a419 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -75,7 +75,7 @@ DD_SYS_WRAP(disjoint_bits, p); DD_SYS_WRAP(disjoint_bits, T); /* symbolic input, independent bits */ -enum cat_disjoint_names { LOW = 11, MID, HI }; +enum cat_disjoint_names { LOW = 10, MID, HI }; DECLARE_DYNDBG_CLASSMAP(map_disjoint_names, DD_CLASS_TYPE_DISJOINT_NAMES, 10, "LOW", "MID", "HI"); DD_SYS_WRAP(disjoint_names, p); From patchwork Tue Jul 2 21:56:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720372 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C084AC30658 for ; Tue, 2 Jul 2024 21:58:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 62AFF10E6C0; Tue, 2 Jul 2024 21:58:20 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Q61yQr5q"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 133E510E6BE; Tue, 2 Jul 2024 21:58:19 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7f61f41eef0so205060239f.3; Tue, 02 Jul 2024 14:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957498; x=1720562298; darn=lists.freedesktop.org; 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=4gHhZlZC9lRM4IBPTZ/FMwaYyy9pebB6jMENYSRc4Ds=; b=Q61yQr5qtpgVKP0+V+NmqKjuwJn2NNN48lH+FVxbfJp/nhEzYPCRzquztlfk/Bgryz Ts5MDejq8urhlPCEVCjsdBCCmSlV3apel8GQZ/EuYizwXEjfeV0RL5RzA08SseozvIvB P/uy7lm7LNEzNe1STTOV32Fk1YATkPbewCraPWRIi/d+y9PPyjktLy0ZAnKR5BX156hE 0ZLoImFOlNrc7kmcWXUC36ro4IrtZkNvkj8CXxnEQLACnQ7Pn47CxuulGA7i7K08Oplf T4sEw45e2+e0f+H7W8Pz8IDXeIyv468gnMqOQUTvk+0B3qfskNjGnmxCFavD63nQVyE6 zRsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957498; x=1720562298; 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=4gHhZlZC9lRM4IBPTZ/FMwaYyy9pebB6jMENYSRc4Ds=; b=LTBBjD6v/P9OspYRI1JruO0wO4eNVkZq9kXOQRlZhBLfGdxlt/hR/bZUyFUCcHhl+a 9Hu5rTpuLLTgia7DAjkC1YX93ygg8f3vN2E213oXb5BYuQfImVIIgfiDHEhdzs9+dnL6 HGGf0dn/f0au1UsYyBZONuhINoaFYt1L1LM+niyQtv+TvlFAPBJ/3eiJIwWNKN0rQm/g NL/ocqk106TFl0Df81vTIeMrUCrElJz9WE3EacJZwpAVkutJrqfZsuMP+seKWWiGKf7C 7r6fDHa7oQJITQLDM7tHeS+mReYCUQs13nz8HJDNxmXWIbGBKgQpw4fafs7Dw+mEEjAe JS5Q== X-Forwarded-Encrypted: i=1; AJvYcCW8xe+nBJOqq/qsNgs7jug0rskHtTCYGlJAeQ5tCJoklRlHtTj2ju8XFeorJzhKdzD1sFY6S7jJZH+sYHy+6iSNnJUiNbJ6yrlZI5vfGB8GzEfvrQyIRClktbARwiHoyDdd8zdTmSU/EQbJpespjyDTjC0bZpAgwGt9W+yzgF0x92M72IFRw1Ir36VCjrv8ek0b2qYZadFjBk1Ep51HB+HkMblwy8NlWlBJWQ7dpM4PKVmwCZM= X-Gm-Message-State: AOJu0YzQj/XGdLApdKFWgS8YS30LN0OX3mKD/mEarN8BlwX62LtgHEow IDx+Cf9imytD/ExyOUAUOfR+xrVXt+yRPg/5kL1WLwB3mPGXy1T0YU+f2Q== X-Google-Smtp-Source: AGHT+IGvsn87+MenBdfimxbbj/1jff8gsxfSw490RrEkjixo7jQ/GQOm1e+Gm6LnX0EupXDxk6SVWg== X-Received: by 2002:a05:6602:1651:b0:7f6:51ac:bba9 with SMTP id ca18e2360f4ac-7f651acbd92mr409433439f.10.1719957498297; Tue, 02 Jul 2024 14:58:18 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:17 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 03/52] dyndbg: reword "class unknown, " to "class:_UNKNOWN_" Date: Tue, 2 Jul 2024 15:56:53 -0600 Message-ID: <20240702215804.2201271-4-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" When a dyndbg classname is unknown to a kernel module (as before previous patch), the callsite is un-addressable via >control queries. The control-file displays this condition as "class unknown," currently. That spelling is sub-optimal/too-generic, so change it to "class:_UNKNOWN_" to loudly announce the erroneous situation, and to make it exceedingly greppable. NB: pr_debugs are only alterable via >control, and to protect class'd debug's from unintended alteration, "class name" must be given to change them. Classmaps map known classes to reserved .class_ids (the 1..64 val range per module). Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index f2c5e7910bb1..73ccf947d4aa 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1154,7 +1154,7 @@ static int ddebug_proc_show(struct seq_file *m, void *p) if (class) seq_printf(m, " class:%s", class); else - seq_printf(m, " class unknown, _id:%d", dp->class_id); + seq_printf(m, " class:_UNKNOWN_ _id:%d", dp->class_id); } seq_puts(m, "\n"); From patchwork Tue Jul 2 21:56:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720373 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E9EB6C3065C for ; Tue, 2 Jul 2024 21:58:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 33DF910E6C3; Tue, 2 Jul 2024 21:58:22 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mUOb0M9m"; dkim-atps=neutral Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3970710E6AB; Tue, 2 Jul 2024 21:58:20 +0000 (UTC) Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-7f63db7a69cso142327339f.2; Tue, 02 Jul 2024 14:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957499; x=1720562299; darn=lists.freedesktop.org; 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=p9Cfh8vQIJvZJJ9snElx0jBXe6PzWuVjUPtCeny8PSA=; b=mUOb0M9mK/56uyDidX6Lg7PtlXUkuExNFEuhXq7Il+o4c6zOLwpzS8RGUFmNdns2LL 3K0YWG5n4ZlvU4kL9pOJAI273A5uFy/YGwfok/nm4Y9KGyCTLrR77DoJheg+lI7p4I3K XStI6MNZhxRvlgy7cpnPQg6yuTMBFnjQV+0HWBNjBGCkF2eGb5adf7i6GJ5qsq9Pou83 4E/jqR8J8EGux8yM+Q4PhCMjVTmm6eeCS06YQRouVc7yWKFRb8wH/k3Ad/aFq3Eupn3J C4KxejP3bBk9rhG5dvbLKY32tldiOoGiUOQSKqAs5EVsdD6susnxjQjwxcqk73U7rakR fxpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957499; x=1720562299; 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=p9Cfh8vQIJvZJJ9snElx0jBXe6PzWuVjUPtCeny8PSA=; b=h1YzmTsWMJuVIUac3b8V98esBqCFwKdeEsy1Mp5A7y0Ga9WvuHOvXmxcsJq9renIkh SXbDfMDD3T2NUxMkPYc/K5We+vAxM8OUoizgkNPSQgVYqj0nG3O6aJ4NaBsF2383PHOk 4WvJ3fSMMmg7t1InfauRaoFSGl8xzkvtqeTVu48BPnXYwPRmjn8rSv0pMIvlZ9AS+esp cy9JB+M19Kg7/QkTPbKPYy021yAlaJoDD+HE36EI0CNdRxA6uODylfitCOgL/bEta37h ZT0r/BmrSnLO3NtDOadF5YDJrQ19B1Xv0W2cALkrffP49AKPsdGX31lurxgDg7+5+9Co H0yQ== X-Forwarded-Encrypted: i=1; AJvYcCXjScb9EYAJbOHwnqKKqR74zI+WbKxqMEFr2UGhqngmfnVQ1tHmdSsttnIwV/nI3l5JAi3oSyR2Bvk/ht0ImbMEX3w6HmOKK8MZn0szvzTF5NCcEBPOY5uzOuMS2C16HFxgSbkVZnhOFAHYUlkuu6vMr7ocwkhWiYO/VXie4OFkAgt2sz4m4UC/2lO5qslhF5wYiwo6gIALJOgP/+6m7tgJgeqeCytdCv3q0dhkVUyl6dpxr+A= X-Gm-Message-State: AOJu0Yxn6kpQUOn9Q4jVyBqWMTNiJFnpYnaCUL4dTEPjkBG4AGTRUsu+ 98Mbm0VoFv6Y8ligkQPKmpFMQRghfcHvOCRv6pFRUQ6JZKIYjbxz X-Google-Smtp-Source: AGHT+IG2ft1Pm2/g4PtzgBlVmK5r7iXT/FGK9csFrxluaEy4o+i8PIv1GdXT4+15tPtbVitEa/IibQ== X-Received: by 2002:a6b:5a0e:0:b0:7f6:210c:61b0 with SMTP id ca18e2360f4ac-7f62ee853a4mr1060817239f.20.1719957499460; Tue, 02 Jul 2024 14:58:19 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:18 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 04/52] dyndbg: make ddebug_class_param union members same size Date: Tue, 2 Jul 2024 15:56:54 -0600 Message-ID: <20240702215804.2201271-5-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" struct ddebug_class_param keeps a ref to the state-storage of the param; make both class-types use the same unsigned long storage type. ISTM this is simpler and safer; it avoids an irrelevant difference, and if 2 users somehow get class-type mixed up (or refer to the wrong union member), at least they will both see the same value. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 2 +- lib/dynamic_debug.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 4fcbf4d4fd0a..5231aaf361c4 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -124,7 +124,7 @@ struct _ddebug_info { struct ddebug_class_param { union { unsigned long *bits; - unsigned int *lvl; + unsigned long *lvl; }; char flags[8]; const struct ddebug_class_map *map; diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 73ccf947d4aa..152b04c05981 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -799,7 +799,7 @@ int param_get_dyndbg_classes(char *buffer, const struct kernel_param *kp) case DD_CLASS_TYPE_LEVEL_NAMES: case DD_CLASS_TYPE_LEVEL_NUM: - return scnprintf(buffer, PAGE_SIZE, "%d\n", *dcp->lvl); + return scnprintf(buffer, PAGE_SIZE, "%ld\n", *dcp->lvl); default: return -1; } From patchwork Tue Jul 2 21:56:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720374 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ECAE3C3271E for ; Tue, 2 Jul 2024 21:58:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5F0D010E6BF; Tue, 2 Jul 2024 21:58:22 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kZmrU9VB"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4048310E6C3; Tue, 2 Jul 2024 21:58:21 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7f3cd2c0a79so167751039f.1; Tue, 02 Jul 2024 14:58:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957500; x=1720562300; darn=lists.freedesktop.org; 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=52iPg28HXqn4X2lm9WUrOmLU/4QpKAFdaAvrwuYTPPw=; b=kZmrU9VBrrj402r8A66+bAYkyjpWbgGLt+5bc1DebNx0fmfsbdtn9wRKB4iQEON69D 9b2jdkJNgohrFNz/P4gyhQoB6U5f8luVp+BVAIh4zvTbZGf8R9cFglXW7drMTzqJxzJo XRUVbdfI940bxWGAeF5g5Mm8f69ZNnhgWmlqCWdvmEs5zmm5o0RLCbVLpH+DOJ0PXtSR u/ECGuEQH3EJu5Hw9rTapyB5FmwnwH15uxnsOyhZpAq0n8GfNGTXHQk800wwGqhRxCYj +/exKho1JuJmf23PeitFgDOKlDnVfGIbt4ej4/LgtVSzq0SEQPi3lh8y1Z67r5zQZm5C DRsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957500; x=1720562300; 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=52iPg28HXqn4X2lm9WUrOmLU/4QpKAFdaAvrwuYTPPw=; b=RMpp3o1F+IBxuNCquZMpim7/audN/cKlMBhkwm/U476hBHeRw4bgVmYJGLStYHGock 5zm+eOff5HAPgFmoMt7cl6t8jN3KYiEEfztnqHw4f/56hgJAtCCHwqhBnEeFT3rpYw7s Xq7FQsbGAmhU24OW+iwYEZv2k1tg3HiIYHghPX65cZBu8/CSh6+8KdzI7U6A4WnFI8Zx CwTI68M/MMLYLawfM9NJ6Dpz88Lkw+NCAF+67BO0Tjyl5iutGBqtJFA6tH8lEwILnYb2 I0yINuJZ7U1AJL9ATwShyeVeh2PRs7BxGFvhXGNrLJveYDkNlZ8j4aFUso+qgWhvIFsB VdFQ== X-Forwarded-Encrypted: i=1; AJvYcCXOfMF/rmBPoYU9nykjZW2RrkJi9ZHB1NaueQD2LbrOsRb+7/ppHJAu9k/EEII1WPTDsIOnYjmxJLA4Lu/mQIEb+EWYOFOsbkRK5Poiwm4rxBOXyaMFO8abmwGxx6AxYmlqs0xQB1O0pfRRV5gEs3xFqe1PpOe6K6aqACzVqtQgTP2TNT/9uhibrzA5L8tc+hpsstmY3hd1yQVwajafbb4sgmTlOJTItmh8WrwmbxJ37lRSHs8= X-Gm-Message-State: AOJu0Yy1NXdSREYmdrxtZ1owIFOHtrp180gFW1WU0mjQ2DOjJOd/dLol tqp9ubhSZ8wgFwCZ9bFrf/LjqqsCyx0X2hbZ023WbnN8O2lRfoqM X-Google-Smtp-Source: AGHT+IFFbCIfl8bx2w+JuzIZmXvsJ6oAJ2Emqs0cnXdbK8ry2e4bmgYEQW6dg5QtzqjQCMNgfaCDxQ== X-Received: by 2002:a6b:5a0f:0:b0:7f6:1cd3:9659 with SMTP id ca18e2360f4ac-7f62ee0d9bfmr1193270039f.6.1719957500464; Tue, 02 Jul 2024 14:58:20 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:20 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 05/52] dyndbg: replace classmap list with a vector Date: Tue, 2 Jul 2024 15:56:55 -0600 Message-ID: <20240702215804.2201271-6-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Classmaps are stored in an elf section/array, but are individually list-linked onto dyndbg's per-module ddebug_table for operation. This is unnecessary; even when ddebug_attach_classmap() is handling the builtin section (with classmaps for multiple builtin modules), its contents are ordered, so a module's possibly multiple classmaps will be consecutive in the section, and could be treated as a vector/block, since both start-address and subrange length are in the ddebug_info arg. IOW, this treats classmaps similarly to _ddebugs, which are already kept as vector-refs (address+len). So this changes: struct ddebug_class_map drops list-head link. struct ddebug_table drops the list-head maps, and gets: classes & num_classes for the start-address and num_classes, placed to improve struct packing. The loading: in ddebug_attach_module_classes(), replace the for-the-modname list-add loop, with a forloop that finds the module's subrange (start,length) of matching classmaps within the possibly builtin classmaps vector, and saves those to the ddebug_table. The reading/using: change list-foreach loops in ddebug_class_name() & ddebug_find_valid_class() to walk the array from start to length. Also: Move #define __outvar up, above an added use in a fn-prototype. Simplify ddebug_attach_module_classes args, ref has both address & len. no functional changes Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 1 - lib/dynamic_debug.c | 61 ++++++++++++++++++----------------- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 5231aaf361c4..b53217e4b711 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -83,7 +83,6 @@ enum class_map_type { }; struct ddebug_class_map { - struct list_head link; struct module *mod; const char *mod_name; /* needed for builtins */ const char **class_names; diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 152b04c05981..46e4cdd8e6be 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -45,10 +45,11 @@ extern struct ddebug_class_map __start___dyndbg_classes[]; extern struct ddebug_class_map __stop___dyndbg_classes[]; struct ddebug_table { - struct list_head link, maps; + struct list_head link; const char *mod_name; - unsigned int num_ddebugs; struct _ddebug *ddebugs; + struct ddebug_class_map *classes; + unsigned int num_ddebugs, num_classes; }; struct ddebug_query { @@ -147,13 +148,15 @@ static void vpr_info_dq(const struct ddebug_query *query, const char *msg) query->first_lineno, query->last_lineno, query->class_string); } +#define __outvar /* filled by callee */ static struct ddebug_class_map *ddebug_find_valid_class(struct ddebug_table const *dt, - const char *class_string, int *class_id) + const char *class_string, + __outvar int *class_id) { struct ddebug_class_map *map; - int idx; + int i, idx; - list_for_each_entry(map, &dt->maps, link) { + for (map = dt->classes, i = 0; i < dt->num_classes; i++, map++) { idx = match_string(map->class_names, map->length, class_string); if (idx >= 0) { *class_id = idx + map->base; @@ -164,7 +167,6 @@ static struct ddebug_class_map *ddebug_find_valid_class(struct ddebug_table cons return NULL; } -#define __outvar /* filled by callee */ /* * Search the tables for _ddebug's which match the given `query' and * apply the `flags' and `mask' to them. Returns number of matching @@ -1114,9 +1116,10 @@ static void *ddebug_proc_next(struct seq_file *m, void *p, loff_t *pos) static const char *ddebug_class_name(struct ddebug_iter *iter, struct _ddebug *dp) { - struct ddebug_class_map *map; + struct ddebug_class_map *map = iter->table->classes; + int i, nc = iter->table->num_classes; - list_for_each_entry(map, &iter->table->maps, link) + for (i = 0; i < nc; i++, map++) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; @@ -1200,30 +1203,31 @@ static const struct proc_ops proc_fops = { .proc_write = ddebug_proc_write }; -static void ddebug_attach_module_classes(struct ddebug_table *dt, - struct ddebug_class_map *classes, - int num_classes) +static void ddebug_attach_module_classes(struct ddebug_table *dt, struct _ddebug_info *di) { struct ddebug_class_map *cm; - int i, j, ct = 0; + int i, nc = 0; - for (cm = classes, i = 0; i < num_classes; i++, cm++) { + /* + * Find this module's classmaps in a subrange/wholerange of + * the builtin/modular classmap vector/section. Save the start + * and length of the subrange at its edges. + */ + for (cm = di->classes, i = 0; i < di->num_classes; i++, cm++) { if (!strcmp(cm->mod_name, dt->mod_name)) { - - v2pr_info("class[%d]: module:%s base:%d len:%d ty:%d\n", i, - cm->mod_name, cm->base, cm->length, cm->map_type); - - for (j = 0; j < cm->length; j++) - v3pr_info(" %d: %d %s\n", j + cm->base, j, - cm->class_names[j]); - - list_add(&cm->link, &dt->maps); - ct++; + if (!nc) { + v2pr_info("start subrange, class[%d]: module:%s base:%d len:%d ty:%d\n", + i, cm->mod_name, cm->base, cm->length, cm->map_type); + dt->classes = cm; + } + nc++; } } - if (ct) - vpr_info("module:%s attached %d classes\n", dt->mod_name, ct); + if (nc) { + dt->num_classes = nc; + vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); + } } /* @@ -1256,10 +1260,9 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) dt->num_ddebugs = di->num_descs; INIT_LIST_HEAD(&dt->link); - INIT_LIST_HEAD(&dt->maps); if (di->classes && di->num_classes) - ddebug_attach_module_classes(dt, di->classes, di->num_classes); + ddebug_attach_module_classes(dt, di); mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); @@ -1372,8 +1375,8 @@ static void ddebug_remove_all_tables(void) mutex_lock(&ddebug_lock); while (!list_empty(&ddebug_tables)) { struct ddebug_table *dt = list_entry(ddebug_tables.next, - struct ddebug_table, - link); + struct ddebug_table, + link); ddebug_table_free(dt); } mutex_unlock(&ddebug_lock); From patchwork Tue Jul 2 21:56:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720375 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C434CC30658 for ; Tue, 2 Jul 2024 21:58:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5BF1810E6C5; Tue, 2 Jul 2024 21:58:23 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YugcwDC+"; dkim-atps=neutral Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5539D10E6C4; Tue, 2 Jul 2024 21:58:22 +0000 (UTC) Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-7f61549406eso180454639f.1; Tue, 02 Jul 2024 14:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957501; x=1720562301; darn=lists.freedesktop.org; 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=mgKlPNiKWVnT1pPVJRogWWF3tyIXWVHBmJ5ag9aE+c4=; b=YugcwDC+gomPWIvWRJQX/BWmKPLGFoG5mqRz2/dfCaI1HhJsT8E18G5JyjwvR5Zujn nAO7lBQyAuxxioWG+RPXvLwfx7N6Xes1jW5a+C5Vml8gzcfGPbeYWQLPBxavRBL3FhDN RUy+zAn7s29Kyj6fl2H+yOk55H5ntFb1Iu6+znGW3rvFO8xqTCG/NOrBBjq2iA4oVeoy rEkesomeKOYiftdcPJCqMNrRmQPPvUe5pLCzJePMSXFUsk6MGOaMMCz2MOYqPA13tv/9 GblAxKNy+PJOrdlecwLNFt5WuzF6o9LNwHfQ2e1gWp3QGf3SUEA4BzBPYaAlHgpNxeYO HsUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957501; x=1720562301; 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=mgKlPNiKWVnT1pPVJRogWWF3tyIXWVHBmJ5ag9aE+c4=; b=wq1yMyo3RGK7+CVMdaatS1lLuFCQsJF7p/fAMbx4Cv0N/k8Jr3D5Ow2aqdG6iyA2ae hJBj1liWgZ6nmpQx/1GnqnSIqOWOzSPPTC98iJtchiw2vRen5AKThHVO1/u7wea4+L7p 0R8zdFbBUmOgdrQNlamwcAvyhJRwAgHqvCMtIJRkErDiu+i4/q2EzgpdgBUHEZlPGmf5 jqgmVxG1kXEuezHyHCsZvWQLHVvtjGyN2qep8B0sa1d0J58VQODavx6nVVhVseLm5/jl SQCQ9SalSPp/AczwfOEKc655V+bhKYmyWtc0FiiBuclicdVpxSKyboIApH+IhAJK8wWK xr+g== X-Forwarded-Encrypted: i=1; AJvYcCUqEMWrquTh89gZ9J7mNmMFotBmJSmYaL5LYVs3GygQMtk5D2VxF/KP66WfS8yQ7SFOtfjArAh/S2AC78mb/A20328DIU4fX4aQgBCERsBM3h5CeK5gsfUPGbxGp0TXaUfNQns7W+pOjATaIMDsdCKMBVpZLOiQmisgxLsUrZ+U4q1YXNrCF8abVun+VeRGhMDIMm8LeVuG6boLLySP14Vi2ufR3kVRv0/jSxDf4FVdpwJA71I= X-Gm-Message-State: AOJu0YyPvhBHXVQCKa34NVGhr7Z+QjjdAeuBaRhonInRJRP6DmKUovB2 vEBHyhEJEdtwtEjfocVYaSUL8uLyQCOIdyovoQ/PcXi1SyIlkPOi X-Google-Smtp-Source: AGHT+IEouPw8z+/+QZWHDW3dmgyQBg1bWleLTxR4pkI5y+9ohF4HuUpGu7gB4NJ1D41ODvUT06RDlQ== X-Received: by 2002:a5e:8d19:0:b0:7f6:2e72:e810 with SMTP id ca18e2360f4ac-7f62edffb18mr1166209939f.3.1719957501499; Tue, 02 Jul 2024 14:58:21 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:21 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 06/52] dyndbg: ddebug_apply_class_bitmap - add module arg, select on it Date: Tue, 2 Jul 2024 15:56:56 -0600 Message-ID: <20240702215804.2201271-7-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add param: query_module to ddebug_apply_class_bitmap(), and pass it thru to _ddebug_queries(), replacing NULL with query_module. This allows its caller to update just one module, or all (as currently). We'll use this later to propagate drm.debug to each USEr as they're modprobed. No functional change. Signed-off-by: Jim Cromie --- after `modprobe i915`, heres the module dependencies, though not all on drm.debug. bash-5.2# lsmod Module Size Used by i915 3133440 0 drm_buddy 20480 1 i915 ttm 90112 1 i915 i2c_algo_bit 16384 1 i915 video 61440 1 i915 wmi 32768 1 video drm_display_helper 200704 1 i915 drm_kms_helper 208896 2 drm_display_helper,i915 drm 606208 5 drm_kms_helper,drm_display_helper,drm_buddy,i915,ttm cec 57344 2 drm_display_helper,i915 --- lib/dynamic_debug.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 46e4cdd8e6be..a1fd2e9dbafb 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -605,7 +605,8 @@ static int ddebug_exec_queries(char *query, const char *modname) /* apply a new bitmap to the sys-knob's current bit-state */ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, - unsigned long *new_bits, unsigned long *old_bits) + unsigned long *new_bits, unsigned long *old_bits, + const char *query_modname) { #define QUERY_SIZE 128 char query[QUERY_SIZE]; @@ -613,7 +614,8 @@ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, int matches = 0; int bi, ct; - v2pr_info("apply: 0x%lx to: 0x%lx\n", *new_bits, *old_bits); + v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, *old_bits, + query_modname ?: ""); for (bi = 0; bi < map->length; bi++) { if (test_bit(bi, new_bits) == test_bit(bi, old_bits)) @@ -622,12 +624,15 @@ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, snprintf(query, QUERY_SIZE, "class %s %c%s", map->class_names[bi], test_bit(bi, new_bits) ? '+' : '-', dcp->flags); - ct = ddebug_exec_queries(query, NULL); + ct = ddebug_exec_queries(query, query_modname); matches += ct; v2pr_info("bit_%d: %d matches on class: %s -> 0x%lx\n", bi, ct, map->class_names[bi], *new_bits); } + v2pr_info("applied bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, *old_bits, + query_modname ?: ""); + return matches; } @@ -682,7 +687,7 @@ static int param_set_dyndbg_classnames(const char *instr, const struct kernel_pa continue; } curr_bits ^= BIT(cls_id); - totct += ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits); + totct += ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits, NULL); *dcp->bits = curr_bits; v2pr_info("%s: changed bit %d:%s\n", KP_NAME(kp), cls_id, map->class_names[cls_id]); @@ -692,7 +697,7 @@ static int param_set_dyndbg_classnames(const char *instr, const struct kernel_pa old_bits = CLASSMAP_BITMASK(*dcp->lvl); curr_bits = CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); - totct += ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits); + totct += ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits, NULL); *dcp->lvl = (cls_id + (wanted ? 1 : 0)); v2pr_info("%s: changed bit-%d: \"%s\" %lx->%lx\n", KP_NAME(kp), cls_id, map->class_names[cls_id], old_bits, curr_bits); @@ -755,7 +760,7 @@ int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp) inrep &= CLASSMAP_BITMASK(map->length); } v2pr_info("bits:%lx > %s\n", inrep, KP_NAME(kp)); - totct += ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits); + totct += ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, NULL); *dcp->bits = inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -768,7 +773,7 @@ int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp) old_bits = CLASSMAP_BITMASK(*dcp->lvl); new_bits = CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); - totct += ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits); + totct += ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, NULL); *dcp->lvl = inrep; break; default: From patchwork Tue Jul 2 21:56:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720376 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D14B4C31D97 for ; Tue, 2 Jul 2024 21:58:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A01410E6C4; Tue, 2 Jul 2024 21:58:24 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XLCuaEgn"; dkim-atps=neutral Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id A3C7110E6BE; Tue, 2 Jul 2024 21:58:23 +0000 (UTC) Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7eba486df76so855839f.0; Tue, 02 Jul 2024 14:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957503; x=1720562303; darn=lists.freedesktop.org; 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=6xZzQ/E3vZK+E5MMlKfK/qTb5+sylxnNOul573hVp9Y=; b=XLCuaEgn0PUAp4oi4bkAMvDJFVGgFu99WviNuaOjHHFrWM98ZFhDsiaMFaGwfDb9it ApwGmtO7EeyNzNk0lJQgu8WexVMFuli+3AnlmlHESdoI1PkesFX3DJChQ11B6nZBg736 7wLAzLUZuerQ8hc9CazOGH4h/Jx3zhkD9cEYot5xVeBjYySDPOV57iagu0W7VRrpt9Ad gckXnLAaZbjwaGk+LtcZ3fHRsIXlh9oN8c8221darDTHKJTM/W2HLV1ct9nuGIVmm1gt qM027z1lvddfzHTRWtxB3GIqXyECaWvMx/XAM2ILAeL9ItpF+CAs1huZKL3Uo4a1IJUS s7RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957503; x=1720562303; 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=6xZzQ/E3vZK+E5MMlKfK/qTb5+sylxnNOul573hVp9Y=; b=NQ8ws/eiWrTrK6/Ox3TKFQqzC4Bv6H9w9/K+ounScahT71xKpQo3ugTyGUyMQyNfnJ i19zxZ2AY9j4tngbtC6ieVCzVQpK7p+21IAGCoPJfWXOMDAUNCFrK0XtjbcsHKvuYA76 mPHUniTo1fc9eERAOjzN1yYJ6O3aCcq2W6EOU3elnw9HtirFApspGfYPgiFYKOD7ezZ2 1LGqIHqsmoxsPOKwYjJZQH8cIxYc41UnrrZw5IhdcTRUBqV8F6mn9qWWhIoIliT/z7bN llp8Alu8BOwHB+NlgT5+SZq6WoEc3J0dgAGTM9SHu4Dz6hP2ZvwrIZmw+5MFGTg99QB/ ecHw== X-Forwarded-Encrypted: i=1; AJvYcCXT4knVmZzxYxt17LsCf/XjRpfCpzGNuH7rbwuseEInLMyt3D1ZfGwvetx2efdFUAvxLxRdePmDbix5Vmk6rmjssPQ/RmWYHjvGr+OdUlORB06hOqpTC6wRor7RVrQBtDQk6pozbTowol+LiFzccpAUmt/ucBZHjVyEuKYNRa/q08N93udA1XQi48Q58A3xeZroxCwjA8hMjTZG04WRvsN9GXI6xgrfcmeln1iEMgWHeB8MioA= X-Gm-Message-State: AOJu0Yzfd8EvaPCTTGNhJXHJHgbBMcB+wtu1ieIZarB9CbSUK/Xd1Iae ZjQtrMJp+/0jLcKNmNefuMrKa2wGat+Gzf6q2hoHXrzsYRC5DUOS X-Google-Smtp-Source: AGHT+IGYdWlTTC7TRfqgE6BZNMFEtFIymMFnXp3OmPzaWNa0nuspcltmmeqiu/SmLsP4XIoxiBNboQ== X-Received: by 2002:a05:6602:178e:b0:7eb:eeba:5e83 with SMTP id ca18e2360f4ac-7f62eeab155mr453600539f.9.1719957502788; Tue, 02 Jul 2024 14:58:22 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:22 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 07/52] dyndbg: split param_set_dyndbg_classes to _module & wrapper fns Date: Tue, 2 Jul 2024 15:56:57 -0600 Message-ID: <20240702215804.2201271-8-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Split api-fn: param_set_dyndbg_classes(), adding modname param and passing NULL in from api-fn. The new arg allows caller to specify that only one module is affected by a prdbgs update. This selectivity will be used later to narrow the scope of changes made. no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index a1fd2e9dbafb..4a48f830507f 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -711,18 +711,9 @@ static int param_set_dyndbg_classnames(const char *instr, const struct kernel_pa return 0; } -/** - * param_set_dyndbg_classes - class FOO >control - * @instr: string echo>d to sysfs, input depends on map_type - * @kp: kp->arg has state: bits/lvl, map, map_type - * - * Enable/disable prdbgs by their class, as given in the arguments to - * DECLARE_DYNDBG_CLASSMAP. For LEVEL map-types, enforce relative - * levels by bitpos. - * - * Returns: 0 or <0 if error. - */ -int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp) +static int param_set_dyndbg_module_classes(const char *instr, + const struct kernel_param *kp, + const char *modnm) { const struct ddebug_class_param *dcp = kp->arg; const struct ddebug_class_map *map = dcp->map; @@ -759,8 +750,8 @@ int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp) KP_NAME(kp), inrep, CLASSMAP_BITMASK(map->length)); inrep &= CLASSMAP_BITMASK(map->length); } - v2pr_info("bits:%lx > %s\n", inrep, KP_NAME(kp)); - totct += ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, NULL); + v2pr_info("bits:0x%lx > %s.%s\n", inrep, modnm ?: "*", KP_NAME(kp)); + totct += ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, modnm); *dcp->bits = inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -773,7 +764,7 @@ int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp) old_bits = CLASSMAP_BITMASK(*dcp->lvl); new_bits = CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); - totct += ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, NULL); + totct += ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, modnm); *dcp->lvl = inrep; break; default: @@ -782,6 +773,22 @@ int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp) vpr_info("%s: total matches: %d\n", KP_NAME(kp), totct); return 0; } + +/** + * param_set_dyndbg_classes - class FOO >control + * @instr: string echo>d to sysfs, input depends on map_type + * @kp: kp->arg has state: bits/lvl, map, map_type + * + * Enable/disable prdbgs by their class, as given in the arguments to + * DECLARE_DYNDBG_CLASSMAP. For LEVEL map-types, enforce relative + * levels by bitpos. + * + * Returns: 0 or <0 if error. + */ +int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp) +{ + return param_set_dyndbg_module_classes(instr, kp, NULL); +} EXPORT_SYMBOL(param_set_dyndbg_classes); /** From patchwork Tue Jul 2 21:56:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AEA41C30658 for ; Tue, 2 Jul 2024 21:58:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 74FA410E6C9; Tue, 2 Jul 2024 21:58:26 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jzcTYT/2"; dkim-atps=neutral Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id E60BD10E6CB; Tue, 2 Jul 2024 21:58:24 +0000 (UTC) Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-7eba486df76so856839f.0; Tue, 02 Jul 2024 14:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957504; x=1720562304; darn=lists.freedesktop.org; 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=wso+Oi2/ut2legKe2oAWbXK/ItRspmzOjB4tGo2hISg=; b=jzcTYT/2PkZD3uXDPguTLQ8gTlWktnug6yLsUFB7M4rlHq+ZlSeaU/3rsLpvvhrv5f J20J2ePO2YWfo1Y5cQvqgeQ/dyyv+BLzd6OkEttYQKpVZXFWg69WNwh6d25MdSdN4Guy /46lP83aHnTAwmktrsyQgmmVc/07M39kVTD27cqnupVW3DGbMJn+tOpmo7lUEYQMwnNl wHZLD14ZggOUAh1+APzDC+kTXnj4yFgaPRGX78vvHu9JNcV2nIohWovsPPe8wKJu+TI6 fOSKkHUAAkHczW1wMPk9J4VBHxWRtpFiPpz2MgqF/G+JdBAcXSVuortBeUxg1t5l9fp2 Gm9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957504; x=1720562304; 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=wso+Oi2/ut2legKe2oAWbXK/ItRspmzOjB4tGo2hISg=; b=vDMMCJR/b21VprFw0HW3juj8s+oGvn2TbDJ+5/mLCn5EkgEKubpmHL16EhmCQfEwcF JHCUsu+XSn+Do/Zr1lmsTuFyi4eBUnqXlNQ2BmYYO85BYPxMTHBoz+T+P8glTNkSU9az bMSuDN61bYJ5+gSfOXmPb2Vj0/JrKUr939kdahmUx77J7ck6yeIyeGw/yoFV5zfuPUVT ArdRMnZ2Xkod7Gj+nMtjCRf53QlHmd8arxj2EHsqIYkT97NJ1YAEvuBC0e0IfGr3PzoH TtiMsV7j8cOgyBFrwz2d0TGUwBUWPkIdgeHqS1shWoiL83HpMePdrkdcTygXeg6AN9FY h5YA== X-Forwarded-Encrypted: i=1; AJvYcCWGspFOpI/EoxBSR+83pdN6I0R8It0DWMs75dNQkHaHdTMBbRGCA6Ooem1TM2JNXw/ATMvE0/KuPF+kJyXh1utvYcipZwIhXUeFiNYXZ7Cd6rLNwmX2//HdSrmGaNsJJ777lkS5J7JFG/MyONEV+vvs6ZXZ6cVi6MdPkZPj9WL8cEQxe+Xy4Cw8dPX+w/wM4XC/RSc11dXdiCgIXdwullX9JZWVR+NvU/uzfj9+GHJeMd3VGMQ= X-Gm-Message-State: AOJu0Yx911LOb8Iyp00NJMHyNdapBZH17nC98cs5n5H0N6WFiH/A0u/S ZCPpJDND5uChSpTDR79W9AynZsOqRBuI3iJ8o/nq00aqxILjBuc3 X-Google-Smtp-Source: AGHT+IEjihZo5dhJ6MSq0XVTxwNq7IPZF6HNZIFL7WZIO/OulVmLPGqkTjVhpi6rvHnYoJxnqgO6CA== X-Received: by 2002:a05:6602:54:b0:7f3:9e2c:fdfd with SMTP id ca18e2360f4ac-7f62ee9d6e6mr484501939f.8.1719957504092; Tue, 02 Jul 2024 14:58:24 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:23 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 08/52] dyndbg: drop NUM_TYPE_ARRAY Date: Tue, 2 Jul 2024 15:56:58 -0600 Message-ID: <20240702215804.2201271-9-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" ARRAY_SIZE works here, since array decl is complete. no functional change Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index b53217e4b711..8116d0a0d33a 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -106,11 +106,9 @@ struct ddebug_class_map { .mod_name = KBUILD_MODNAME, \ .base = _base, \ .map_type = _maptype, \ - .length = NUM_TYPE_ARGS(char*, __VA_ARGS__), \ + .length = ARRAY_SIZE(_var##_classnames), \ .class_names = _var##_classnames, \ } -#define NUM_TYPE_ARGS(eltype, ...) \ - (sizeof((eltype[]){__VA_ARGS__}) / sizeof(eltype)) /* encapsulate linker provided built-in (or module) dyndbg data */ struct _ddebug_info { From patchwork Tue Jul 2 21:56:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720378 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E6AF5C3065C for ; Tue, 2 Jul 2024 21:58:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA4A910E6C7; Tue, 2 Jul 2024 21:58:27 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="HDXSfWca"; dkim-atps=neutral Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 32DEA10E6C7; Tue, 2 Jul 2024 21:58:26 +0000 (UTC) Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-7f3ca6869d1so192027339f.0; Tue, 02 Jul 2024 14:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957505; x=1720562305; darn=lists.freedesktop.org; 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=z/963zG9LNPxu+BVNW7S/xeH6c8P5d5ieMeYbq4Ngms=; b=HDXSfWcaGL2KB/NLK36rfBlBv4xliF/ayiQboAMiNsvf/WyI/BMBTibhLz0RthrtR5 /iB2Y8y1eEuMxhqTPxjx4L3usG7pza6VdJp+CrZ8SeOqa7pKQANp587YrzNe0I5GLTbf T11Z4/HTc1IjlHe8b5yFQy3nDGR/61Pt6fX+zYSivPr45aMI12sp2GwOxoXxkIiu6ek+ 8RcTT9lHzCDudxMs3hshL5T7MOYXdwdoc6x4FUFQe5EuG20ag6EP7Z1e/k5uC2VPiDum bPZhQyRDGIG1qtWQ/HRaypmP5EDz360AQc21f497keGOPJUEwckLYJ4webB4IAAs6yOO OFyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957505; x=1720562305; 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=z/963zG9LNPxu+BVNW7S/xeH6c8P5d5ieMeYbq4Ngms=; b=Mj4NWQhzsUEaNY/MzaxG1VyprO3d+6tkiH7jni00jPtTTvm6SKMB3ryDuxO1Nj3f12 2PYPl9bnQnGKT7kMO+CgDQHFTeO5jfSQEAMcThw2Rn1M6LSQfkzQSlMSyHYQqPhImw0D +QINJOQS5wsU3mH9/sF0ig735uytYfh3OOutCb1EgNczV5QRX0he0qlfJqei2J/NQ92f hzYeeJIgPKTG/zUWkWpymU/UgmkmD6K1NCEWuggWrMPP4cCd2swmv8feenDLOUr1IzVg okreHRlxCmwrLVYlGzxtNSIWuIGbevw/T8MT8mTtcMOAjfgZC78HMlaszXAWEde2hS8d mv/Q== X-Forwarded-Encrypted: i=1; AJvYcCXpmMwvZRe4+QwXGNbmE6IYB/hcpzKsVbc1iyI0IHSSZNlu182iQXobSTsrZzxjO+O4JVN+6QgF3oR/XwKwOQGCNwZ0zYk4bZ5WqLUK7VJNBkMYytFE8d7Dekwku3ZUBxjlbZzrc/qxh19KKHc2syVKCbgVe3VwAG7/13/M9AskBB/sk1mCLQRnPBkAvcfIyVq6e8lakkaNiw2K1v1H8/2y+3BzT5KOqvURzYLW7qhKqWNCLLs= X-Gm-Message-State: AOJu0YzXNR2hg0VLjqA6cuGA62MuKSZzGJrXFUl1kH1WqFkGtd1TxzuX pBY1X6jisR04MK5RanCREH38ncrDEMU/GNUCtci8xEJ7jBtbyg8k X-Google-Smtp-Source: AGHT+IGX6ME8eGVqlfazOAcN/G0b48tkJYoxa8zIbYTUGgfze2KInpikaNyiDKbQdhqd9nSM7L0cIQ== X-Received: by 2002:a05:6602:808:b0:7f6:15be:a6e0 with SMTP id ca18e2360f4ac-7f62ee82b0cmr1045219839f.20.1719957505324; Tue, 02 Jul 2024 14:58:25 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:24 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 09/52] dyndbg: reduce verbose/debug clutter Date: Tue, 2 Jul 2024 15:56:59 -0600 Message-ID: <20240702215804.2201271-10-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" currently, for verbose=3, these are logged (blank lines for clarity): dyndbg: query 0: "class DRM_UT_CORE +p" mod:* dyndbg: split into words: "class" "DRM_UT_CORE" "+p" dyndbg: op='+' dyndbg: flags=0x1 dyndbg: *flagsp=0x1 *maskp=0xffffffff dyndbg: parsed: func="" file="" module="" format="" lineno=0-0 class=... dyndbg: no matches for query dyndbg: no-match: func="" file="" module="" format="" lineno=0-0 class=... dyndbg: processed 1 queries, with 0 matches, 0 errs That is excessive, so this patch: - shrinks 3 lines of 2nd stanza to single line - drops 1st 2 lines of 3rd stanza 3rd line is like 1st, with result, not procedure. 2nd line is just status, retold in 4th, with more info. New output: dyndbg: query 0: "class DRM_UT_CORE +p" mod:* dyndbg: split into words: "class" "DRM_UT_CORE" "+p" dyndbg: op='+' flags=0x1 *flagsp=0x1 *maskp=0xffffffff dyndbg: no-match: func="" file="" module="" format="" lineno=0-0 class=... dyndbg: processed 1 queries, with 0 matches, 0 errs no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 4a48f830507f..368381dbd266 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -266,9 +266,6 @@ static int ddebug_change(const struct ddebug_query *query, } mutex_unlock(&ddebug_lock); - if (!nfound && verbose) - pr_info("no matches for query\n"); - return nfound; } @@ -501,7 +498,6 @@ static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers) pr_err("bad flag-op %c, at start of %s\n", *str, str); return -EINVAL; } - v3pr_info("op='%c'\n", op); for (; *str ; ++str) { for (i = ARRAY_SIZE(opt_array) - 1; i >= 0; i--) { @@ -515,7 +511,6 @@ static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers) return -EINVAL; } } - v3pr_info("flags=0x%x\n", modifiers->flags); /* calculate final flags, mask based upon op */ switch (op) { @@ -531,7 +526,7 @@ static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers) modifiers->flags = 0; break; } - v3pr_info("*flagsp=0x%x *maskp=0x%x\n", modifiers->flags, modifiers->mask); + v3pr_info("op='%c' flags=0x%x maskp=0x%x\n", op, modifiers->flags, modifiers->mask); return 0; } @@ -541,7 +536,7 @@ static int ddebug_exec_query(char *query_string, const char *modname) struct flag_settings modifiers = {}; struct ddebug_query query = {}; #define MAXWORDS 9 - int nwords, nfound; + int nwords; char *words[MAXWORDS]; nwords = ddebug_tokenize(query_string, words, MAXWORDS); @@ -559,10 +554,7 @@ static int ddebug_exec_query(char *query_string, const char *modname) return -EINVAL; } /* actually go and implement the change */ - nfound = ddebug_change(&query, &modifiers); - vpr_info_dq(&query, nfound ? "applied" : "no-match"); - - return nfound; + return ddebug_change(&query, &modifiers); } /* handle multiple queries in query string, continue on error, return From patchwork Tue Jul 2 21:57:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C42AEC30658 for ; Tue, 2 Jul 2024 21:58:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 75F3110E6B5; Tue, 2 Jul 2024 21:58:28 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="QsgKdtk8"; dkim-atps=neutral Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 29C0310E6C7; Tue, 2 Jul 2024 21:58:27 +0000 (UTC) Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-7eee7728b00so189210939f.3; Tue, 02 Jul 2024 14:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957506; x=1720562306; darn=lists.freedesktop.org; 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=Kihqcq8gEwvlFuKQVqVa3kRjj6JIPweX7rDvgcIT9h8=; b=QsgKdtk8eHthjaezRk1OZ4nlF/ZY5sfcFHVQm+3GzDwpHCpF6tpoyS0hbHRkLRtjC2 N9fT+R/HOiIFejT6G70UPqI62TXAY73rrv98zggp2/qeCBWVRpn4FhU52LdxyCsfdDuI oCkMPqwRVpfodPV8nSI5sS+FxhkKm7k2d94Oq3mpgl2hjt77S5RO0STqhorr+FgKj9IY A3mjvlzAV7x0LcXoS3fSNKQbBwg5vdWUlnCMnHpirhmkVeOhe0B0vvgYJC1zmkvbsJEb /Q+OasM3qH+9/HF42J39Ig+XVyY/JAPorZV7sCrjA9nxDuBpe0dfzuBLdLlwERhUj1bb pj7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957506; x=1720562306; 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=Kihqcq8gEwvlFuKQVqVa3kRjj6JIPweX7rDvgcIT9h8=; b=YNS1YNVkJ6sF05RloGatJ1VCXJ/361Oe+nd/xOAX8zB1QVKGpzN+q+9+JcHZuiDEAB E1me0oSgS1wGQD6XDvBt2yl3qvVrnJ3FlseZ6Fb0kS4DLaWpMpENZFeTkGpjgtBdH0oQ 6VZS8u4bsrQcHFV7rmCGriQlPYleg1IyAbmSwXjmRzdC/0vhF6a+dzqIL8c1IOenSGkz n2IBEH1jvIu0ZIXc5PauY2wQVoNQ9t57FnFfvqq94xi7XAlHT5IUQ/sO6J+4yDMrmsie 9MTwuV4SJkE4JlAYEzJfKZ0YNDRkCnyAtWbwxn/Wy2T6l6KoDGNh2fhHid02/Dwir1g6 HZlQ== X-Forwarded-Encrypted: i=1; AJvYcCVrLLOUO88DVIZxIeQ0S/afauH4vcq7kl1uOhfxp/7kd5Ju8rlxAkmbLzCpSUSAIqFu3mfOR/rKDXhL+YDJ2nb6DDl71puuItGhWwcLrVtqDI804a+UmAd+EDSQyBpELRdobYZGxt0rtPy/Kmv2rXsXHK8I9kyJ9XBszW72CUKe4MTe1156vi+nEmW6f+MOi5i773yk8SA2rRrkfpvblAqiqqZfz2ukaj5HE3oH8w9M8Cx4toU= X-Gm-Message-State: AOJu0Yyzb1fERWkHZ4KMO1HLjjcvPtrYDxvGQFBxY5ip47PrYbkAwSVa XmhlTY2NXenp77lTsUe3a9g+pzOKLds26potnE8YOzifuUi8RzLbcBzIHQ== X-Google-Smtp-Source: AGHT+IF8hAhxFCTOhvSpcCx/i+r/frukj2a98ZVky9/KM97IGZV37TQytURYtKcRbWkLrVOQ3MdKcA== X-Received: by 2002:a05:6602:349:b0:7eb:cba1:b19e with SMTP id ca18e2360f4ac-7f62ee0d9b4mr1212668139f.8.1719957506351; Tue, 02 Jul 2024 14:58:26 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:25 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 10/52] dyndbg: silence debugs with no-change updates Date: Tue, 2 Jul 2024 15:57:00 -0600 Message-ID: <20240702215804.2201271-11-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In ddebug_apply_class_bitmap(), check for actual changes to the bits before announcing them, to declutter logs. no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 368381dbd266..8320cadeb251 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -595,7 +595,7 @@ static int ddebug_exec_queries(char *query, const char *modname) return nfound; } -/* apply a new bitmap to the sys-knob's current bit-state */ +/* apply a new class-param setting */ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, unsigned long *new_bits, unsigned long *old_bits, const char *query_modname) @@ -606,8 +606,9 @@ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, int matches = 0; int bi, ct; - v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, *old_bits, - query_modname ?: ""); + if (*new_bits != *old_bits) + v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, + *old_bits, query_modname ?: "'*'"); for (bi = 0; bi < map->length; bi++) { if (test_bit(bi, new_bits) == test_bit(bi, old_bits)) @@ -622,8 +623,9 @@ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, v2pr_info("bit_%d: %d matches on class: %s -> 0x%lx\n", bi, ct, map->class_names[bi], *new_bits); } - v2pr_info("applied bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, *old_bits, - query_modname ?: ""); + if (*new_bits != *old_bits) + v2pr_info("applied bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, + *old_bits, query_modname ?: "'*'"); return matches; } From patchwork Tue Jul 2 21:57:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720380 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9833FC31D97 for ; Tue, 2 Jul 2024 21:58:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 771C310E6CF; Tue, 2 Jul 2024 21:58:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="O0pkIUvy"; dkim-atps=neutral Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 52F1A10E6CD; Tue, 2 Jul 2024 21:58:28 +0000 (UTC) Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-7f3d59ff826so173089839f.3; Tue, 02 Jul 2024 14:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957507; x=1720562307; darn=lists.freedesktop.org; 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=3rzL7Ai7iKqeKJnszxdFQBmj3pbR9EFBsW0IKIFtNrQ=; b=O0pkIUvyKktYDDAnC7RG+r/06STxnyyNpKwKWJQyg2m8Qb5QLz4SLjN1azz+9y4N/6 urslR1Wf7SemydpktRfeCl+rW0H6DCPQqfh+BtdqCOmw+WuRpMKnWw/Pnj31Vv0l+zCR LmdLp6d1m93WK/YuHX5X5xFhi6jMv3tdUxe6NEDV60bR9cOhpVhWPvt1ck5Vs97NkTxv WGiAvHXve0+np7nSG/fXtC6r/Ynd3Joh2K+nbLqRPaXumVZ12Lj8qpVTrURJDlKCgcPW NYXTP3dp6oFePsSnz1lumdE4IUpzhB0bnN9IqzErkxF+O1ZANKxgzUwF91P4x7Vc0FN0 cOBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957507; x=1720562307; 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=3rzL7Ai7iKqeKJnszxdFQBmj3pbR9EFBsW0IKIFtNrQ=; b=KFWGoSBUZzenF5+GL8Zl0wzuanYFwpNOf3DIw4Ozam9fVUgAjnejFItuaMQZfIOKWw m+etRn2G0XINjQmMlzhwifMep99wu/YYxbaDNR5W/IkU4zkSmq0Bc5U+v54bO5xm+IqB ky+WAQVmmxv3Fd58W1l8HsbC4Vr9ypSE+gcCplQlLGMs938Qk/sWnHQEFOaLniSkyzYU 01WdJPYstspG0hFh7TQZ7B8Y8c8jObkPlkjSv/qIa5cMBnkWj5RmtrkKm1Jpbbg0WRt5 6bENc0dESVFTkcFFFTJOXl4QsddREOsVRPBBBJMYgwGDbrNbF46wZ+Xa6niHhIXGB4i4 6BEQ== X-Forwarded-Encrypted: i=1; AJvYcCXqBdZNLrR7QWT7KpVOyDWvxS8sDgG2feTBOlbq+Muap0MQpZWFhAf2Zr5t8DXxMTK9k8emBXJlmNdY6kihNkON+TMNqkTNeikmzbmhHWbYcckjfc9m0IGJz469QfXiaffqq4UElBTd2QJutm3rnfL/fA/cJKKgKJ6Kie5obf0tBWGJeiRlrH+FAQ1Qee3ySg9r0jo7Ctdjt0OYOmjp6YMHATSpxeD9IxtgFt/DBtlJhntcJ54= X-Gm-Message-State: AOJu0YwWN1K+7piiDP36y35re9NIvSqREZ/2jFZLX/eCJXBLqv4F8OZy gbYS8dYr15o5U8sTPRFkCejytMFwoNJq2/XvjNoqy+Wr4tECmKts X-Google-Smtp-Source: AGHT+IF56ls3w7f2WSNbJ8aXQHldMBv+gn+afom4mP2VlDrZdzOAf5MG5lr7DVKBeB+D9m7lbJ2S+w== X-Received: by 2002:a5d:840d:0:b0:7f3:d89c:601b with SMTP id ca18e2360f4ac-7f62ee54715mr1057898039f.5.1719957507558; Tue, 02 Jul 2024 14:58:27 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:26 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 11/52] dyndbg: tighten ddebug_class_name() 1st arg type Date: Tue, 2 Jul 2024 15:57:01 -0600 Message-ID: <20240702215804.2201271-12-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Change function's 1st arg-type, and deref in the caller. The fn doesn't need any other fields in the struct. no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 8320cadeb251..882354e1e78f 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1120,12 +1120,12 @@ static void *ddebug_proc_next(struct seq_file *m, void *p, loff_t *pos) #define class_in_range(class_id, map) \ (class_id >= map->base && class_id < map->base + map->length) -static const char *ddebug_class_name(struct ddebug_iter *iter, struct _ddebug *dp) +static const char *ddebug_class_name(struct ddebug_table *dt, struct _ddebug *dp) { - struct ddebug_class_map *map = iter->table->classes; - int i, nc = iter->table->num_classes; + struct ddebug_class_map *map = dt->classes; + int i; - for (i = 0; i < nc; i++, map++) + for (i = 0; i < dt->num_classes; i++, map++) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; @@ -1159,7 +1159,7 @@ static int ddebug_proc_show(struct seq_file *m, void *p) seq_puts(m, "\""); if (dp->class_id != _DPRINTK_CLASS_DFLT) { - class = ddebug_class_name(iter, dp); + class = ddebug_class_name(iter->table, dp); if (class) seq_printf(m, " class:%s", class); else From patchwork Tue Jul 2 21:57:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720381 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 76CCDC3065C for ; Tue, 2 Jul 2024 21:58:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2558510E6D3; Tue, 2 Jul 2024 21:58:30 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="B1GxIIA/"; dkim-atps=neutral Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 89C0A10E6D3; Tue, 2 Jul 2024 21:58:29 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7f3d59ff826so173090239f.3; Tue, 02 Jul 2024 14:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957509; x=1720562309; darn=lists.freedesktop.org; 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=LLqcnZIYyHoDNxKwcA/NtHztZqWZ7lBC267I9FzlvwU=; b=B1GxIIA/Xu31yHQI1/yr2maulKi1z752PZPkRNoozIrGW1I5e2nnymn1IVogXRhx9o CbM5AvOw/MLpbXxd42EkIQUG8ELRygZsmGvbBAR0Vfdxn3v71/VuzN5gC7YmZtVjtGiO L8ajMR5x9CU8sw9TjeUVxZfqX7EI8bWcCUQjBgeTda0GiCISqhcBmphmm8qDgahgt8B+ x4KLfN7zC4ivlM76MxDenzd+DQgxriljh0M7aC4M3gVWN++F4ts3982KTBPMbk/CvWje lmPY11AvY+fOOK9Um94HdZ65oNzdXjgdQic2EJjXojqxAUG7z4BnEmRIeU3Wf88bzBV7 PVfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957509; x=1720562309; 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=LLqcnZIYyHoDNxKwcA/NtHztZqWZ7lBC267I9FzlvwU=; b=q69cM7dYeZ1TmnbiwDw4xyrMFfyintsLdQYKxKp8K+NXaQiTAoS6MSN+JxGIrmgr7C Mryj6Z/5JpEtPeH5Fjz9KmpH3YDYRW4VcUCo8szNursT56CHQDEsgqKIvnT1JsEIsXVP p/G3IDvlRGyxghj8Ba0rJtmEM0ui1XP4+MFAZ6Ca5FcO2LNH+3tFlroeu+Q4qSy5r96U qQNCtTu7zL50l1hZQrZl8GBCeNdP7Wm3BchgTc41xrhBI19PvCDUi9SzIR8/Wcbi15q6 DpBRHZw8i2M/jZkQnjUjnzzeKhsROdqc0rftNSG55/E61wFIyDSpweLGPtyZX+qE9MO2 YvUw== X-Forwarded-Encrypted: i=1; AJvYcCU/otjWDULVb4qoShf0M8oHzuknyR3Zu1Cjn5/f6MyQ3RNmkbF/qrL7WOYEOGXpCP+TqzqSy+vP6KwXQVJB5YIheOGgzCOeYDXZDstudQknOyK56mZNKF/6eqEtOKyBZSd/AATWWhlpfgm3Q3e9RZ+uoNhZaeQoEmAOOQJpjvBOURCAKlMg9sSRYSciMN3CxPWGgoIuqhXRLWqnQ1Zb+zo8g9pf9Z1NkL8PMMFhknM5RrOiOSQ= X-Gm-Message-State: AOJu0Yzg96QHowiOK7nVmki8ubVOgGV30+FDSXG5CxI0U2B8RT/ymL2M ffPEKnr/AhpcP7xzaqmDjqIrvaqx1mHYFjG8UOp09gut3h2FAQVY X-Google-Smtp-Source: AGHT+IEGVNNIZc+H4xshZL2c97eLukzO+VTh9nx0u7xBoOYpjR9heRfhc2y94YMqLVUj1nsH5UD92Q== X-Received: by 2002:a5d:8455:0:b0:7f5:bd0c:b532 with SMTP id ca18e2360f4ac-7f62ed69020mr1001562739f.0.1719957508569; Tue, 02 Jul 2024 14:58:28 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:28 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 12/52] dyndbg: tighten fn-sig of ddebug_apply_class_bitmap Date: Tue, 2 Jul 2024 15:57:02 -0600 Message-ID: <20240702215804.2201271-13-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" old_bits arg is currently a pointer to the input bits, but this could allow inadvertent changes to the input by the fn. Disallow this. And constify new_bits while here. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 882354e1e78f..d4a0ae31d059 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -597,7 +597,8 @@ static int ddebug_exec_queries(char *query, const char *modname) /* apply a new class-param setting */ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, - unsigned long *new_bits, unsigned long *old_bits, + const unsigned long *new_bits, + const unsigned long old_bits, const char *query_modname) { #define QUERY_SIZE 128 @@ -606,12 +607,12 @@ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, int matches = 0; int bi, ct; - if (*new_bits != *old_bits) + if (*new_bits != old_bits) v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, - *old_bits, query_modname ?: "'*'"); + old_bits, query_modname ?: "'*'"); for (bi = 0; bi < map->length; bi++) { - if (test_bit(bi, new_bits) == test_bit(bi, old_bits)) + if (test_bit(bi, new_bits) == test_bit(bi, &old_bits)) continue; snprintf(query, QUERY_SIZE, "class %s %c%s", map->class_names[bi], @@ -623,9 +624,9 @@ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, v2pr_info("bit_%d: %d matches on class: %s -> 0x%lx\n", bi, ct, map->class_names[bi], *new_bits); } - if (*new_bits != *old_bits) + if (*new_bits != old_bits) v2pr_info("applied bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, - *old_bits, query_modname ?: "'*'"); + old_bits, query_modname ?: "'*'"); return matches; } @@ -681,7 +682,7 @@ static int param_set_dyndbg_classnames(const char *instr, const struct kernel_pa continue; } curr_bits ^= BIT(cls_id); - totct += ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits, NULL); + totct += ddebug_apply_class_bitmap(dcp, &curr_bits, *dcp->bits, NULL); *dcp->bits = curr_bits; v2pr_info("%s: changed bit %d:%s\n", KP_NAME(kp), cls_id, map->class_names[cls_id]); @@ -691,7 +692,7 @@ static int param_set_dyndbg_classnames(const char *instr, const struct kernel_pa old_bits = CLASSMAP_BITMASK(*dcp->lvl); curr_bits = CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); - totct += ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits, NULL); + totct += ddebug_apply_class_bitmap(dcp, &curr_bits, old_bits, NULL); *dcp->lvl = (cls_id + (wanted ? 1 : 0)); v2pr_info("%s: changed bit-%d: \"%s\" %lx->%lx\n", KP_NAME(kp), cls_id, map->class_names[cls_id], old_bits, curr_bits); @@ -745,7 +746,7 @@ static int param_set_dyndbg_module_classes(const char *instr, inrep &= CLASSMAP_BITMASK(map->length); } v2pr_info("bits:0x%lx > %s.%s\n", inrep, modnm ?: "*", KP_NAME(kp)); - totct += ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, modnm); + totct += ddebug_apply_class_bitmap(dcp, &inrep, *dcp->bits, modnm); *dcp->bits = inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -758,7 +759,7 @@ static int param_set_dyndbg_module_classes(const char *instr, old_bits = CLASSMAP_BITMASK(*dcp->lvl); new_bits = CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); - totct += ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, modnm); + totct += ddebug_apply_class_bitmap(dcp, &new_bits, old_bits, modnm); *dcp->lvl = inrep; break; default: From patchwork Tue Jul 2 21:57:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 469E9C31D97 for ; Tue, 2 Jul 2024 21:58:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A992510E6CD; Tue, 2 Jul 2024 21:58:33 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UoY8XI4+"; dkim-atps=neutral Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) by gabe.freedesktop.org (Postfix) with ESMTPS id B02EA10E6CA; Tue, 2 Jul 2024 21:58:30 +0000 (UTC) Received: by mail-il1-f170.google.com with SMTP id e9e14a558f8ab-376266a65c8so19416475ab.3; Tue, 02 Jul 2024 14:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957510; x=1720562310; darn=lists.freedesktop.org; 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=PG0HixeKNGYC1yKqg8pO4K0aUEEvqiNOUzi5OjavD2Q=; b=UoY8XI4+bZBTT8F9Qr9kl+0rmdwynNbF3gGYnxasfUu1ZDD5kNpRDE1chNv5twH/Cy u6tR/6ViT+2Ybz80HAaR4uBaeK8nTHU72XOxpKeC1+/pa3aD0O126H6ahpHTMT7ao+WN Tc16T/504/HXNwULLfqi2KzjUI3tSzN+FbxCkV39iuBzrFi3UxZEjw8aqBXiMGs1xN99 J8dZeG89TctsmDuGzt1pyGKNYd7Px+JPDqyrSutQl9/jPFV/osb+cXp2CdoKk3cJZzeR DuvC1bxo5acqxShWUV3bDw/TnsLxy+McoezWrSyheYKQOY0gy4vpODytg8pjDZ0xfBai hYoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957510; x=1720562310; 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=PG0HixeKNGYC1yKqg8pO4K0aUEEvqiNOUzi5OjavD2Q=; b=A72gaUj12TsseLAjAL3icZ1Nuc4l730LolCFYPevkmw0VGHyC5GQjoZJVctYA6wvcm CPRrlh8/QZnJ0iAXOJfoP7L+8abwNn9UAvr4mYMtCVoYK3GoooBHt0lN+Wemx7c/R5QC H7iytrFN4rqFdCf9wHs3FUEx+YcCF8O707vy3/bgv82ljLJ2El/0WLAVkaophioheLmF qYiVYs5HS8rwh/09R7F+y+SfFiguHu8YXyzH8vtt0waeQyEOq2lEUyZb7O8RtOpD2WNK lzaexpQfYDmfo7glVuL7atmQyrYjYII4EpAtqAmDmWyJrYmxs2jd7GgOo9Rqy0cN/cZB GSHQ== X-Forwarded-Encrypted: i=1; AJvYcCV/EW9jXamk9jd/mqmOagLB7jJbn4uxjYXhPDkfLZUj/1jSQCnwmVKX4aVEGsV650Dmnru6nFSK/+WrlBUyk12c/iHWb/V6C9JRPIW1AWJNbrL9gCHPxpYMInC92ykXysyBg/wQ/C+ksrxAaHsIyU/PAMDMba2zupRboBUNRdQ+jHV+IebuAKh8sNxhM5S1Nw17IZfnFbkTElWjdL/xMcWcrhHYoNJ6KF1ICvTTHkqWm9HDqoM= X-Gm-Message-State: AOJu0YxYBA9n2IgUHMXMQbU1c6nq/CTinN3YcCXkwykG0YPQTTDd2bLm HOnGGhW3nh5Y6/T3+FgYwHYDu+1kyKUuUTfncFfUE0CiRIdIUDsl X-Google-Smtp-Source: AGHT+IHFxJvBXIHq5LZcv20uJ1NKUAM88ZngYdPTVnyFhFGhwG7OwIeFbtlBvY1gNg2J1W/h7jPgdQ== X-Received: by 2002:a05:6602:2be1:b0:7f6:1b3a:437b with SMTP id ca18e2360f4ac-7f62ee79e9emr1172631339f.17.1719957509908; Tue, 02 Jul 2024 14:58:29 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:29 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 13/52] dyndbg: reduce verbose=3 messages in ddebug_add_module Date: Tue, 2 Jul 2024 15:57:03 -0600 Message-ID: <20240702215804.2201271-14-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" When modprobing a module, dyndbg currently logs/says "add-module", and then "skipping" if the module has no prdbgs. Instead just check 1st and return quietly. no functional change Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index d4a0ae31d059..43a8e04b8599 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1245,11 +1245,10 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) { struct ddebug_table *dt; - v3pr_info("add-module: %s.%d sites\n", modname, di->num_descs); - if (!di->num_descs) { - v3pr_info(" skip %s\n", modname); + if (!di->num_descs) return 0; - } + + v3pr_info("add-module: %s %d sites\n", modname, di->num_descs); dt = kzalloc(sizeof(*dt), GFP_KERNEL); if (dt == NULL) { From patchwork Tue Jul 2 21:57:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720382 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 92F32C30658 for ; Tue, 2 Jul 2024 21:58:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0AD9110E6C8; Tue, 2 Jul 2024 21:58:33 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="R4goZQX7"; dkim-atps=neutral Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id F2E1D10E6D0; Tue, 2 Jul 2024 21:58:31 +0000 (UTC) Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-7f65a32a58fso21854539f.1; Tue, 02 Jul 2024 14:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957511; x=1720562311; darn=lists.freedesktop.org; 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=J1gI7qbjco2HRqZ8ZV0ffH9ED0+rFoWzKWM8P+jI2qo=; b=R4goZQX7LZghrAzP4njPMeJFs90pJEXUGd2BeiNukMURi3mo3c6yq9TA0e4LgilmOO +HjXNHvdMyP6XcC2Df5DeENxA8M9BEo51umU+4U6aphszfBZI3U0Di9Tou99lOmGodAR K2Dw3ceplWsvx3eYgLKtPiHFlOFggYRzVGp9XHkd2++XDsen7RAI3/WzSgNA8FXvVwRn zNRCXGqHwuib9/RZtsH0M4X1LC9NpE4PtbpmE0h5Wz353jTbA+Yd0UQ9mVyZ9gzfsgfx sWln1SwY0THGVXRE9GDZDOp0n++E5ueg3DF3PfJXIiPezor0ApRwLeXO9trAVbEX99uX N1qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957511; x=1720562311; 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=J1gI7qbjco2HRqZ8ZV0ffH9ED0+rFoWzKWM8P+jI2qo=; b=P0wHVM22Vqf97r9OoyMjkiaOpuPZKsxJjfA8G4Yp/3jrW1Pi0q0lAtVX8SNDmA9axf 9yT26jW9Cuc1Gpq+G9XorXuOYubKs5hN1b2rY9/wloRghOKprg4ahEOduSMZjYvY4FwF hOzJlZ+QNBUUoPSaczmA89ZiyoLldTswOvkv4PyJBtVRml3VjwVsJl7Fhi5Su/mUeUR+ mI+kThpD908MMPWGTHhB93Qq4eOAy/ER9kXZKaiPOs8N9ojwYMTRY7lQU30yc8I5blsa OmpMFRmczrsW/PmUjZ3hP7sp+syeku2toHdSVtVtUwsXXm+3Z8M/BpIdrFrLF8YNkZGp PW/g== X-Forwarded-Encrypted: i=1; AJvYcCUgaA+y7HruZ7KfvuFQSNki/uinDx6hUA0+dGEGqwE58oNaD0rwmJXV+8KTcBBHI5QlCz76GySITIrUfWKKhDG4cR+uamR5skQ4VS/+VwA0TPihwvTEol6PmBk6Lzlqxvc9YnLyrH3vbjpdawmWSOO/vjMN15ZOfhygXKGHCXFeAh9IYpZuRcWTFjdFeuHZwHzsQlj4O6iQf0yysy6DLZo8vYMrgqea9FGMPzANHi1uGWsJwOY= X-Gm-Message-State: AOJu0Yx84XYXx9Opq6fMYQypACak6uvwZFZyZTXl4dDHVj9x92YdchuI XLgzvblqWWpDWFwz/hEzHlsTg8egEluW+8U0iWlbz+x2NmJKOLzT X-Google-Smtp-Source: AGHT+IFQTY3k1juHbCCDKTSISOGes+jEb4muHARPPIzMJ17rPyweK6Ni9b6oleGGUS/Q+0AyDyIW7w== X-Received: by 2002:a05:6602:600d:b0:7f6:5035:1826 with SMTP id ca18e2360f4ac-7f650351c42mr444680339f.11.1719957510990; Tue, 02 Jul 2024 14:58:30 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:30 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 14/52] dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code Date: Tue, 2 Jul 2024 15:57:04 -0600 Message-ID: <20240702215804.2201271-15-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Remove the NAMED class types; these 2 classmap types accept class names at the PARAM interface, for example: echo +DRM_UT_CORE,-DRM_UT_KMS > /sys/module/drm/parameters/debug_names The code works, but its only used by test-dynamic-debug, and wasn't asked for by anyone else, so reduce test-surface, simplify things. also rename enum class_map_type to enum ddebug_class_map_type. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 23 ++------ lib/dynamic_debug.c | 102 +++------------------------------- lib/test_dynamic_debug.c | 26 --------- 3 files changed, 14 insertions(+), 137 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 8116d0a0d33a..dd304e231f08 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -58,27 +58,16 @@ struct _ddebug { #endif } __attribute__((aligned(8))); -enum class_map_type { +enum ddebug_class_map_type { DD_CLASS_TYPE_DISJOINT_BITS, /** - * DD_CLASS_TYPE_DISJOINT_BITS: classes are independent, one per bit. - * expecting hex input. Built for drm.debug, basis for other types. + * DD_CLASS_TYPE_DISJOINT_BITS: classes are independent, mapped to bits[0..N]. + * Expects hex input. Built for drm.debug, basis for other types. */ DD_CLASS_TYPE_LEVEL_NUM, /** - * DD_CLASS_TYPE_LEVEL_NUM: input is numeric level, 0-N. - * N turns on just bits N-1 .. 0, so N=0 turns all bits off. - */ - DD_CLASS_TYPE_DISJOINT_NAMES, - /** - * DD_CLASS_TYPE_DISJOINT_NAMES: input is a CSV of [+-]CLASS_NAMES, - * classes are independent, like _DISJOINT_BITS. - */ - DD_CLASS_TYPE_LEVEL_NAMES, - /** - * DD_CLASS_TYPE_LEVEL_NAMES: input is a CSV of [+-]CLASS_NAMES, - * intended for names like: INFO,DEBUG,TRACE, with a module prefix - * avoid EMERG,ALERT,CRIT,ERR,WARNING: they're not debug + * DD_CLASS_TYPE_LEVEL_NUM: input is numeric level, 0..N. + * Input N turns on bits 0..N-1 */ }; @@ -88,7 +77,7 @@ struct ddebug_class_map { const char **class_names; const int length; const int base; /* index of 1st .class_id, allows split/shared space */ - enum class_map_type map_type; + enum ddebug_class_map_type map_type; }; /** diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 43a8e04b8599..d5701207febc 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -636,76 +636,6 @@ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, #define CLASSMAP_BITMASK(width) ((1UL << (width)) - 1) -/* accept comma-separated-list of [+-] classnames */ -static int param_set_dyndbg_classnames(const char *instr, const struct kernel_param *kp) -{ - const struct ddebug_class_param *dcp = kp->arg; - const struct ddebug_class_map *map = dcp->map; - unsigned long curr_bits, old_bits; - char *cl_str, *p, *tmp; - int cls_id, totct = 0; - bool wanted; - - cl_str = tmp = kstrdup_and_replace(instr, '\n', '\0', GFP_KERNEL); - if (!tmp) - return -ENOMEM; - - /* start with previously set state-bits, then modify */ - curr_bits = old_bits = *dcp->bits; - vpr_info("\"%s\" > %s:0x%lx\n", cl_str, KP_NAME(kp), curr_bits); - - for (; cl_str; cl_str = p) { - p = strchr(cl_str, ','); - if (p) - *p++ = '\0'; - - if (*cl_str == '-') { - wanted = false; - cl_str++; - } else { - wanted = true; - if (*cl_str == '+') - cl_str++; - } - cls_id = match_string(map->class_names, map->length, cl_str); - if (cls_id < 0) { - pr_err("%s unknown to %s\n", cl_str, KP_NAME(kp)); - continue; - } - - /* have one or more valid class_ids of one *_NAMES type */ - switch (map->map_type) { - case DD_CLASS_TYPE_DISJOINT_NAMES: - /* the +/- pertains to a single bit */ - if (test_bit(cls_id, &curr_bits) == wanted) { - v3pr_info("no change on %s\n", cl_str); - continue; - } - curr_bits ^= BIT(cls_id); - totct += ddebug_apply_class_bitmap(dcp, &curr_bits, *dcp->bits, NULL); - *dcp->bits = curr_bits; - v2pr_info("%s: changed bit %d:%s\n", KP_NAME(kp), cls_id, - map->class_names[cls_id]); - break; - case DD_CLASS_TYPE_LEVEL_NAMES: - /* cls_id = N in 0..max. wanted +/- determines N or N-1 */ - old_bits = CLASSMAP_BITMASK(*dcp->lvl); - curr_bits = CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); - - totct += ddebug_apply_class_bitmap(dcp, &curr_bits, old_bits, NULL); - *dcp->lvl = (cls_id + (wanted ? 1 : 0)); - v2pr_info("%s: changed bit-%d: \"%s\" %lx->%lx\n", KP_NAME(kp), cls_id, - map->class_names[cls_id], old_bits, curr_bits); - break; - default: - pr_err("illegal map-type value %d\n", map->map_type); - } - } - kfree(tmp); - vpr_info("total matches: %d\n", totct); - return 0; -} - static int param_set_dyndbg_module_classes(const char *instr, const struct kernel_param *kp, const char *modnm) @@ -714,29 +644,17 @@ static int param_set_dyndbg_module_classes(const char *instr, const struct ddebug_class_map *map = dcp->map; unsigned long inrep, new_bits, old_bits; int rc, totct = 0; - - switch (map->map_type) { - - case DD_CLASS_TYPE_DISJOINT_NAMES: - case DD_CLASS_TYPE_LEVEL_NAMES: - /* handle [+-]classnames list separately, we are done here */ - return param_set_dyndbg_classnames(instr, kp); - - case DD_CLASS_TYPE_DISJOINT_BITS: - case DD_CLASS_TYPE_LEVEL_NUM: - /* numeric input, accept and fall-thru */ - rc = kstrtoul(instr, 0, &inrep); - if (rc) { - pr_err("expecting numeric input: %s > %s\n", instr, KP_NAME(kp)); - return -EINVAL; - } - break; - default: - pr_err("%s: bad map type: %d\n", KP_NAME(kp), map->map_type); + char *nl; + + rc = kstrtoul(instr, 0, &inrep); + if (rc) { + nl = strchr(instr, '\n'); + if (nl) + *nl = '\0'; + pr_err("expecting numeric input, not: %s > %s\n", instr, KP_NAME(kp)); return -EINVAL; } - /* only _BITS,_NUM (numeric) map-types get here */ switch (map->map_type) { case DD_CLASS_TYPE_DISJOINT_BITS: /* expect bits. mask and warn if too many */ @@ -801,12 +719,8 @@ int param_get_dyndbg_classes(char *buffer, const struct kernel_param *kp) const struct ddebug_class_map *map = dcp->map; switch (map->map_type) { - - case DD_CLASS_TYPE_DISJOINT_NAMES: case DD_CLASS_TYPE_DISJOINT_BITS: return scnprintf(buffer, PAGE_SIZE, "0x%lx\n", *dcp->bits); - - case DD_CLASS_TYPE_LEVEL_NAMES: case DD_CLASS_TYPE_LEVEL_NUM: return scnprintf(buffer, PAGE_SIZE, "%ld\n", *dcp->lvl); default: diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index a01f0193a419..9e950a911b6c 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -74,13 +74,6 @@ DECLARE_DYNDBG_CLASSMAP(map_disjoint_bits, DD_CLASS_TYPE_DISJOINT_BITS, 0, DD_SYS_WRAP(disjoint_bits, p); DD_SYS_WRAP(disjoint_bits, T); -/* symbolic input, independent bits */ -enum cat_disjoint_names { LOW = 10, MID, HI }; -DECLARE_DYNDBG_CLASSMAP(map_disjoint_names, DD_CLASS_TYPE_DISJOINT_NAMES, 10, - "LOW", "MID", "HI"); -DD_SYS_WRAP(disjoint_names, p); -DD_SYS_WRAP(disjoint_names, T); - /* numeric verbosity, V2 > V1 related */ enum cat_level_num { V0 = 14, V1, V2, V3, V4, V5, V6, V7 }; DECLARE_DYNDBG_CLASSMAP(map_level_num, DD_CLASS_TYPE_LEVEL_NUM, 14, @@ -88,13 +81,6 @@ DECLARE_DYNDBG_CLASSMAP(map_level_num, DD_CLASS_TYPE_LEVEL_NUM, 14, DD_SYS_WRAP(level_num, p); DD_SYS_WRAP(level_num, T); -/* symbolic verbosity */ -enum cat_level_names { L0 = 22, L1, L2, L3, L4, L5, L6, L7 }; -DECLARE_DYNDBG_CLASSMAP(map_level_names, DD_CLASS_TYPE_LEVEL_NAMES, 22, - "L0", "L1", "L2", "L3", "L4", "L5", "L6", "L7"); -DD_SYS_WRAP(level_names, p); -DD_SYS_WRAP(level_names, T); - /* stand-in for all pr_debug etc */ #define prdbg(SYM) __pr_debug_cls(SYM, #SYM " msg\n") @@ -102,10 +88,6 @@ static void do_cats(void) { pr_debug("doing categories\n"); - prdbg(LOW); - prdbg(MID); - prdbg(HI); - prdbg(D2_CORE); prdbg(D2_DRIVER); prdbg(D2_KMS); @@ -129,14 +111,6 @@ static void do_levels(void) prdbg(V5); prdbg(V6); prdbg(V7); - - prdbg(L1); - prdbg(L2); - prdbg(L3); - prdbg(L4); - prdbg(L5); - prdbg(L6); - prdbg(L7); } static void do_prints(void) From patchwork Tue Jul 2 21:57:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720384 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 651A5C30658 for ; Tue, 2 Jul 2024 21:58:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D339410E6CB; Tue, 2 Jul 2024 21:58:35 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jzRsNJDd"; dkim-atps=neutral Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id B0F9210E6D5; Tue, 2 Jul 2024 21:58:33 +0000 (UTC) Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-7f61549406eso180459539f.1; Tue, 02 Jul 2024 14:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957513; x=1720562313; darn=lists.freedesktop.org; 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=+nJakz52Sv/CtSZEYJn6GwOFm1g7btzQOY0AED19SRE=; b=jzRsNJDdhABcKcYITSkae3Kf/UKQxVamYC3w6+5uecmSXxC2OJ+xmsQ2fGwpEGkPTT OHnGSnRi9IJio0+5+YVkTN4wfgZBBmlyCXkLwuMvMGNhHcdN0W8O46wD7fUXj7FWn1cL SN2FDpMAB59qtO1+TQ3t292MC7ssQrXHk/1DwC/Vqdb9W9TU7bgNqnVvIIscWFX15Etz cVIi9n5qF7RndstvSO3Y/YeCHikk+IOUYHBI+cm9t/eMuoX3e8Dv4Uy5GJxm31avkD0h Cl1z2ZyOAPF8rPHnt5mevSQ6NzG/vmdsUJL4Q/NlDVTeSl/6CCpnzG9l7IfNtgbf22qv fXdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957513; x=1720562313; 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=+nJakz52Sv/CtSZEYJn6GwOFm1g7btzQOY0AED19SRE=; b=SobBEsJvk2KMaApT1T1jIdwxu6YGdyulcBURUacTnpDeHok8hcMrMoRf70bIXEIkMw my7Azz0CH3z8TC5+RShKHAXt35lcZcAiKHkeQcNL6timIpVp77P+IXPI9P2/7CviLSOX 8/tJMZFTnQEMsbUoWKOOLrkFYZxGA/I0wyWb13oSDIIJcN/cUTkIgwyc8eORz/mWEyl6 V9/BztcRVMsq71+XZPRLOAHVqaBvs+V/1ZuEyg9y+r4JfTvoOmKsgS3bp3URXz3t7H76 esTbIIWtT8Cn+OFBcApbzI6co1ZGVA6jvkEP+LZBFSjjBNBX5CmiB1Z9MZlwzivatakr bbng== X-Forwarded-Encrypted: i=1; AJvYcCXGZCBD+YZNaIFACBiAQeMWYq0qGHeYTrD7fPxbHDXbJjme+tKEDtDZoS2NdwkmTBLU1btFLy5rFQylOSucxM8rNs6ecgZhYZ4ZEyL7vpI8x2Mi3eNU/eKCTKyWg/f1JW5xPXQRstxewYSyGPh5Ss8aBYzqQcCKv6UmWKpqb+C5VY7c/seDYKK1VsWxeHEKwQVmLP6IBG0hXx7XxxEiE7HTRIq4L/7wlqBgu4moqSzyHjq3Lzw= X-Gm-Message-State: AOJu0YyvCsa6gLoYvg/DkUZ/D8eEpr8Bjzs+XRUtkr3OXnnvhnPNZHTT +/KvuDFnRQ80X12XJV5ej0STXgPWVlMYbHIIqELcec3rYSX63AZd X-Google-Smtp-Source: AGHT+IEuZy8Vgv5b+bOzfhyaySOnrkgTu3wLlzeOEen4503I5cIUNiME/kSyynp7tQIoWK1m30ED8g== X-Received: by 2002:a6b:dd12:0:b0:7f6:1ec3:a107 with SMTP id ca18e2360f4ac-7f62ee7a0d7mr1187913439f.18.1719957512586; Tue, 02 Jul 2024 14:58:32 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:31 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 15/52] dyndbg-API: fix DECLARE_DYNDBG_CLASSMAP Date: Tue, 2 Jul 2024 15:57:05 -0600 Message-ID: <20240702215804.2201271-16-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" DECLARE_DYNDBG_CLASSMAP() has a design error; its usage fails a basic K&R rule: "define once, refer many times". It is used across DRM core & drivers, each use re-defines the classmap understood by that module; and all must match for the modules to respond together when DRM.debug categories are enabled. This is brittle; a maintenance foot-gun. Worse, it causes the CONFIG_DRM_USE_DYNAMIC_DEBUG=Y regression; 1st drm.ko loads, and dyndbg initializes its DRM.debug callsites, then a drm-driver loads, but too late - it missed the DRM.debug enablement. So replace it with 2 macros: DYNDBG_CLASSMAP_DEFINE - invoked once from core - drm.ko DYNDBG_CLASSMAP_USE - from all drm drivers and helpers. DYNDBG_CLASSMAP_DEFINE: it reuses a renamed DECLARE_DYNDBG_CLASSMAP to construct the struct classmap variable, but it drops the static qualifier, and exports it instead. DYNDBG_CLASSMAP_USE: then refers to the exported var by name: * used from drivers, helper-mods * lets us drop the repetitive "classname" args * fixes 2nd-defn problem * creates a ddebug_class_user record in new __dyndbg_class_users section this allows ddebug_add_module(etal) to handle them per-module. DECLARE_DYNDBG_CLASSMAP is preserved temporarily, to decouple DRM adaptation work and avoid compile-errs before its done. IOW, DRM gets fixed when they commit the adopt-new-api patches. The DEFINE,USE distinction, and the separate classmap-use record, allows dyndbg to initialize the driver's & helper's DRM.debug callsites separately after each is modprobed. Basically, the classmap init-scan repeated for classmap-users. To review, dyndbg's existing __dyndbg_classes[] section does: . catalogs the classmaps defined by a module (or builtin modules) . tells dyndbg the module has class'd prdbgs, allowing >control . DYNDBG_CLASSMAP_DEFINE creates classmaps in this section. This patch adds __dyndbg_class_users[] section: . catalogs uses/references to the classmap definitions. . authorizes dyndbg to >control those class'd prdbgs in ref'g module. . DYNDBG_CLASSMAP_USE() creates classmap-user records in this new section. Now ddebug_add_module(etal) can handle classmap-uses similar to (and after) classmaps; when a dependent module is loaded, if it has classmap-uses (to a classmap-def in another module), that module's kernel params are scanned to find if it has a kparam that is wired to dyndbg's param-ops, and whose classmap is the one being ref'd. To support this, theres a few data/header changes: new struct ddebug_class_user contains: user-module-name, &classmap-defn it records drm-driver's use of a classmap in the section, allowing lookup struct ddebug_info gets 2 more fields to keep the new section with the others: class_users, num_class_users. set by dynamic_debug_init() for builtins. or by kernel/module/main:load_info() for loadable modules. vmlinux.lds.h: new BOUNDED_SECTION for __dyndbg_class_users dynamic_debug.c has 2 changes in ddebug_add_module(), ddebug_change(): ddebug_add_module() already calls ddebug_attach_module_classes() to handle classmaps DEFINEd by a module, now it also calls ddebug_attach_user_module_classes() to handle USEd classmaps. To avoid this work when possible, 1st scan the module's descriptors and count the number of class'd pr_debugs. ddebug_attach_user_module_classes() scans the module's class_users section, follows the refs to the parent's classmap, and calls ddebug_apply_params() on each. It also avoids work by checking the module's class-ct. ddebug_apply_params(new fn): It scans module's/builtin kernel-params, calls ddebug_match_apply_kparam for each to find the params/sysfs-nodes which may be wired to a classmap. ddebug_match_apply_kparam(new fn): 1st, it tests the kernel-param.ops is dyndbg's; this guarantees that the attached arg is a struct ddebug_class_param, which has a ref to the param's state, and to the classmap defining the param's handling. 2nd, it requires that the classmap ref'd by the kparam is the one we're called for; modules can use many separate classmaps (as test_dynamic_debug does). Then apply the "parent" kparam's setting to the dependent module, using ddebug_apply_class_bitmap(). ddebug_change(and callees) also gets adjustments: ddebug_find_valid_class(): This does a search over the module's classmaps, looking for the class FOO echo'd to >control. So now it searches over __dyndbg_class_users[] after __dyndbg_classes[]. ddebug_class_name(): return class-names for defined AND used classes. test_dynamic_debug.c, test_dynamic_debug_submod.c: This demonstrates the 2 types of classmaps & sysfs-params, following the 4-part recipe: 1. define an enum for the classmap: DRM.debug has DRM_UT_{CORE,KMS,...} multiple classes must share 0-62 classid space. 2. DYNDBG_CLASSMAP_DEFINE(.. DRM_UT_{CORE,KMS,...}) 3. DYNDBG_CLASSMAP_PARAM* (classmap) 4. DYNDBG_CLASSMAP_USE() by _submod only, skipping 2,3 Move all the enum declarations together, to better explain how they share the 0..62 class-id space available to a module (non-overlapping subranges). reorg macros 2,3 by name. This gives a tabular format, making it easy to see the pattern of repetition, and the points of change. And extend the test to replicate the 2-module (parent & dependent) scenario which caused the CONFIG_DRM_USE_DYNAMIC_DEBUG=y regression seen in drm & drivers. The _submod.c is a 2-line file: #define _SUBMOD, #include parent. This gives identical complements of prdbgs in parent & _submod, and thus identical print behavior when all of: >control, >params, and parent->_submod propagation are working correctly. It also puts all the parent/_submod declarations together in the same source, with the new ifdef _SUBMOD block invoking DYNDBG_CLASSMAP_USE for the 2 test-interfaces. I think this is clearer. These 2 modules are both tristate, allowing 3 super/sub combos: Y/Y, Y/M, M/M (not N/N). Y/Y testing exposed a missing __align(8) in the _METADATA macro, which M/M didn't see because the module-loader memory placement constrains it instead. DEBUG details: ``#define DEBUG`` in src enables all pr_debugs after it, including any class'd pr_debugs; its not necessarily all-or-nothing, unless you do the define in a header. Also, the only way to disable a class'd pr_debug is via the classmap-kparam or using "class foo" in control queries, to address the classes by name. NB: this patch ignores a checkpatch do-while warning; which is wrong for declarative macros like these: arch/powerpc/platforms/cell/spu_base.c 48:static DEFINE_SPINLOCK(spu_lock); 62:static DEFINE_SPINLOCK(spu_full_list_lock); 63:static DEFINE_MUTEX(spu_full_list_mutex); Fixes: aad0214f3026 ("dyndbg: add DECLARE_DYNDBG_CLASSMAP macro") Signed-off-by: Jim Cromie --- v8 - split drm parts to separate commits. preserve DECLARE_DYNDBG_CLASSMAP to decouple DRM, no flag day. fixup block comment v7 - previous submission-blocking bug: missing __align(8) in DYNAMIC_DEBUG_DECLARE_METADATA on ddebug_class_user caused corrupt records, but only for builtin modules; module loader code probably pinned allocations to the right alignment naturally, hiding the bug for typical builds. v6- get rid of WARN_ON_ONCE v?- fix _var expanded 2x in macro --- MAINTAINERS | 2 +- include/asm-generic/vmlinux.lds.h | 1 + include/linux/dynamic_debug.h | 62 ++++++++-- kernel/module/main.c | 3 + lib/Kconfig.debug | 24 +++- lib/Makefile | 3 + lib/dynamic_debug.c | 184 ++++++++++++++++++++++++++---- lib/test_dynamic_debug.c | 111 ++++++++++++------ lib/test_dynamic_debug_submod.c | 10 ++ 9 files changed, 332 insertions(+), 68 deletions(-) create mode 100644 lib/test_dynamic_debug_submod.c diff --git a/MAINTAINERS b/MAINTAINERS index 28e20975c26f..c9ed48109ff5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7526,7 +7526,7 @@ M: Jim Cromie S: Maintained F: include/linux/dynamic_debug.h F: lib/dynamic_debug.c -F: lib/test_dynamic_debug.c +F: lib/test_dynamic_debug*.c DYNAMIC INTERRUPT MODERATION M: Tal Gilboa diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index f7749d0f2562..f1d8e64b244c 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -365,6 +365,7 @@ /* implement dynamic printk debug */ \ . = ALIGN(8); \ BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) \ + BOUNDED_SECTION_BY(__dyndbg_class_users, ___dyndbg_class_users) \ BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \ LIKELY_PROFILE() \ BRANCH_PROFILE() \ diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index dd304e231f08..2c6944c0d6cd 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -72,8 +72,8 @@ enum ddebug_class_map_type { }; struct ddebug_class_map { - struct module *mod; - const char *mod_name; /* needed for builtins */ + const struct module *mod; /* NULL for builtins */ + const char *mod_name; const char **class_names; const int length; const int base; /* index of 1st .class_id, allows split/shared space */ @@ -81,11 +81,34 @@ struct ddebug_class_map { }; /** - * DECLARE_DYNDBG_CLASSMAP - declare classnames known by a module - * @_var: a struct ddebug_class_map, passed to module_param_cb - * @_type: enum class_map_type, chooses bits/verbose, numeric/symbolic - * @_base: offset of 1st class-name. splits .class_id space - * @classes: class-names used to control class'd prdbgs + * DYNDBG_CLASSMAP_DEFINE - define a set of debug-classes used by a module. + * @_var: name of the classmap, exported for other modules coordinated use. + * @_type: enum ddebug_class_map_type, chooses bits/verbose, numeric/names. + * @_base: offset of 1st class-name, used to share 0..62 classid space + * @classes: vals are stringified enum-vals, like DRM_UT_* + * + * Defines and exports a struct ddebug_class_map whose @classes are + * used to validate a "class FOO .." >control command on the module + */ +#define __DYNDBG_CLASSMAP_DEFINE(_var, _maptype, _base, ...) \ + const char *_var##_classnames[] = { __VA_ARGS__ }; \ + struct ddebug_class_map __aligned(8) __used \ + __section("__dyndbg_classes") _var = { \ + .mod = THIS_MODULE, \ + .mod_name = KBUILD_MODNAME, \ + .base = _base, \ + .map_type = _maptype, \ + .length = ARRAY_SIZE(_var##_classnames), \ + .class_names = _var##_classnames, \ + } +#define DYNDBG_CLASSMAP_DEFINE(_var, ...) \ + __DYNDBG_CLASSMAP_DEFINE(_var, __VA_ARGS__); \ + EXPORT_SYMBOL(_var) + +/* + * XXX: keep this until DRM adapts to use the DEFINE/USE api, it + * differs from __DYNDBG_CLASSMAP_DEFINE only in the static on the + * struct decl. */ #define DECLARE_DYNDBG_CLASSMAP(_var, _maptype, _base, ...) \ static const char *_var##_classnames[] = { __VA_ARGS__ }; \ @@ -99,12 +122,37 @@ struct ddebug_class_map { .class_names = _var##_classnames, \ } +struct ddebug_class_user { + char *user_mod_name; + struct ddebug_class_map *map; +}; + +/** + * DYNDBG_CLASSMAP_USE - refer to a classmap, DEFINEd elsewhere. + * @_var: name of the exported classmap var + * + * This registers a module's use of another module's classmap defn, so + * dyndbg can authorize "class DRM_CORE ..." >control commands upon + * this module. + */ +#define DYNDBG_CLASSMAP_USE(_var) \ + DYNDBG_CLASSMAP_USE_(_var, __UNIQUE_ID(ddebug_class_user)) +#define DYNDBG_CLASSMAP_USE_(_var, _uname) \ + extern struct ddebug_class_map _var; \ + static struct ddebug_class_user __aligned(8) __used \ + __section("__dyndbg_class_users") _uname = { \ + .user_mod_name = KBUILD_MODNAME, \ + .map = &(_var), \ + } + /* encapsulate linker provided built-in (or module) dyndbg data */ struct _ddebug_info { struct _ddebug *descs; struct ddebug_class_map *classes; + struct ddebug_class_user *class_users; unsigned int num_descs; unsigned int num_classes; + unsigned int num_class_users; }; struct ddebug_class_param { diff --git a/kernel/module/main.c b/kernel/module/main.c index e1e8a7a9d6c1..9f7ce0f0e6e5 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2217,6 +2217,9 @@ static int find_module_sections(struct module *mod, struct load_info *info) mod->dyndbg_info.classes = section_objs(info, "__dyndbg_classes", sizeof(*mod->dyndbg_info.classes), &mod->dyndbg_info.num_classes); + mod->dyndbg_info.class_users = section_objs(info, "__dyndbg_class_users", + sizeof(*mod->dyndbg_info.class_users), + &mod->dyndbg_info.num_class_users); #endif return 0; diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 291185f54ee4..16288bdaa944 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -2797,12 +2797,26 @@ config TEST_STATIC_KEYS If unsure, say N. config TEST_DYNAMIC_DEBUG - tristate "Test DYNAMIC_DEBUG" - depends on DYNAMIC_DEBUG + tristate "Build test-dynamic-debug module" + depends on DYNAMIC_DEBUG || DYNAMIC_DEBUG_CORE help - This module registers a tracer callback to count enabled - pr_debugs in a 'do_debugging' function, then alters their - enablements, calls the function, and compares counts. + This module exercises/demonstrates dyndbg's classmap API, by + creating 2 classes: a DISJOINT classmap (supporting DRM.debug) + and a LEVELS/VERBOSE classmap (like verbose2 > verbose1). + + If unsure, say N. + +config TEST_DYNAMIC_DEBUG_SUBMOD + tristate "Build test-dynamic-debug submodule" + default m + depends on DYNAMIC_DEBUG || DYNAMIC_DEBUG_CORE + depends on TEST_DYNAMIC_DEBUG + help + This sub-module uses a classmap defined and exported by the + parent module, recapitulating drm & driver's shared use of + drm.debug to control enabled debug-categories. + It is tristate, independent of parent, to allow testing all + proper combinations of parent=y/m submod=y/m. If unsure, say N. diff --git a/lib/Makefile b/lib/Makefile index ffc6b2341b45..d3e6a48f202b 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -82,6 +82,7 @@ obj-$(CONFIG_TEST_USER_COPY) += test_user_copy.o obj-$(CONFIG_TEST_STATIC_KEYS) += test_static_keys.o obj-$(CONFIG_TEST_STATIC_KEYS) += test_static_key_base.o obj-$(CONFIG_TEST_DYNAMIC_DEBUG) += test_dynamic_debug.o +obj-$(CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD) += test_dynamic_debug_submod.o obj-$(CONFIG_TEST_PRINTF) += test_printf.o obj-$(CONFIG_TEST_SCANF) += test_scanf.o @@ -240,6 +241,8 @@ obj-$(CONFIG_HAVE_ARCH_TRACEHOOK) += syscall.o obj-$(CONFIG_DYNAMIC_DEBUG_CORE) += dynamic_debug.o #ensure exported functions have prototypes CFLAGS_dynamic_debug.o := -DDYNAMIC_DEBUG_MODULE +CFLAGS_test_dynamic_debug.o := -DDYNAMIC_DEBUG_MODULE +CFLAGS_test_dynamic_debug_submod.o := -DDYNAMIC_DEBUG_MODULE obj-$(CONFIG_SYMBOLIC_ERRNAME) += errname.o diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index d5701207febc..9150e0e5145f 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -43,13 +43,16 @@ extern struct _ddebug __start___dyndbg[]; extern struct _ddebug __stop___dyndbg[]; extern struct ddebug_class_map __start___dyndbg_classes[]; extern struct ddebug_class_map __stop___dyndbg_classes[]; +extern struct ddebug_class_user __start___dyndbg_class_users[]; +extern struct ddebug_class_user __stop___dyndbg_class_users[]; struct ddebug_table { struct list_head link; const char *mod_name; struct _ddebug *ddebugs; struct ddebug_class_map *classes; - unsigned int num_ddebugs, num_classes; + struct ddebug_class_user *class_users; + unsigned int num_ddebugs, num_classes, num_class_users; }; struct ddebug_query { @@ -148,21 +151,39 @@ static void vpr_info_dq(const struct ddebug_query *query, const char *msg) query->first_lineno, query->last_lineno, query->class_string); } +#define vpr_dt_info(dt_p, msg_p, ...) ({ \ + struct ddebug_table const *_dt = dt_p; \ + v2pr_info(msg_p " module:%s nd:%d nc:%d nu:%d\n", ##__VA_ARGS__, \ + _dt->mod_name, _dt->num_ddebugs, _dt->num_classes, \ + _dt->num_class_users); \ + }) + #define __outvar /* filled by callee */ static struct ddebug_class_map *ddebug_find_valid_class(struct ddebug_table const *dt, const char *class_string, __outvar int *class_id) { struct ddebug_class_map *map; + struct ddebug_class_user *cli; int i, idx; - for (map = dt->classes, i = 0; i < dt->num_classes; i++, map++) { + for (i = 0, map = dt->classes; i < dt->num_classes; i++, map++) { idx = match_string(map->class_names, map->length, class_string); if (idx >= 0) { *class_id = idx + map->base; + vpr_dt_info(dt, "good-class: %s.%s ", map->mod_name, class_string); return map; } } + for (i = 0, cli = dt->class_users; i < dt->num_class_users; i++, cli++) { + idx = match_string(cli->map->class_names, cli->map->length, class_string); + if (idx >= 0) { + *class_id = idx + cli->map->base; + vpr_dt_info(dt, "class-ref: %s.%s ", + cli->user_mod_name, class_string); + return cli->map; + } + } *class_id = -ENOENT; return NULL; } @@ -559,7 +580,7 @@ static int ddebug_exec_query(char *query_string, const char *modname) /* handle multiple queries in query string, continue on error, return last error or number of matching callsites. Module name is either - in param (for boot arg) or perhaps in query string. + in the modname arg (for boot args) or perhaps in query string. */ static int ddebug_exec_queries(char *query, const char *modname) { @@ -688,12 +709,12 @@ static int param_set_dyndbg_module_classes(const char *instr, } /** - * param_set_dyndbg_classes - class FOO >control + * param_set_dyndbg_classes - set all classes in a classmap * @instr: string echo>d to sysfs, input depends on map_type - * @kp: kp->arg has state: bits/lvl, map, map_type + * @kp: kp->arg has state: bits/lvl, classmap, map_type * - * Enable/disable prdbgs by their class, as given in the arguments to - * DECLARE_DYNDBG_CLASSMAP. For LEVEL map-types, enforce relative + * For all classes in the classmap, enable/disable them per the input + * (depending on map_type). For LEVEL map-types, enforce relative * levels by bitpos. * * Returns: 0 or <0 if error. @@ -1038,12 +1059,17 @@ static void *ddebug_proc_next(struct seq_file *m, void *p, loff_t *pos) static const char *ddebug_class_name(struct ddebug_table *dt, struct _ddebug *dp) { struct ddebug_class_map *map = dt->classes; + struct ddebug_class_user *cli = dt->class_users; int i; for (i = 0; i < dt->num_classes; i++, map++) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; + for (i = 0; i < dt->num_class_users; i++, cli++) + if (class_in_range(dp->class_id, cli->map)) + return cli->map->class_names[dp->class_id - cli->map->base]; + return NULL; } @@ -1124,31 +1150,134 @@ static const struct proc_ops proc_fops = { .proc_write = ddebug_proc_write }; +static const char * const ddebug_classmap_typenames[] = { + "DISJOINT_BITS", "LEVEL_NUM" +}; + +#define vpr_cm_info(cm_p, msg_p, ...) ({ \ + struct ddebug_class_map const *_cm = cm_p; \ + v2pr_info(msg_p " module:%s base:%d len:%d type:%s\n", ##__VA_ARGS__, \ + _cm->mod_name, _cm->base, _cm->length, \ + ddebug_classmap_typenames[_cm->map_type]); \ + }) + +static void ddebug_sync_classbits(const struct ddebug_class_param *dcp, const char *modname) +{ + /* clamp initial bitvec, mask off hi-bits */ + if (*dcp->bits & ~CLASSMAP_BITMASK(dcp->map->length)) { + *dcp->bits &= CLASSMAP_BITMASK(dcp->map->length); + v2pr_info("preset classbits: %lx\n", *dcp->bits); + } + /* force class'd prdbgs (in USEr module) to match (DEFINEr module) class-param */ + ddebug_apply_class_bitmap(dcp, dcp->bits, ~0, modname); + ddebug_apply_class_bitmap(dcp, dcp->bits, 0, modname); +} + +static void ddebug_match_apply_kparam(const struct kernel_param *kp, + const struct ddebug_class_map *map, + const char *modnm) +{ + struct ddebug_class_param *dcp; + + if (kp->ops != ¶m_ops_dyndbg_classes) + return; + + dcp = (struct ddebug_class_param *)kp->arg; + + if (map == dcp->map) { + v2pr_info("found kp:%s =0x%lx", kp->name, *dcp->bits); + vpr_cm_info(map, "mapped to:"); + ddebug_sync_classbits(dcp, modnm); + } +} + +static void ddebug_apply_params(const struct ddebug_class_map *cm, const char *modnm) +{ + const struct kernel_param *kp; +#if IS_ENABLED(CONFIG_MODULES) + int i; + + if (cm->mod) { + vpr_cm_info(cm, "loaded class:"); + /* ifdef protects the cm->mod->kp deref */ + for (i = 0, kp = cm->mod->kp; i < cm->mod->num_kp; i++, kp++) + ddebug_match_apply_kparam(kp, cm, modnm); + } +#endif + if (!cm->mod) { + vpr_cm_info(cm, "builtin class:"); + for (kp = __start___param; kp < __stop___param; kp++) + ddebug_match_apply_kparam(kp, cm, modnm); + } +} + +/* + * Find this module's classmaps in a sub/whole-range of the builtin/ + * modular classmap vector/section. Save the start and length of the + * subrange at its edges. + */ static void ddebug_attach_module_classes(struct ddebug_table *dt, struct _ddebug_info *di) { struct ddebug_class_map *cm; int i, nc = 0; - /* - * Find this module's classmaps in a subrange/wholerange of - * the builtin/modular classmap vector/section. Save the start - * and length of the subrange at its edges. - */ - for (cm = di->classes, i = 0; i < di->num_classes; i++, cm++) { + for (i = 0, cm = di->classes; i < di->num_classes; i++, cm++) { if (!strcmp(cm->mod_name, dt->mod_name)) { - if (!nc) { - v2pr_info("start subrange, class[%d]: module:%s base:%d len:%d ty:%d\n", - i, cm->mod_name, cm->base, cm->length, cm->map_type); + vpr_cm_info(cm, "classes[%d]:", i); + if (!nc++) dt->classes = cm; - } - nc++; } } - if (nc) { - dt->num_classes = nc; - vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); + if (!nc) + return; + + vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); + dt->num_classes = nc; + + for (i = 0, cm = dt->classes; i < dt->num_classes; i++, cm++) + ddebug_apply_params(cm, cm->mod_name); +} + +/* + * propagates class-params thru their classmaps to class-users. this + * means a query against the dt/module, which means it must be on the + * list to be seen by ddebug_change. + */ +static void ddebug_attach_user_module_classes(struct ddebug_table *dt, + const struct _ddebug_info *di) +{ + struct ddebug_class_user *cli; + int i, nc = 0; + + /* + * For builtins: scan the array, find start/length of this + * module's refs, save to dt. For loadables, this is the + * whole array. + */ + for (i = 0, cli = di->class_users; i < di->num_class_users; i++, cli++) { + + if (WARN_ON_ONCE(!cli || !cli->map || !cli->user_mod_name)) + continue; + + if (!strcmp(cli->user_mod_name, dt->mod_name)) { + + vpr_cm_info(cli->map, "class_ref[%d] %s -> %s", i, + cli->user_mod_name, cli->map->mod_name); + if (!nc++) + dt->class_users = cli; + } } + if (!nc) + return; + + dt->num_class_users = nc; + + /* now iterate dt */ + for (i = 0, cli = dt->class_users; i < dt->num_class_users; i++, cli++) + ddebug_apply_params(cli->map, cli->user_mod_name); + + vpr_dt_info(dt, "attach-client-module: "); } /* @@ -1158,6 +1287,8 @@ static void ddebug_attach_module_classes(struct ddebug_table *dt, struct _ddebug static int ddebug_add_module(struct _ddebug_info *di, const char *modname) { struct ddebug_table *dt; + struct _ddebug *iter; + int i, class_ct = 0; if (!di->num_descs) return 0; @@ -1181,13 +1312,20 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) INIT_LIST_HEAD(&dt->link); - if (di->classes && di->num_classes) + for (i = 0, iter = di->descs; i < di->num_descs; i++, iter++) + if (iter->class_id != _DPRINTK_CLASS_DFLT) + class_ct++; + + if (class_ct && di->num_classes) ddebug_attach_module_classes(dt, di); mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); + if (class_ct && di->num_class_users) + ddebug_attach_user_module_classes(dt, di); + vpr_info("%3u debug prints in module %s\n", di->num_descs, modname); return 0; } @@ -1337,8 +1475,10 @@ static int __init dynamic_debug_init(void) struct _ddebug_info di = { .descs = __start___dyndbg, .classes = __start___dyndbg_classes, + .class_users = __start___dyndbg_class_users, .num_descs = __stop___dyndbg - __start___dyndbg, .num_classes = __stop___dyndbg_classes - __start___dyndbg_classes, + .num_class_users = __stop___dyndbg_class_users - __start___dyndbg_class_users, }; #ifdef CONFIG_MODULES diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 9e950a911b6c..ff9b879286d5 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -6,11 +6,15 @@ * Jim Cromie */ -#define pr_fmt(fmt) "test_dd: " fmt +#if defined(TEST_DYNAMIC_DEBUG_SUBMOD) + #define pr_fmt(fmt) "test_dd_submod: " fmt +#else + #define pr_fmt(fmt) "test_dd: " fmt +#endif #include -/* run tests by reading or writing sysfs node: do_prints */ +/* re-gen output by reading or writing sysfs node: do_prints */ static void do_prints(void); /* device under test */ static int param_set_do_prints(const char *instr, const struct kernel_param *kp) @@ -29,24 +33,39 @@ static const struct kernel_param_ops param_ops_do_prints = { }; module_param_cb(do_prints, ¶m_ops_do_prints, NULL, 0600); -/* - * Using the CLASSMAP api: - * - classmaps must have corresponding enum - * - enum symbols must match/correlate with class-name strings in the map. - * - base must equal enum's 1st value - * - multiple maps must set their base to share the 0-30 class_id space !! - * (build-bug-on tips welcome) - * Additionally, here: - * - tie together sysname, mapname, bitsname, flagsname - */ -#define DD_SYS_WRAP(_model, _flags) \ - static unsigned long bits_##_model; \ - static struct ddebug_class_param _flags##_model = { \ +#define CLASSMAP_BITMASK(width, base) (((1UL << (width)) - 1) << base) + +/* sysfs param wrapper, proto-API */ +#define DYNDBG_CLASSMAP_PARAM_(_model, _flags, _init) \ + static unsigned long bits_##_model = _init; \ + static struct ddebug_class_param _flags##_##_model = { \ .bits = &bits_##_model, \ .flags = #_flags, \ .map = &map_##_model, \ }; \ - module_param_cb(_flags##_##_model, ¶m_ops_dyndbg_classes, &_flags##_model, 0600) + module_param_cb(_flags##_##_model, ¶m_ops_dyndbg_classes, \ + &_flags##_##_model, 0600) +#ifdef DEBUG +#define DYNDBG_CLASSMAP_PARAM(_model, _flags) DYNDBG_CLASSMAP_PARAM_(_model, _flags, ~0) +#else +#define DYNDBG_CLASSMAP_PARAM(_model, _flags) DYNDBG_CLASSMAP_PARAM_(_model, _flags, 0) +#endif + +/* + * Demonstrate/test all 4 class-typed classmaps with a sys-param. + * + * Each is 3 part: client-enum decl, _DEFINE, _PARAM. + * Declare them in blocks to show patterns of use (repetitions and + * changes) within each. + * + * 1st, dyndbg expects a client-provided enum-type as source of + * category/classid truth. DRM has DRM_UT_. + * + * Modules with multiple CLASSMAPS must have enums with distinct + * value-ranges, arranged below with explicit enum_sym = X inits. + * + * Declare all 4 enums now, for different types + */ /* numeric input, independent bits */ enum cat_disjoint_bits { @@ -60,26 +79,51 @@ enum cat_disjoint_bits { D2_LEASE, D2_DP, D2_DRMRES }; -DECLARE_DYNDBG_CLASSMAP(map_disjoint_bits, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "D2_CORE", - "D2_DRIVER", - "D2_KMS", - "D2_PRIME", - "D2_ATOMIC", - "D2_VBL", - "D2_STATE", - "D2_LEASE", - "D2_DP", - "D2_DRMRES"); -DD_SYS_WRAP(disjoint_bits, p); -DD_SYS_WRAP(disjoint_bits, T); /* numeric verbosity, V2 > V1 related */ enum cat_level_num { V0 = 14, V1, V2, V3, V4, V5, V6, V7 }; -DECLARE_DYNDBG_CLASSMAP(map_level_num, DD_CLASS_TYPE_LEVEL_NUM, 14, - "V0", "V1", "V2", "V3", "V4", "V5", "V6", "V7"); -DD_SYS_WRAP(level_num, p); -DD_SYS_WRAP(level_num, T); + +/* recapitulate DRM's parent(drm.ko) <-- _submod(drivers,helpers) */ +#if !defined(TEST_DYNAMIC_DEBUG_SUBMOD) +/* + * In single user, or parent / coordinator (drm.ko) modules, define + * classmaps on the client enums above, and then declares the PARAMS + * ref'g the classmaps. Each is exported. + */ +DYNDBG_CLASSMAP_DEFINE(map_disjoint_bits, DD_CLASS_TYPE_DISJOINT_BITS, + D2_CORE, + "D2_CORE", + "D2_DRIVER", + "D2_KMS", + "D2_PRIME", + "D2_ATOMIC", + "D2_VBL", + "D2_STATE", + "D2_LEASE", + "D2_DP", + "D2_DRMRES"); + +DYNDBG_CLASSMAP_DEFINE(map_level_num, DD_CLASS_TYPE_LEVEL_NUM, + V0, "V0", "V1", "V2", "V3", "V4", "V5", "V6", "V7"); + +/* + * now add the sysfs-params + */ + +DYNDBG_CLASSMAP_PARAM(disjoint_bits, p); +DYNDBG_CLASSMAP_PARAM(level_num, p); + +#else /* TEST_DYNAMIC_DEBUG_SUBMOD */ + +/* + * in submod/drm-drivers, use the classmaps defined in top/parent + * module above. + */ + +DYNDBG_CLASSMAP_USE(map_disjoint_bits); +DYNDBG_CLASSMAP_USE(map_level_num); + +#endif /* stand-in for all pr_debug etc */ #define prdbg(SYM) __pr_debug_cls(SYM, #SYM " msg\n") @@ -115,6 +159,7 @@ static void do_levels(void) static void do_prints(void) { + pr_debug("do_prints:\n"); do_cats(); do_levels(); } diff --git a/lib/test_dynamic_debug_submod.c b/lib/test_dynamic_debug_submod.c new file mode 100644 index 000000000000..9a893402ce1a --- /dev/null +++ b/lib/test_dynamic_debug_submod.c @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Kernel module for testing dynamic_debug + * + * Authors: + * Jim Cromie + */ + +#define TEST_DYNAMIC_DEBUG_SUBMOD +#include "test_dynamic_debug.c" From patchwork Tue Jul 2 21:57:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720386 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B5EE3C3065C for ; Tue, 2 Jul 2024 21:58:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3388610E6DA; Tue, 2 Jul 2024 21:58:38 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DF7j/1Lp"; dkim-atps=neutral Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id F25C110E6D0; Tue, 2 Jul 2024 21:58:34 +0000 (UTC) Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-7f6309e9f29so165183839f.0; Tue, 02 Jul 2024 14:58:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957514; x=1720562314; darn=lists.freedesktop.org; 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=IV/+5wwHTeWzOxSke4OB6kYyIW8aBgx7MWxd77xRKcc=; b=DF7j/1LpiIL6gDQEx/DObQFNs2GBXxuatC3V4zI5Tij3Wsel2HK9CzXsqevPdHAcXu PDAE4yMna606uzI85K9pnb67DT4b7bdtR9Z3qXE7vIfVdgY74E97/aL/pTk2fbHAVTYh SUMsORFeGD49t9GO1y+8bvNzj8P9f8s7VqUaQ1YBTm8HUv3imSLOkYR0wzGYr8pGEBug VilFTZ86lEeMUAs813ouELTIMMhdloDTukTJQshDgC4IKXxncpERZ87OhuZDX4j8x83J Eke/rdWNugL0tUR1rNq/7a484PPjsxO2FTl0n58y5YcJhTsNHGFNv+JiFYlhw7dCFVkn +FSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957514; x=1720562314; 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=IV/+5wwHTeWzOxSke4OB6kYyIW8aBgx7MWxd77xRKcc=; b=tE2ERofqty3HlLTrbIvdNuucT7JV/HNWi5nA31bmK6tJ3L8/sGzjvd4Bojwtvj8kwl /52RRQC5y55fXAa33XFPOS0s9SnuzdFJOkqsdqPlENUERlMo/aqE3XoaZI9aJJMkT2Va cl5LYjMpeqAbi++ljMso9IkOMAtup4iYEGN1u9npEMOOsVMN0THBhvnv+4V0/o7biTzZ K8VGO/4QhjMQurY9aZHp7zBsxUnbTqqqliwY/Ukc6b99Y/NIPQwq5knUr7EAnlPQ4O2Y wfg5Adnj6hA6ItF/9Cksp/DK+XXh7jusDuF2H1v4O7gnBTr/9PanvbD6aIdjkWPNy91Z LO5Q== X-Forwarded-Encrypted: i=1; AJvYcCUeOWx03RfIvUrmLqeCb758yJLPASQlWS12z0xqT44p68gE/VXN8+XLq9tg5KWhjtUoWqo0Y/qZ9H/DVt8VUba0rB90L+iArCbX04muPpalRsMF51mRmMwpp8C+hmbC+5X658bcCxXgw5wpmWfJAUtymeWXFsHavuyA3m4jDcAOw+fCGKGpIO4Uf1yNqvYxISL5l+3Z338GBNvAIVEa3HCjVsUhucEdBHSc4gN/cgeZFtCtyvQ= X-Gm-Message-State: AOJu0YyLFcGn2zxq14Qt43wrY0YbkDcOeGialBB/gswbcjjcqpRQp1+8 F/FZvOFYsgMaFvpQHCrOHoKTZrKVg9R3APTipQmRl/0+w4rDvq40 X-Google-Smtp-Source: AGHT+IFIuGEFSJwD0zrikgcy7eyzzh9OMyzELZnPifGHnbyDqr+YvwVITj3dJs9GO2JbYNz3OWCbyA== X-Received: by 2002:a6b:5a0e:0:b0:7f6:210c:61b0 with SMTP id ca18e2360f4ac-7f62ee853a4mr1060872939f.20.1719957514134; Tue, 02 Jul 2024 14:58:34 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:33 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 16/52] selftests-dyndbg: add tools/testing/selftests/dynamic_debug/* Date: Tue, 2 Jul 2024 15:57:06 -0600 Message-ID: <20240702215804.2201271-17-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add a selftest script for dynamic-debug. The config requires CONFIG_TEST_DYNAMIC_DEBUG=m (and CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=m), which tacitly requires either CONFIG_DYNAMIC_DEBUG=y or CONFIG_DYNAMIC_DEBUG_CORE=y ATM this has just basic_tests(), it modifies pr_debug flags in a few builtins (init/main, params), counts the callsite flags changed, and verifies against expected values. This is backported from another feature branch; the support-fns (thx Lukas) have unused features at the moment, they'll get used shortly. The script enables simple virtme-ng testing: $> vng --verbose --name v6.8-32-g30d431000676 --user root \ --cwd ../.. -a dynamic_debug.verbose=2 -p 4 \ ./tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh virtme: waiting for virtiofsd to start virtme: use 'microvm' QEMU architecture ... [ 4.136168] virtme-init: Setting hostname to v6.8-32-g30d431000676... [ 4.240874] virtme-init: starting script test_dynamic_debug_submod not there test_dynamic_debug not there ... [ 4.474435] virtme-init: script returned {0} Powering off. [ 4.529318] ACPI: PM: Preparing to enter system sleep state S5 [ 4.529991] kvm: exiting hardware virtualization [ 4.530428] reboot: Power down And add dynamic_debug to TARGETS, so `make run_tests` sees it properly for the impatient, set TARGETS explicitly: bash-5.2# make TARGETS=dynamic_debug run_tests make[1]: ... TAP version 13 1..1 [ 35.552922] dyndbg: read 3 bytes from userspace [ 35.553099] dyndbg: query 0: "=_" mod:* [ 35.553544] dyndbg: processed 1 queries, with 1778 matches, 0 errs ... TLDR: This selftest is slightly naive wrt the init state of call-site flags. In particular, it fails if class'd pr_debugs have been set $ cat /etc/modprobe.d/drm-test.conf options drm dyndbg=class,DRM_UT_CORE,+mfslt%class,DRM_UT_KMS,+mf By Contract, class'd pr_debugs are protected from alteration by default (only by direct "class FOO" queries), so the "=_" logged above (TAP version 13) cannot affect the DRM_UT_CORE,KMS pr_debugs. These class'd flag-settings, added by modprobe, alter the counts of flag-matching patterns, breaking the tests' expectations. Signed-off-by: Jim Cromie Co-developed-by: Łukasz Bartosik Signed-off-by: Łukasz Bartosik --- MAINTAINERS | 1 + tools/testing/selftests/Makefile | 1 + .../testing/selftests/dynamic_debug/Makefile | 9 + tools/testing/selftests/dynamic_debug/config | 2 + .../dynamic_debug/dyndbg_selftest.sh | 231 ++++++++++++++++++ 5 files changed, 244 insertions(+) create mode 100644 tools/testing/selftests/dynamic_debug/Makefile create mode 100644 tools/testing/selftests/dynamic_debug/config create mode 100755 tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh diff --git a/MAINTAINERS b/MAINTAINERS index c9ed48109ff5..e7bb7b1c44c8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7527,6 +7527,7 @@ S: Maintained F: include/linux/dynamic_debug.h F: lib/dynamic_debug.c F: lib/test_dynamic_debug*.c +F: tools/testing/selftest/dynamic_debug/* DYNAMIC INTERRUPT MODERATION M: Tal Gilboa diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index e1504833654d..84edf0bd8e80 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -20,6 +20,7 @@ TARGETS += drivers/s390x/uvdevice TARGETS += drivers/net/bonding TARGETS += drivers/net/team TARGETS += dt +TARGETS += dynamic_debug TARGETS += efivarfs TARGETS += exec TARGETS += fchmodat2 diff --git a/tools/testing/selftests/dynamic_debug/Makefile b/tools/testing/selftests/dynamic_debug/Makefile new file mode 100644 index 000000000000..6d06fa7f1040 --- /dev/null +++ b/tools/testing/selftests/dynamic_debug/Makefile @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0-only +# borrowed from Makefile for user memory selftests + +# No binaries, but make sure arg-less "make" doesn't trigger "run_tests" +all: + +TEST_PROGS := dyndbg_selftest.sh + +include ../lib.mk diff --git a/tools/testing/selftests/dynamic_debug/config b/tools/testing/selftests/dynamic_debug/config new file mode 100644 index 000000000000..d080da571ac0 --- /dev/null +++ b/tools/testing/selftests/dynamic_debug/config @@ -0,0 +1,2 @@ +CONFIG_TEST_DYNAMIC_DEBUG=m +CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=m diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh new file mode 100755 index 000000000000..1be70af26a38 --- /dev/null +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -0,0 +1,231 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0-only + +V=${V:=0} # invoke as V=1 $0 for global verbose +RED="\033[0;31m" +GREEN="\033[0;32m" +YELLOW="\033[0;33m" +BLUE="\033[0;34m" +MAGENTA="\033[0;35m" +CYAN="\033[0;36m" +NC="\033[0;0m" +error_msg="" + +function vx () { + echo $1 > /sys/module/dynamic_debug/parameters/verbose +} + +function ddgrep () { + grep $1 /proc/dynamic_debug/control +} + +function doprints () { + cat /sys/module/test_dynamic_debug/parameters/do_prints +} + +function ddcmd () { + exp_exit_code=0 + num_args=$# + if [ "${@:$#}" = "pass" ]; then + num_args=$#-1 + elif [ "${@:$#}" = "fail" ]; then + num_args=$#-1 + exp_exit_code=1 + fi + args=${@:1:$num_args} + output=$((echo "$args" > /proc/dynamic_debug/control) 2>&1) + exit_code=$? + error_msg=$(echo $output | cut -d ":" -f 5 | sed -e 's/^[[:space:]]*//') + handle_exit_code $BASH_LINENO $FUNCNAME $exit_code $exp_exit_code +} + +function handle_exit_code() { + local exp_exit_code=0 + [ $# == 4 ] && exp_exit_code=$4 + if [ $3 -ne $exp_exit_code ]; then + echo -e "${RED}: $BASH_SOURCE:$1 $2() expected to exit with code $exp_exit_code" + [ $3 == 1 ] && echo "Error: '$error_msg'" + exit + fi +} + +# $1 - pattern to match, pattern in $1 is enclosed by spaces for a match ""\s$1\s" +# $2 - number of times the pattern passed in $1 is expected to match +# $3 - optional can be set either to "-r" or "-v" +# "-r" means relaxed matching in this case pattern provided in $1 is passed +# as is without enclosing it with spaces +# "-v" prints matching lines +# $4 - optional when $3 is set to "-r" then $4 can be used to pass "-v" +function check_match_ct { + pattern="\s$1\s" + exp_cnt=0 + + [ "$3" == "-r" ] && pattern="$1" + let cnt=$(ddgrep "$pattern" | wc -l) + if [ $V -eq 1 ] || [ "$3" == "-v" ] || [ "$4" == "-v" ]; then + echo -ne "${BLUE}" && ddgrep $pattern && echo -ne "${NC}" + fi + [ $# -gt 1 ] && exp_cnt=$2 + if [ $cnt -ne $exp_cnt ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO check failed expected $exp_cnt on $1, got $cnt" + exit + else + echo ": $cnt matches on $1" + fi +} + +# $1 - trace instance name +# #2 - if > 0 then directory is expected to exist, if <= 0 then otherwise +# $3 - "-v" for verbose +function check_trace_instance_dir { + if [ -e /sys/kernel/tracing/instances/$1 ]; then + if [ "$3" == "-v" ] ; then + echo "ls -l /sys/kernel/tracing/instances/$1: " + ls -l /sys/kernel/tracing/instances/$1 + fi + if [ $2 -le 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO error trace instance \ + '/sys/kernel/tracing/instances/$1' does exist" + exit + fi + else + if [ $2 -gt 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO error trace instance \ + '/sys/kernel/tracing/instances/$1' does not exist" + exit + fi + fi +} + +function tmark { + echo $* > /sys/kernel/tracing/trace_marker +} + +# $1 - trace instance name +# $2 - line number +# $3 - if > 0 then the instance is expected to be opened, otherwise +# the instance is expected to be closed +function check_trace_instance { + output=$(tail -n9 /proc/dynamic_debug/control | grep ": Opened trace instances" \ + | xargs -n1 | grep $1) + if [ "$output" != $1 ] && [ $3 -gt 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$2 trace instance $1 is not opened" + exit + fi + if [ "$output" == $1 ] && [ $3 -le 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$2 trace instance $1 is not closed" + exit + fi +} + +function is_trace_instance_opened { + check_trace_instance $1 $BASH_LINENO 1 +} + +function is_trace_instance_closed { + check_trace_instance $1 $BASH_LINENO 0 +} + +# $1 - trace instance directory to delete +# $2 - if > 0 then directory is expected to be deleted successfully, if <= 0 then otherwise +function del_trace_instance_dir() { + exp_exit_code=1 + [ $2 -gt 0 ] && exp_exit_code=0 + output=$((rmdir /sys/kernel/debug/tracing/instances/$1) 2>&1) + exit_code=$? + error_msg=$(echo $output | cut -d ":" -f 3 | sed -e 's/^[[:space:]]*//') + handle_exit_code $BASH_LINENO $FUNCNAME $exit_code $exp_exit_code +} + +function error_log_ref { + # to show what I got + : echo "# error-log-ref: $1" + : echo cat \$2 +} + +function ifrmmod { + lsmod | grep $1 2>&1>/dev/null || echo $1 not there + lsmod | grep $1 2>&1>/dev/null && rmmod $1 +} + +# $1 - text to search for +function search_trace() { + search_trace_name 0 1 $1 +} + +# $1 - trace instance name, 0 for global event trace +# $2 - line number counting from the bottom +# $3 - text to search for +function search_trace_name() { + if [ "$1" = "0" ]; then + buf=$(cat /sys/kernel/debug/tracing/trace) + line=$(tail -$2 /sys/kernel/debug/tracing/trace | head -1 | sed -e 's/^[[:space:]]*//') + else + buf=$(cat /sys/kernel/debug/tracing/instances/$1/trace) + line=$(tail -$2 /sys/kernel/debug/tracing/instances/$1/trace | head -1 | \ + sed -e 's/^[[:space:]]*//') + fi + if [ $2 = 0 ]; then + # whole-buf check + output=$(echo $buf | grep "$3") + else + output=$(echo $line | grep "$3") + fi + if [ "$output" = "" ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO search for '$3' failed \ + in line '$line' or '$buf'" + exit + fi + if [ $V = 1 ]; then + echo -e "${MAGENTA}: search_trace_name in $1 found: \n$output \nin:${BLUE} $buf ${NC}" + fi +} + +# $1 - error message to check +function check_err_msg() { + if [ "$error_msg" != "$1" ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO error message '$error_msg' \ + does not match with '$1'" + exit + fi +} + +function basic_tests { + echo -e "${GREEN}# BASIC_TESTS ${NC}" + ddcmd =_ # zero everything (except class'd sites) + check_match_ct =p 0 + # there are several main's :-/ + ddcmd module main file */module/main.c +p + check_match_ct =p 14 + ddcmd =_ + check_match_ct =p 0 + # multi-cmd input, newline separated, with embedded comments + cat <<"EOF" > /proc/dynamic_debug/control + module main +mf # multi-query + module main file init/main.c +ml # newline separated +EOF + # the intersection of all those main's is hard to track/count + # esp when mixed with overlapping greps + check_match_ct =mf 21 + check_match_ct =ml 0 + check_match_ct =mfl 6 + ddcmd =_ +} + + +tests_list=( + basic_tests +) + +# Run tests + +ifrmmod test_dynamic_debug_submod +ifrmmod test_dynamic_debug + +for test in "${tests_list[@]}" +do + $test + echo "" +done +echo -en "${GREEN}# Done on: " +date From patchwork Tue Jul 2 21:57:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2C3F4C31D97 for ; Tue, 2 Jul 2024 21:58:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A6FE210E6D7; Tue, 2 Jul 2024 21:58:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ue60Ahpw"; dkim-atps=neutral Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 48AB810E6D7; Tue, 2 Jul 2024 21:58:36 +0000 (UTC) Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-7f64f66fdd7so60610139f.0; Tue, 02 Jul 2024 14:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957515; x=1720562315; darn=lists.freedesktop.org; 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=ixqe2fvQ+p3xJowFXczfx5KdZEaC8a1vzuHPaRlFrmw=; b=Ue60Ahpw2jl3woohc7R7vDpxbDBUd5QnRmQMR930cPQB/WyIQ15qMmP7MtwWyA23yL jYcLHdd9WqSpf2Dsa+U3jygHDPbFqIubVs42Z/v0Fh41M/Oyz1WSxSVgAbWNYl4S2mCo +lvYDmNKG0mU6jSHy351FKgLxgTYYThCtv6Fv5izu+EFUm+yY3LezYErcqXhUFTq1p3L /bKH2G9btscvsRgPOHHbQgHGKTIb0kmxFZDgVKcaLIJeqxHw6MOIIjcA3NGENpu8QnbJ AKh2teiET79+pY0inhKznJbBecetPGgYfoe+lMclVJuEa9cFty1mr4pETRCB9bQz22pB ptRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957515; x=1720562315; 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=ixqe2fvQ+p3xJowFXczfx5KdZEaC8a1vzuHPaRlFrmw=; b=VCDwv3u9ooKV+NKZvYgf/jpNbYY3cxxBxKhAIDBAiNUm0dJtR4Op3g2Or8pAIGbntt WLgMauFgWAWKB58dX/zGCxce0oAia1nHPUc13R/hc/VMFX9Yp9S2vGONV+aWdpiGzjsP YPnZ1MrY0Ys8YJyJ6EEgvjyIAPeuRiutix+2at36Td20dZ/JYUdLUGPML2JEmd2E2mJN ftC6q6PsM4tRM6dmfcYknuwaTddMl37wrBnjw2Uf2L6WkDv48kgu5pnToLG6Ik4g0fZ7 SnqRDTm0puGCMhPrugpuv7qN0MQE44jTEKvCTlsc8qkpeJEJJRlR+bZfKwDLD3Rscw1A KbTg== X-Forwarded-Encrypted: i=1; AJvYcCWE0tK8KsV6+fgvHOGma02BsDYSEXnNGxbouFMUWtlaLagTBFo4jhP98laikxWpgl+0xG2JJmEsaEB5lMAZTA+y3ZVfqDsKa2xEBz70B5tp8DktPLe82I2JjhRKRuvYYE9sDxig+okK8FEsiyl5j25j1PpfKLbjsNbkDfzUrpeptMKYnAhEvjzCL8iJJRzqDlmwPNPphaFBRdZibxUHg0Lm5oBY3BU052hIHItVtv+BHwvkJWc= X-Gm-Message-State: AOJu0Yyb4q/Vex/iWQoTV8mqEYdsKuUUG6ndPUdz6wvYc3pazypaCsmF L20HaHa11IeLblmec5Ai4DGkY/jehfCbmpyIL1V1pKci70/fVR+O X-Google-Smtp-Source: AGHT+IGuF3X4wd/Q+QiMc/SNYxya2QDBND8SXs2NtMYBQ3/4cpFsTf5QXlJhmfj13W/6t+FhpK5Wug== X-Received: by 2002:a6b:6f02:0:b0:7f6:1f4c:96d2 with SMTP id ca18e2360f4ac-7f62ed42fbamr1056411939f.0.1719957515370; Tue, 02 Jul 2024 14:58:35 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:34 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 17/52] dyndbg-API: promote DYNDBG_CLASSMAP_PARAM to API Date: Tue, 2 Jul 2024 15:57:07 -0600 Message-ID: <20240702215804.2201271-18-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" move the DYNDBG_CLASSMAP_PARAM macro from test-dynamic-debug.c into the header, and refine it, by distinguishing the 2 use cases: 1.DYNDBG_CLASSMAP_PARAM_REF for DRM, to pass in extern __drm_debug by name. dyndbg keeps bits in it, so drm can still use it as before 2.DYNDBG_CLASSMAP_PARAM new user (test_dynamic_debug) doesn't need to share state, decls a static long unsigned int to store the bitvec. __DYNDBG_CLASSMAP_PARAM bottom layer - allocate,init a ddebug-class-param, module-param-cb. Also clean up and improve comments in test-code, and add MODULE_DESCRIPTIONs. Signed-off-by: Jim Cromie --- fixup drm-print.h add PARAM_REF forwarding macros with DYNDBG_CLASSMAP_PARAM_REF in the API, add DRM_ variant --- include/linux/dynamic_debug.h | 37 ++++++++++++++++- lib/dynamic_debug.c | 70 ++++++++++++++++++++++----------- lib/test_dynamic_debug.c | 50 +++++++++-------------- lib/test_dynamic_debug_submod.c | 9 ++++- 4 files changed, 110 insertions(+), 56 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 2c6944c0d6cd..19f959f9a6b4 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -91,7 +91,7 @@ struct ddebug_class_map { * used to validate a "class FOO .." >control command on the module */ #define __DYNDBG_CLASSMAP_DEFINE(_var, _maptype, _base, ...) \ - const char *_var##_classnames[] = { __VA_ARGS__ }; \ + static const char *_var##_classnames[] = { __VA_ARGS__ }; \ struct ddebug_class_map __aligned(8) __used \ __section("__dyndbg_classes") _var = { \ .mod = THIS_MODULE, \ @@ -164,6 +164,41 @@ struct ddebug_class_param { const struct ddebug_class_map *map; }; +/** + * DYNDBG_CLASSMAP_PARAM - wrap a dyndbg-classmap with a controlling sys-param + * @_name sysfs node name + * @_var name of the struct classmap var defining the controlled classes + * @_flags flags to be toggled, typically just 'p' + * + * Creates a sysfs-param to control the classes defined by the + * classmap. Keeps bits in a private/static + */ +#define DYNDBG_CLASSMAP_PARAM(_name, _var, _flags) \ + static unsigned long _name##_bvec; \ + __DYNDBG_CLASSMAP_PARAM(_name, _name##_bvec, _var, _flags) + +/** + * DYNDBG_CLASSMAP_PARAM_REF - wrap a dyndbg-classmap with a controlling sys-param + * @_name sysfs node name + * @_bits name of the module's unsigned long bit-vector, ex: __drm_debug + * @_var name of the struct classmap var defining the controlled classes + * @_flags flags to be toggled, typically just 'p' + * + * Creates a sysfs-param to control the classmap, keeping bitvec in user @_bits. + * This lets drm use __drm_debug elsewhere too. + */ +#define DYNDBG_CLASSMAP_PARAM_REF(_name, _bits, _var, _flags) \ + __DYNDBG_CLASSMAP_PARAM(_name, _bits, _var, _flags) + +#define __DYNDBG_CLASSMAP_PARAM(_name, _bits, _var, _flags) \ + static struct ddebug_class_param _name##_##_flags = { \ + .bits = &(_bits), \ + .flags = #_flags, \ + .map = &(_var), \ + }; \ + module_param_cb(_name, ¶m_ops_dyndbg_classes, \ + &_name##_##_flags, 0600) + /* * pr_debug() and friends are globally enabled or modules have selectively * enabled them. diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 9150e0e5145f..e9a95b0f3757 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -657,6 +657,30 @@ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, #define CLASSMAP_BITMASK(width) ((1UL << (width)) - 1) +static void ddebug_class_param_clamp_input(unsigned long *inrep, const struct kernel_param *kp) +{ + const struct ddebug_class_param *dcp = kp->arg; + const struct ddebug_class_map *map = dcp->map; + + switch (map->map_type) { + case DD_CLASS_TYPE_DISJOINT_BITS: + /* expect bits. mask and warn if too many */ + if (*inrep & ~CLASSMAP_BITMASK(map->length)) { + pr_warn("%s: input: 0x%lx exceeds mask: 0x%lx, masking\n", + KP_NAME(kp), *inrep, CLASSMAP_BITMASK(map->length)); + *inrep &= CLASSMAP_BITMASK(map->length); + } + break; + case DD_CLASS_TYPE_LEVEL_NUM: + /* input is bitpos, of highest verbosity to be enabled */ + if (*inrep > map->length) { + pr_warn("%s: level:%ld exceeds max:%d, clamping\n", + KP_NAME(kp), *inrep, map->length); + *inrep = map->length; + } + break; + } +} static int param_set_dyndbg_module_classes(const char *instr, const struct kernel_param *kp, const char *modnm) @@ -675,26 +699,15 @@ static int param_set_dyndbg_module_classes(const char *instr, pr_err("expecting numeric input, not: %s > %s\n", instr, KP_NAME(kp)); return -EINVAL; } + ddebug_class_param_clamp_input(&inrep, kp); switch (map->map_type) { case DD_CLASS_TYPE_DISJOINT_BITS: - /* expect bits. mask and warn if too many */ - if (inrep & ~CLASSMAP_BITMASK(map->length)) { - pr_warn("%s: input: 0x%lx exceeds mask: 0x%lx, masking\n", - KP_NAME(kp), inrep, CLASSMAP_BITMASK(map->length)); - inrep &= CLASSMAP_BITMASK(map->length); - } v2pr_info("bits:0x%lx > %s.%s\n", inrep, modnm ?: "*", KP_NAME(kp)); totct += ddebug_apply_class_bitmap(dcp, &inrep, *dcp->bits, modnm); *dcp->bits = inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: - /* input is bitpos, of highest verbosity to be enabled */ - if (inrep > map->length) { - pr_warn("%s: level:%ld exceeds max:%d, clamping\n", - KP_NAME(kp), inrep, map->length); - inrep = map->length; - } old_bits = CLASSMAP_BITMASK(*dcp->lvl); new_bits = CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); @@ -1161,16 +1174,27 @@ static const char * const ddebug_classmap_typenames[] = { ddebug_classmap_typenames[_cm->map_type]); \ }) -static void ddebug_sync_classbits(const struct ddebug_class_param *dcp, const char *modname) +static void ddebug_sync_classbits(const struct kernel_param *kp, const char *modname) { - /* clamp initial bitvec, mask off hi-bits */ - if (*dcp->bits & ~CLASSMAP_BITMASK(dcp->map->length)) { - *dcp->bits &= CLASSMAP_BITMASK(dcp->map->length); - v2pr_info("preset classbits: %lx\n", *dcp->bits); + struct ddebug_class_param *dcp = kp->arg; + unsigned long new_bits; + + ddebug_class_param_clamp_input(dcp->bits, kp); + + switch (dcp->map->map_type) { + case DD_CLASS_TYPE_DISJOINT_BITS: + v2pr_info(" %s: classbits: 0x%lx\n", KP_NAME(kp), *dcp->bits); + ddebug_apply_class_bitmap(dcp, dcp->bits, 0UL, modname); + break; + case DD_CLASS_TYPE_LEVEL_NUM: + new_bits = CLASSMAP_BITMASK(*dcp->lvl); + v2pr_info(" %s: lvl:%ld bits:0x%lx\n", KP_NAME(kp), *dcp->lvl, new_bits); + ddebug_apply_class_bitmap(dcp, &new_bits, 0UL, modname); + break; + default: + pr_err("bad map type %d\n", dcp->map->map_type); + return; } - /* force class'd prdbgs (in USEr module) to match (DEFINEr module) class-param */ - ddebug_apply_class_bitmap(dcp, dcp->bits, ~0, modname); - ddebug_apply_class_bitmap(dcp, dcp->bits, 0, modname); } static void ddebug_match_apply_kparam(const struct kernel_param *kp, @@ -1185,9 +1209,9 @@ static void ddebug_match_apply_kparam(const struct kernel_param *kp, dcp = (struct ddebug_class_param *)kp->arg; if (map == dcp->map) { - v2pr_info("found kp:%s =0x%lx", kp->name, *dcp->bits); - vpr_cm_info(map, "mapped to:"); - ddebug_sync_classbits(dcp, modnm); + v2pr_info(" found kp:%s =0x%lx", kp->name, *dcp->bits); + vpr_cm_info(map, " mapped to:"); + ddebug_sync_classbits(kp, modnm); } } diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index ff9b879286d5..b3c6f90b9fe8 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Kernel module for testing dynamic_debug + * Kernel module to test/demonstrate dynamic_debug features, + * particularly classmaps and their support for subsystems like DRM. * * Authors: * Jim Cromie @@ -35,24 +36,8 @@ module_param_cb(do_prints, ¶m_ops_do_prints, NULL, 0600); #define CLASSMAP_BITMASK(width, base) (((1UL << (width)) - 1) << base) -/* sysfs param wrapper, proto-API */ -#define DYNDBG_CLASSMAP_PARAM_(_model, _flags, _init) \ - static unsigned long bits_##_model = _init; \ - static struct ddebug_class_param _flags##_##_model = { \ - .bits = &bits_##_model, \ - .flags = #_flags, \ - .map = &map_##_model, \ - }; \ - module_param_cb(_flags##_##_model, ¶m_ops_dyndbg_classes, \ - &_flags##_##_model, 0600) -#ifdef DEBUG -#define DYNDBG_CLASSMAP_PARAM(_model, _flags) DYNDBG_CLASSMAP_PARAM_(_model, _flags, ~0) -#else -#define DYNDBG_CLASSMAP_PARAM(_model, _flags) DYNDBG_CLASSMAP_PARAM_(_model, _flags, 0) -#endif - /* - * Demonstrate/test all 4 class-typed classmaps with a sys-param. + * Demonstrate/test both types of classmaps, each with a sys-param. * * Each is 3 part: client-enum decl, _DEFINE, _PARAM. * Declare them in blocks to show patterns of use (repetitions and @@ -64,7 +49,7 @@ module_param_cb(do_prints, ¶m_ops_do_prints, NULL, 0600); * Modules with multiple CLASSMAPS must have enums with distinct * value-ranges, arranged below with explicit enum_sym = X inits. * - * Declare all 4 enums now, for different types + * Declare all enums now, for different types */ /* numeric input, independent bits */ @@ -83,12 +68,15 @@ enum cat_disjoint_bits { /* numeric verbosity, V2 > V1 related */ enum cat_level_num { V0 = 14, V1, V2, V3, V4, V5, V6, V7 }; -/* recapitulate DRM's parent(drm.ko) <-- _submod(drivers,helpers) */ +/* + * use/demonstrate multi-module-group classmaps, as for DRM + */ #if !defined(TEST_DYNAMIC_DEBUG_SUBMOD) /* - * In single user, or parent / coordinator (drm.ko) modules, define - * classmaps on the client enums above, and then declares the PARAMS - * ref'g the classmaps. Each is exported. + * For module-groups of 1+, define classmaps with names (stringified + * enum-symbols) copied from above. 1-to-1 mapping is recommended. + * The classmap is exported, so that other modules in the group can + * link to it and control their prdbgs. */ DYNDBG_CLASSMAP_DEFINE(map_disjoint_bits, DD_CLASS_TYPE_DISJOINT_BITS, D2_CORE, @@ -107,19 +95,18 @@ DYNDBG_CLASSMAP_DEFINE(map_level_num, DD_CLASS_TYPE_LEVEL_NUM, V0, "V0", "V1", "V2", "V3", "V4", "V5", "V6", "V7"); /* - * now add the sysfs-params + * for use-cases that want it, provide a sysfs-param to set the + * classes in the classmap. It is at this interface where the + * "v3>v2" property is applied to DD_CLASS_TYPE_LEVEL_NUM inputs. */ - -DYNDBG_CLASSMAP_PARAM(disjoint_bits, p); -DYNDBG_CLASSMAP_PARAM(level_num, p); +DYNDBG_CLASSMAP_PARAM(p_disjoint_bits, map_disjoint_bits, p); +DYNDBG_CLASSMAP_PARAM(p_level_num, map_level_num, p); #else /* TEST_DYNAMIC_DEBUG_SUBMOD */ - /* - * in submod/drm-drivers, use the classmaps defined in top/parent - * module above. + * the +1 members of a multi-module group refer to the classmap + * DEFINEd (and exported) above. */ - DYNDBG_CLASSMAP_USE(map_disjoint_bits); DYNDBG_CLASSMAP_USE(map_level_num); @@ -180,5 +167,6 @@ static void __exit test_dynamic_debug_exit(void) module_init(test_dynamic_debug_init); module_exit(test_dynamic_debug_exit); +MODULE_DESCRIPTION("test/demonstrate dynamic-debug features"); MODULE_AUTHOR("Jim Cromie "); MODULE_LICENSE("GPL"); diff --git a/lib/test_dynamic_debug_submod.c b/lib/test_dynamic_debug_submod.c index 9a893402ce1a..0d15f3ffe466 100644 --- a/lib/test_dynamic_debug_submod.c +++ b/lib/test_dynamic_debug_submod.c @@ -1,6 +1,9 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Kernel module for testing dynamic_debug + * Kernel module to test/demonstrate dynamic_debug features, + * particularly classmaps and their support for subsystems, like DRM, + * which defines its drm_debug classmap in drm module, and uses it in + * helpers & drivers. * * Authors: * Jim Cromie @@ -8,3 +11,7 @@ #define TEST_DYNAMIC_DEBUG_SUBMOD #include "test_dynamic_debug.c" + +MODULE_DESCRIPTION("test/demonstrate dynamic-debug subsystem support"); +MODULE_AUTHOR("Jim Cromie "); +MODULE_LICENSE("GPL"); From patchwork Tue Jul 2 21:57:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720388 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 84862C30658 for ; Tue, 2 Jul 2024 21:58:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E7F6B10E6D2; Tue, 2 Jul 2024 21:58:39 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PH8Ois3j"; dkim-atps=neutral Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6E3C210E6D4; Tue, 2 Jul 2024 21:58:37 +0000 (UTC) Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7f38da3800aso181520739f.0; Tue, 02 Jul 2024 14:58:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957517; x=1720562317; darn=lists.freedesktop.org; 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=gkFYDr1/VaUp9nR5GtDe+QedLaRcp6UcXGPB2Rd9f4k=; b=PH8Ois3j24lhziXveIncfAhxBdxwo+VFm6cTTN0jJNqqMyb8UCPF4dsflpLoJQsC9n 5j8XHaK58fJ6tjD3VcLWaIPi3eOI8+RPR828lmWC1g8isJV41ljPiiz8vJxSdQofftmG e3lrvZJHTf1q9dfLIrDM4eTAEvbhW9i1cGku1AACsgHk8h4/E2G5ziIMaZPMrlGrfomw mnQzYGcLIbPROYRfUsC42DMAAYuT4K+bXrWNXs8ZoDQDx1nm0iiW8QbhhVcuPyJtjV92 LorsNXIXX5gB/O/SDElbTaTDmE7NT3yppAmCioe0RXnTGZiHld6jQs5zHHCnsjKtFIMq TfYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957517; x=1720562317; 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=gkFYDr1/VaUp9nR5GtDe+QedLaRcp6UcXGPB2Rd9f4k=; b=nWa68YwNmD/cF1aYMKgpOeJzyLYUkUSOcKXwTj79F5b5/1mhpxHNQPSNGS0iGQoetI nv24ahmk7IqUGf1gidTa/UABgLhHG7q+hMgo/Ah76ua2FMDt8svsw4algnpde5usrCaL M33tGBe3UACVBt+YTJubARZvNfGFdqTdgSrVTKECPTEczDbGmgiAZM7TLQTKU+7qW6op SXvYoHbJuY3xViG8TrqGMTIFjEBtg2ERIupMYoqO2EtvGDcVxE8itdPe4U3kiBbMlOP/ P2Y6/xMxUmt4mLPGVNESiYXHADXQgksEsMgyzN6Wql4Wa7vTqi7giPItfy6mFiSp/32t ZPWw== X-Forwarded-Encrypted: i=1; AJvYcCUIP4mVFHyxWJLPmFvzHQln9VhvcAGS1bR0XDEN7sOVGh/hccig1DqMNYH7LkZAGP/PyF0ZGxYS6CkELl+WY8RH/VsOP5bXWuQSPEBPShy3fzD4Ce5CKMcrS2BALS16IaHX1D24PrQSSfc6GTxgpIAYoogz6bVO1gpr/k88WM7eblO5jP8UcWImJgvef+Ot4qBzD5QzYlUH0O9xCBDBDQk9+zasnJ/OC19Q0PQbbmCTsLvrjMs= X-Gm-Message-State: AOJu0YxSj69fOaFQR1w4kiuJtVNe+d0yjZ4i/Is1blywQhIhw4iNVmTe a5UfUNnOE77gJ3A+YbhEGIlSvKxmpsS7zBRKkNaIP++5Ejp9bYZA X-Google-Smtp-Source: AGHT+IHrYge+G9SxEL7voNd3XWXoqJIq9/3lBcjxHvh2FJylH832o2Rfwee+jZnNxzuJYbl2IZHY9Q== X-Received: by 2002:a05:6602:355:b0:7f6:1dff:e364 with SMTP id ca18e2360f4ac-7f62ee02647mr1168440039f.1.1719957516607; Tue, 02 Jul 2024 14:58:36 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:36 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie , linux-doc@vger.kernel.org Subject: [PATCH v9 18/52] dyndbg-doc: add classmap info to howto Date: Tue, 2 Jul 2024 15:57:08 -0600 Message-ID: <20240702215804.2201271-19-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Describe the 3 API macros providing dynamic_debug's classmaps DYNDBG_CLASSMAP_DEFINE - create, exports a module's classmap DYNDBG_CLASSMAP_USE - refer to exported map DYNDBG_CLASSMAP_PARAM - bind control param to the classmap DYNDBG_CLASSMAP_PARAM_REF + use module's storage - __drm_debug cc: linux-doc@vger.kernel.org Signed-off-by: Jim Cromie --- v5 adjustments per Randy Dunlap v7 checkpatch fixes v8 more --- .../admin-guide/dynamic-debug-howto.rst | 63 ++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst index 6a8ce5a34382..742eb4230c6e 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -225,7 +225,6 @@ the ``p`` flag has meaning, other flags are ignored. Note the regexp ``^[-+=][fslmpt_]+$`` matches a flags specification. To clear all flags at once, use ``=_`` or ``-fslmpt``. - Debug messages during Boot Process ================================== @@ -375,3 +374,65 @@ just a shortcut for ``print_hex_dump(KERN_DEBUG)``. For ``print_hex_dump_debug()``/``print_hex_dump_bytes()``, format string is its ``prefix_str`` argument, if it is constant string; or ``hexdump`` in case ``prefix_str`` is built dynamically. + +Dynamic Debug classmaps +======================= + +Dyndbg allows selection/grouping of *prdbg* callsites using structural +info: module, file, function, line. Classmaps allow authors to add +their own domain-oriented groupings using class-names. Classmaps are +exported, so they referencable from other modules. + + # enable classes individually + :#> ddcmd class DRM_UT_CORE +p + :#> ddcmd class DRM_UT_KMS +p + # or more selectively + :#> ddcmd class DRM_UT_CORE module drm +p + +The "class FOO" syntax protects class'd prdbgs from generic overwrite:: + + # IOW this doesn't wipe any DRM.debug settings + :#> ddcmd -p + +To support the DRM.debug parameter, DYNDBG_CLASSMAP_PARAM* updates all +classes in a classmap, mapping param-bits 0..N onto the classes: +DRM_UT_<*> for the DRM use-case. + +Dynamic Debug Classmap API +========================== + +DYNDBG_CLASSMAP_DEFINE - modules use this to create classmaps, naming +each of the classes (stringified enum-symbols: "DRM_UT_<*>"), and +type, and mapping the class-names to consecutive _class_ids. + +By doing so, modules tell dyndbg that they have prdbgs with those +class_ids, and they authorize dyndbg to accept "class FOO" for the +module defining the classmap, and its contained classnames. + +DYNDBG_CLASSMAP_USE - drm drivers invoke this to ref the CLASSMAP that +drm DEFINEs. This shares the classmap definition, and authorizes +dyndbg to apply changes to the user module's class'd pr_debugs. It +also tells dyndbg how to initialize the user's prdbgs at modprobe, +based upon the current setting of the parent's controlling param. + +There are 2 types of classmaps: + + DD_CLASS_TYPE_DISJOINT_BITS: classes are independent, like DRM.debug + DD_CLASS_TYPE_LEVEL_NUM: classes are relative, ordered (V3 > V2) + +DYNDBG_CLASSMAP_PARAM - modelled after module_param_cb, it refers to a +DEFINEd classmap, and associates it to the param's data-store. This +state is then applied to DEFINEr and USEr modules when they're modprobed. + +This interface also enforces the DD_CLASS_TYPE_LEVEL_NUM relation +amongst the contained classnames; all classes are independent in the +control parser itself. + +Modules or module-groups (drm & drivers) can define multiple +classmaps, as long as they share the limited 0..62 per-module-group +_class_id range, without overlap. + +``#define DEBUG`` will enable all pr_debugs in scope, including any +class'd ones. This won't be reflected in the PARAM readback value, +but the class'd pr_debug callsites can be forced off by toggling the +classmap-kparam all-on then all-off. From patchwork Tue Jul 2 21:57:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 30A3FC3271E for ; Tue, 2 Jul 2024 21:58:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A5AB710E6D9; Tue, 2 Jul 2024 21:58:39 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aOHQBi1X"; dkim-atps=neutral Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id F24E610E6D4; Tue, 2 Jul 2024 21:58:38 +0000 (UTC) Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-7f3d3919a4aso177934839f.1; Tue, 02 Jul 2024 14:58:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957518; x=1720562318; darn=lists.freedesktop.org; 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=xowWZ+ekpberKm26oOQ15iL0A2hZa3GfKHRI1+lg3PY=; b=aOHQBi1XFsD765qBQ6eQhFteMLwMbeImg+FrDeSzAepr9dSlhkkEBQLopwYca5kmCq QpNVVMd1XWgFG4mI8NYk+hqJezXA2+IvxB6Z1+hQekNKHrQXR8pHJcsjIX1ezdDKn3g/ Frlrl/tFgKnDE+rjA3dgrLFGMoEJppN6a94a2I4rZlSROrfaIpSqncSivNFb/xSp2T5q You/34fq8WAmSzMcWNvdwU9da3Epo8KArwWe8LlGAvvlA+AQ1m3tprlTV3jWcWlxt1BN /7vT7PvzUSpqCOY+Dr0BMg0nvLA5hmsuRH1jB9PFYT+Ht/AwDwY51Rxi7WzNJVL/ZOzP Wkbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957518; x=1720562318; 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=xowWZ+ekpberKm26oOQ15iL0A2hZa3GfKHRI1+lg3PY=; b=KoYGBZWVJuQ7UftFN/d9wwYogKyJ/lrg0y5xfsgnnp6HmitpJlEcnGfbV0iJKAOc5p 17AEJPLz1B8FY2qAULGSYr6dP5hUog7mdLOXuW649K7050sIa1zZCUGRcO03G+7nGSWb DJABOgOLfcsk1FuWngxAJ6okEL9KkKt6CtrirAF5oMnHraQjBgxLaPo3wCG6/4M0yZko XujPObKEOmCGjpKhO3mGpn1ZotlGybCScr6nN6Ys4+paiCeUZZn++MjCl44hQ1+h0xmS 7H2uhQfr404fHsJmYD0ca/x550/tplTQnkgLipnHWywECWt+FvTVhvBrVmKbtgJNLp4f gtBw== X-Forwarded-Encrypted: i=1; AJvYcCVANsTntpZOnyrFYf0tzjIaJ2p75FsDrCeD9AoXpjAuKksw8BqsYQjVeduEIhS9i/qpBrCyWWAbpuNI62fu+Fy9/r+K4nb4qZdjtcRzByT8q7FtLA5gcKBu61GkT3vTaczxLd7HK6qdtC2UbRWkPL70eqB6mFpx64EkV/FPBc1SV3tXt1uV6P4D9s4XC439u4PvM9ex0mwh8eoVDYKAw7sSi3k3j+HbpwkF39x4+iyU9P8eTEY= X-Gm-Message-State: AOJu0YxOWwiroMt5ynKDV4N0aohAUoboKGTJauEvIQa/aiqzql2JEr9R WfcF5cCIQY9TMfSMBgS63MW/zZoqP7YGpWAX9I6xxM7Xdiz2UGg/ X-Google-Smtp-Source: AGHT+IFEGPMJ0Jh14wpvUFc2djetIH1c1nAPVR9FTMSLomEU1MSc3gn/62MyPuGbMB621f76l28FXg== X-Received: by 2002:a05:6602:2bfa:b0:7f3:d731:c6df with SMTP id ca18e2360f4ac-7f62ee501eamr1142864839f.10.1719957518165; Tue, 02 Jul 2024 14:58:38 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:37 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 19/52] dyndbg: treat comma as a token separator Date: Tue, 2 Jul 2024 15:57:09 -0600 Message-ID: <20240702215804.2201271-20-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Treat comma as a token terminator, just like a space. This allows a user to avoid quoting hassles when spaces are otherwise needed: :#> modprobe drm dyndbg=class,DRM_UT_CORE,+p\;class,DRM_UT_KMS,+p or as a boot arg: drm.dyndbg=class,DRM_UT_CORE,+p # todo: support multi-query here Given the many ways a boot-line +args can be assembled and then passed in/down/around shell based tools, this may allow side-stepping all sorts of quoting hassles thru those layers. existing query format: modprobe test_dynamic_debug dyndbg="class D2_CORE +p" new format: modprobe test_dynamic_debug dyndbg=class,D2_CORE,+p Signed-off-by: Jim Cromie Co-developed-by: Łukasz Bartosik Signed-off-by: Łukasz Bartosik --- lib/dynamic_debug.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index e9a95b0f3757..235d85765b63 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -290,6 +290,14 @@ static int ddebug_change(const struct ddebug_query *query, return nfound; } +static char *skip_spaces_and_commas(const char *str) +{ + str = skip_spaces(str); + while (*str == ',') + str = skip_spaces(++str); + return (char *)str; +} + /* * Split the buffer `buf' into space-separated words. * Handles simple " and ' quoting, i.e. without nested, @@ -303,8 +311,8 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords) while (*buf) { char *end; - /* Skip leading whitespace */ - buf = skip_spaces(buf); + /* Skip leading whitespace and comma */ + buf = skip_spaces_and_commas(buf); if (!*buf) break; /* oh, it was trailing whitespace */ if (*buf == '#') @@ -320,7 +328,7 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords) return -EINVAL; /* unclosed quote */ } } else { - for (end = buf; *end && !isspace(*end); end++) + for (end = buf; *end && !isspace(*end) && *end != ','; end++) ; if (end == buf) { pr_err("parse err after word:%d=%s\n", nwords, @@ -592,7 +600,8 @@ static int ddebug_exec_queries(char *query, const char *modname) if (split) *split++ = '\0'; - query = skip_spaces(query); + query = skip_spaces_and_commas(query); + if (!query || !*query || *query == '#') continue; From patchwork Tue Jul 2 21:57:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B65EEC31D97 for ; Tue, 2 Jul 2024 21:58:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 16A4E10E6D4; Tue, 2 Jul 2024 21:58:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jnlpaID/"; dkim-atps=neutral Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6403210E6D0; Tue, 2 Jul 2024 21:58:40 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7f649f7868dso113914939f.2; Tue, 02 Jul 2024 14:58:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957519; x=1720562319; darn=lists.freedesktop.org; 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=86vugQ8piC6pzh4RgCq/qOTI8lQn1pJMR2FsXqHUdq8=; b=jnlpaID/1fdqwbPDJAY8bgzP0tfZwSFbDbnVHt4O2bKBgBbpGJ7L77n9+AX/OoC2jO r+p4CWANtFxbEGtBVy9h3S5/nYGSYtNpK3eDOILEOJmyr6wa5QZe0Nlw1g9DS0Z5PDxb NZdxq8iY+0kmN81GyKChd2apuSgszHDTyNNZxz5ep2lyzoJapg2q9GBYbcgDxO1DWpYc I3AjnKRUdeSMP86XqPWvHU+tYutInjYXYfI+XUKu5hy6BjsZhCGHBVR7Os3KByaCR9os oJRl90ZfHyW1ezCYqOoQ3WZzkaGMARHW/jtgk7jIHEBnmxuDClTPXdI1fO6oSKUzpE9C oT3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957519; x=1720562319; 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=86vugQ8piC6pzh4RgCq/qOTI8lQn1pJMR2FsXqHUdq8=; b=Qt4VdOl/A89yVGhqFWmetCSgSsFyezdEs6edBhX1sXilfhaRn2AGNuGao3cHacDgvO r/DtTBAF4ZxGOmeRPP1DTIKlSdMWOAU1urRNPM4zxVFUkAS5bHAaaLYfE+D1aMFVM0YI 1whzltT4EzFntyKC01MtsVS5zVrYE+be9ufWgS3LKlhMdKUrW6VbhwRu41wmEjs94F2U 1aI+2EAKbA229s4KYwyiodtQxH/38vNlSUuSMdNuvcxlDTp/UBisGYn8kU/EfG+qco9N GZ4GyltgcAySmcsazkuHyAHYEpTub5EUiHqejAgdSM87lwklN7NzaRFQoLLZ0qHyffns l75g== X-Forwarded-Encrypted: i=1; AJvYcCXcK2QAiox9X1qppUWGwD61MoYIzh1/bDp+PLu2HYmKzVfd6WYZSWpUVsNJi0ucXVajQ5G83UkL4Wg85Xa92oMGz9K2E+eaWYsoII82i+vNF2OGwDQWa8z+u/L7q3Nd68HBd8yDQ61uPsBb9NyN0gEOxQ3Tuh1x/YAkGvO6smfCQUqCQBkE4mN4Cgdg4mrdIADfBVqDVZZUTgwAWcQMY28XoKzlZecfuy/MAvtQRWpiKbaDJIg= X-Gm-Message-State: AOJu0YyoEtvv7pyuMBP7w2kr9M3f9urvUk9uBacblbY8afJBL7ruKJS2 Om1PJWgvMv7Zhe8su2du/clFb3ZTKh2m7vhJR0g9y20a+PP4x0kW X-Google-Smtp-Source: AGHT+IFh4NknMSqrRunexz7bPyO+GFuFsoZTUZjnQuX30OfvbKxEu2+OkmD/dNXRlYHLCXi/CEVDEA== X-Received: by 2002:a05:6602:15c2:b0:7f6:19b9:3a3b with SMTP id ca18e2360f4ac-7f62edfe2e9mr1313056939f.1.1719957519578; Tue, 02 Jul 2024 14:58:39 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:39 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 20/52] selftests-dyndbg: add comma_terminator_tests Date: Tue, 2 Jul 2024 15:57:10 -0600 Message-ID: <20240702215804.2201271-21-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" New fn validates parsing and effect of queries using combinations of commas and spaces to delimit the tokens. It manipulates pr-debugs in builtin module/params, so might have deps I havent foreseen on odd configurations. Signed-off-by: Jim Cromie --- .../selftests/dynamic_debug/dyndbg_selftest.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index 1be70af26a38..b4ba293ab227 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -212,9 +212,23 @@ EOF ddcmd =_ } +function comma_terminator_tests { + echo -e "${GREEN}# COMMA_TERMINATOR_TESTS ${NC}" + # try combos of spaces & commas + check_match_ct '\[params\]' 4 -r + ddcmd module,params,=_ # commas as spaces + ddcmd module,params,+mpf # turn on module's pr-debugs + check_match_ct =pmf 4 + ddcmd ,module ,, , params, -p + check_match_ct =mf 4 + ddcmd " , module ,,, , params, -m" # + check_match_ct =f 4 + ddcmd =_ +} tests_list=( basic_tests + comma_terminator_tests ) # Run tests From patchwork Tue Jul 2 21:57:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720390 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E10DCC3271F for ; Tue, 2 Jul 2024 21:58:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 51BD510E6CA; Tue, 2 Jul 2024 21:58:42 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ma7wu9lS"; dkim-atps=neutral Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id C24C310E6D0; Tue, 2 Jul 2024 21:58:41 +0000 (UTC) Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-7f3c5af0a04so246283839f.0; Tue, 02 Jul 2024 14:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957521; x=1720562321; darn=lists.freedesktop.org; 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=VIvOBtUs6wwUYmdF+Bm1LKjLjq3TMDH2Ljy+h6N5XvY=; b=ma7wu9lSnSgZ+pP5vJE82Eo++ycWBLgB/lDZG0mBwUbeHTTjn3exehbIhitPMSAZec E0ToH614E9vE4vrFQ+qFc1Tj5zfoeDgqjH7bf3mSZzg3iAfi1Nc2zIdBUonat1SNs+eF 5SjInwwc+CrMjp13M/WpAw39OQy1EWEzbYNzXaANzoq14jzJQ80Opjo95ViOo4KYdo5q pgCO/0vXAaCem+K9MwrnRWvm21f88OkKx+daZZ0sdHgqQjCgVBafuwqfkcryGoE1zSxN aYVg9SVPfB2yDQ5pai7lbTmVpwrjcXdjGX0h20XlnWCVZFnedP0jlBTIcNsQmWHCAKmC UF8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957521; x=1720562321; 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=VIvOBtUs6wwUYmdF+Bm1LKjLjq3TMDH2Ljy+h6N5XvY=; b=uo83AYtDzUJ6CL3+rjOrVdJqFQ32ENP8x/LAMtCTTpPBvX2sBPQoglfbKBJbZkk0Ah s8WFQWP8sf4Jh7ATC/mIIhlj/n7gMVfN03SpmvEcIvdboi0O5znOiub+xW6qvjVl0Ni6 VDdE3nEzwBRSHiJCTO9FGnevgY5FVEA3UKJUSJ4xk3hv+47jdjL6I0DHFZ7nQAfhwdkK BEUivDTQX5Ri46/17DoYKcBteCt7sKk0ohaQW+8xa7k+y0bZSP+X2lwRtnKICyMbeIi8 DAmQ4H6o8AkLJlJRePEoVaAcAQqEZBZclQU7JhdTyLWrnZO0SXigbN1SXOvyOihKGGcV BTKQ== X-Forwarded-Encrypted: i=1; AJvYcCWtoApsMwh/uk0a7aimKhITUj781NZyKx5o/qyKGrOuk0jMlyWOLrIUeaa0qytr91W8O5/RpGYg+ChWAOmhqrBtOGViO5r/HR+XOtYqrtt5gUnhvQMgwt/AySzytQFR3K7vTB0CLBeF4wapeBS/C4ixBafydra3SbJDN/FTohsnp2evhOtdXad7KSoovkHpne641S3EH0xgh6k+UDGoJKmi24pJ9qHZxsV4e/MrgUFKhYJHRbU= X-Gm-Message-State: AOJu0Yw+Znxo4hEr+g+GC0padUZO3co4+NgiuEkq+5ZGoxAmSWKNa8cc TpgJRGWw4PKd6ZduwldGvrhnAu80uC51mAKi80NA6z0embwDMQ/Y X-Google-Smtp-Source: AGHT+IEk2c1hL6ZUgrQgYe6v2wFx5FJYF6vj0/kQsd1seeLP/2lOU4aeFAE+8OqE7VHd9h3YIT7KPg== X-Received: by 2002:a05:6602:1209:b0:7f3:c683:2266 with SMTP id ca18e2360f4ac-7f62edff7b4mr1072199639f.4.1719957520998; Tue, 02 Jul 2024 14:58:40 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:40 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 21/52] dyndbg: split multi-query strings with % Date: Tue, 2 Jul 2024 15:57:11 -0600 Message-ID: <20240702215804.2201271-22-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Since commit 85f7f6c0edb8 ("dynamic_debug: process multiple debug-queries on a line") Multi-query commands have been allowed: modprobe drm dyndbg="class DRM_UT_CORE +p; class DRM_UT_KMS +p" modprobe drm dyndbg=< [ 203.902703] dyndbg: query parse failed [ 203.902871] dyndbg: processed 2 queries, with 0 matches, 2 errs bash: echo: write error: Invalid argument The '%' splits the input into 2 queries, and both fail. Given the limited utility of matching against the working parts of a format string "foo: %d bar %s", nothing is actually lost here. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 235d85765b63..dcec7b3657bb 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -596,7 +596,7 @@ static int ddebug_exec_queries(char *query, const char *modname) int i, errs = 0, exitcode = 0, rc, nfound = 0; for (i = 0; query; query = split) { - split = strpbrk(query, ";\n"); + split = strpbrk(query, "%;\n"); if (split) *split++ = '\0'; From patchwork Tue Jul 2 21:57:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720391 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A1AD6C3065C for ; Tue, 2 Jul 2024 21:58:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D24210E6EE; Tue, 2 Jul 2024 21:58:45 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JohSz+iw"; dkim-atps=neutral Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id C1CF810E6DD; Tue, 2 Jul 2024 21:58:42 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-7eb895539e3so191276539f.2; Tue, 02 Jul 2024 14:58:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957522; x=1720562322; darn=lists.freedesktop.org; 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=aFcSRVkNrMoAaN9TOyRvWGwNcmbCrlZN4vnmf8E27Go=; b=JohSz+iwUD38DJY3ee3bwH4AGn+XA7g88Ra4Y7DtP9RA3Vznl9HfN7RMbnC44zIJHm cb1V8Gq3ChFF77DNR4d13dYAh7mbR4otZfUkO8HJ2ayWTGXNpTj7aV5m4HwNL8WlHdsp PdJL0reWzoh17wbkIcqlGtsAoDa9iuSjMAiQr5h3XUr+2698mgvfCPOWLUHIkUJdPgm2 Fx3548KfvDpNaW76/eUVxow54T4TysBRlGKbTYB6lB2OP2aYx5H1R7/GRfC0c3GQOmwK sjA2ckrAF73SO+J32TQ8qptLGz0nbbJKJb4PQsBeL8qfKFYN8f9pFoEm3z53D4ZEjt+G YfUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957522; x=1720562322; 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=aFcSRVkNrMoAaN9TOyRvWGwNcmbCrlZN4vnmf8E27Go=; b=Wh18UOL7HztEF/TaslOFLQHVuEHvFYn9/R0UISi/jq171qAkld+N5LTBGbmF3F+Ykq mpVsqlMAGCB5nlGdmmKHH4X1itT5TlgZWxQg5bAm6FRl+yq1e2e6hzT4Dwp2OcOaXUVU oDK27pPUEv081Bkzun8kglYuXY75wlzrKTgtWyxgRJBGjYWLvk9FBgXctPt4NhjgKfWD KiKyPgUxynAODJvBivZe9Oh3v9yDk40AN5Nmr6MTOhyVT8fFC+xRC5fttSgZMEQz1JqC I5ykMkeWgR30jCDtmYqoS8DdXQRp/Q8qxO4vohCGtO051K82vIhyr1gea5Q605FXabEF pqVQ== X-Forwarded-Encrypted: i=1; AJvYcCXRNanGOmrYas85OFuiDQJNwzWirPLZHneQxbaHjcMVGGYCZ+O0sC1Ft7yp2myevH76eeEigEXTf7haNS9NtCYe0yOERV3UF4KTTsELJairpkDbPCQ/hPXh5LVv/5a5dy4xYn53yMrD9xiHVUQ4CUeICuix1jzHki17QHg65FOef7J35JtAc66qWDCRravz0B0pe8PAJMEtUR3CyOl48hYS5kM7srsFbQkdLht5iAMtX0iMfQU= X-Gm-Message-State: AOJu0Ywk2aWzfefU7yu2iy+3R1DBJte4/BntLjr6Ne4NDK9tNc4F1Zbz gUXcDukDu/06IkhjI6sLAyFqpOXPO25sWvCk2PLR4lvKynBaEcCseMFfMQ== X-Google-Smtp-Source: AGHT+IF5HPTrp3Ibm1axLqWBCHtlXKaMWg0JUdhWqqnYWUpVoXtgbCh5izMMhwYMrBWm7qH5p9dPSw== X-Received: by 2002:a05:6602:da:b0:7f6:1542:4e94 with SMTP id ca18e2360f4ac-7f62ee9d603mr1046263839f.20.1719957522025; Tue, 02 Jul 2024 14:58:42 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:41 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 22/52] selftests-dyndbg: test_percent_splitting Date: Tue, 2 Jul 2024 15:57:12 -0600 Message-ID: <20240702215804.2201271-23-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This does basic testing of classmaps using '%' separated multi-queries. It modprobes test_dynamic_debug with several classes enabled, and counts to verify that the expected sites show the enablement in the control file. Signed-off-by: Jim Cromie --- .../dynamic_debug/dyndbg_selftest.sh | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index b4ba293ab227..996e6fdcfb52 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -226,9 +226,30 @@ function comma_terminator_tests { ddcmd =_ } + +function test_percent_splitting { + echo -e "${GREEN}# TEST_PERCENT_SPLITTING - multi-command splitting on % ${NC}" + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + ddcmd =_ + modprobe test_dynamic_debug dyndbg=class,D2_CORE,+pf%class,D2_KMS,+pt%class,D2_ATOMIC,+pm + check_match_ct =pf 1 + check_match_ct =pt 1 + check_match_ct =pm 1 + check_match_ct test_dynamic_debug 23 -r + # add flags to those callsites + ddcmd class,D2_CORE,+mf%class,D2_KMS,+lt%class,D2_ATOMIC,+ml + check_match_ct =pmf 1 + check_match_ct =plt 1 + check_match_ct =pml 1 + check_match_ct test_dynamic_debug 23 -r + ifrmmod test_dynamic_debug +} + tests_list=( basic_tests comma_terminator_tests + test_percent_splitting ) # Run tests From patchwork Tue Jul 2 21:57:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720392 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1C62CC30658 for ; Tue, 2 Jul 2024 21:58:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6889B10E6E1; Tue, 2 Jul 2024 21:58:45 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aj09Ig5z"; dkim-atps=neutral Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id BE60B10E6D5; Tue, 2 Jul 2024 21:58:43 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-7f3d884e70bso237614539f.3; Tue, 02 Jul 2024 14:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957523; x=1720562323; darn=lists.freedesktop.org; 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=mXTp2HWUUrTrRl4eZ7svqhTsXgDwW8WuleRWg/xTtcY=; b=aj09Ig5zw5Tpifgg5tA+DPEqE7BQP/JmH4pbOXSpKQxwU6bw6nGSD0t2RkczCDJrgE qW5dBPR4qQHp/5Ugtqcb9yyfIji2xi9HDzPqAWtPDaT3ODQNfipDAyzFPIqpKg9/36tW e+oaeOjA4jMGfsE9nE2g4opLSX1+56AQbjUwOXbICFNFIRxLaeagU13pi2M62VrgeMVG 2U2DsDv4PAWPEDW6APosCfglRuEizjUI8Q/E0ksMlx7XyArXJ0JELeRN8TMdTdG7Q/k9 c4BVDUSL+0J5mzVU+EDDaJkmGxzqmhQh4ncEOBdsZfctZh1kE/p8TKgWzKKmqbj5qwFk 1J7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957523; x=1720562323; 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=mXTp2HWUUrTrRl4eZ7svqhTsXgDwW8WuleRWg/xTtcY=; b=li39809FfHFqDDkNU/F5F9iua/eVe4/BXtjSNpX4zS0l9uNPLvT//r9Fc1WnZ2zI6e 7GlumHLDmkcTLMZBHegmZz445sXlcFN3kf6JU4qCoi7k9RfyZ0HCrgdRyiXU5HZdqjVn g55VqfEW/RXvaxhbEdb7L4RU8fQdUSHnWJp8c4rGJ90aonJCLYTLJ23RdN/bSAyN+Vx6 KhSgdZOvbdwWLfEeGLnCVL3JpMEpLJGOpAiB1f7MlSKMg9KAzJUxXjIdRNBp7/nyQkGS wWO0iI8yn9NsYNfAVaGcnvs7Kv3UHVyRjqvl2y6ogbdym+JlYWo0/NFs/0JEH6GCN4/Y LbpA== X-Forwarded-Encrypted: i=1; AJvYcCXEibKjMUssellP4Vkl3kXIt0KoLN3//K0JJa9cZ079znakVi6Mf+5RNFdtekGZh+19my9qVCBwx/MmZgq7umy3ahp20UQZND9HJyiJNJXAePcP7KIxBVjudq66ElNRNiQysD5N+cTWEhfuQkJX3FjbvihehtOnTWNg3bsdou5r0taH6EyCVCrN9Cqx3S0wSE8oH7f4pJMK7RD6qUVkqBxnJ8krg0EhEfEA+noy6+hhHepjwCA= X-Gm-Message-State: AOJu0Yxp5Lzauj5ukCVR4+p47OoNDutt41Hyk6ifh1/r/+EYsUgUR2hc MEiF5SJYXUCgP/tR+Y0RQE9ryf4vlKs1la3M5eEXhGgtYrYma0Yf X-Google-Smtp-Source: AGHT+IFrIiyJSkf6W2TunW5BCKgPQouB2T+lSzdbM4fMP+xI9st2vbvsZqO7st8XPig5Y++ArDLzWQ== X-Received: by 2002:a05:6602:355:b0:7f6:1dff:e364 with SMTP id ca18e2360f4ac-7f62ee02647mr1168457139f.1.1719957523053; Tue, 02 Jul 2024 14:58:43 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:42 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 23/52] docs/dyndbg: explain new delimiters: comma, percent Date: Tue, 2 Jul 2024 15:57:13 -0600 Message-ID: <20240702215804.2201271-24-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add mention of comma and percent delimiters into the respective paragraphs describing their equivalents: space and newline. Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst index 742eb4230c6e..7b570f29ae98 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -73,16 +73,18 @@ Command Language Reference ========================== At the basic lexical level, a command is a sequence of words separated -by spaces or tabs. So these are all equivalent:: +by spaces, tabs, or commas. So these are all equivalent:: :#> ddcmd file svcsock.c line 1603 +p :#> ddcmd "file svcsock.c line 1603 +p" :#> ddcmd ' file svcsock.c line 1603 +p ' + :#> ddcmd file,svcsock.c,line,1603,+p -Command submissions are bounded by a write() system call. -Multiple commands can be written together, separated by ``;`` or ``\n``:: +Command submissions are bounded by a write() system call. Multiple +commands can be written together, separated by ``%``, ``;`` or ``\n``:: - :#> ddcmd "func pnpacpi_get_resources +p; func pnp_assign_mem +p" + :#> ddcmd func foo +p % func bar +p + :#> ddcmd func foo +p \; func bar +p :#> ddcmd <<"EOC" func pnpacpi_get_resources +p func pnp_assign_mem +p @@ -104,7 +106,6 @@ The match-spec's select *prdbgs* from the catalog, upon which to apply the flags-spec, all constraints are ANDed together. An absent keyword is the same as keyword "*". - A match specification is a keyword, which selects the attribute of the callsite to be compared, and a value to compare against. Possible keywords are::: @@ -128,7 +129,6 @@ keywords are::: ``line-range`` cannot contain space, e.g. "1-30" is valid range but "1 - 30" is not. - The meanings of each keyword are: func @@ -153,9 +153,11 @@ module The given string is compared against the module name of each callsite. The module name is the string as seen in ``lsmod``, i.e. without the directory or the ``.ko`` - suffix and with ``-`` changed to ``_``. Examples:: + suffix and with ``-`` changed to ``_``. + + Examples:: - module sunrpc + module,sunrpc # with ',' as token separator module nfsd module drm* # both drm, drm_kms_helper From patchwork Tue Jul 2 21:57:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720394 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48929C3065C for ; Tue, 2 Jul 2024 21:58:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B534310E6D0; Tue, 2 Jul 2024 21:58:47 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ggNXmQrn"; dkim-atps=neutral Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id DB12210E6E7; Tue, 2 Jul 2024 21:58:44 +0000 (UTC) Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-7f3d59ff826so173097939f.3; Tue, 02 Jul 2024 14:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957524; x=1720562324; darn=lists.freedesktop.org; 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=gJdYoevwZB2aGfv474+weXhid0sQKo8sv3F+UqQdL9E=; b=ggNXmQrn2ll5FPQv8EHN9AtEEGZ16oNHj6yJtHot0eOkakJGElv84NaonGDisCK68o HUnl4aa1A6Lwn94/tNn+LnZ5Kxntk+0czFMnR5uEtjT66IRlfJMtmlKh1LCixao7qEDi StS3HzYHOz7g+b5rjjMqbIPjGBMd1lwIFvM6MuMG5J45KCB5BwqMaJS+NYYUfbdoZBqj KqBLyNI5qPBnjjyzkE4S1ZQS+tXQim0nVtfy4Z/U70NDYZIKF14++vKvZMjCATHQzpom dZkKiXZ/uct/ZgfzjYEMAFUvBEbJDrG/UXMUZzskvgsXgjxri+auYanYdYaFUO9PMJXk yaBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957524; x=1720562324; 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=gJdYoevwZB2aGfv474+weXhid0sQKo8sv3F+UqQdL9E=; b=bho90CBEWGMn8fJY9UJUB9KRr3CM+6tcPgAZ1WmapESYLIhqezClGFuWeMlpEI/h69 Tg+5FS7bZn2J/28uQZ7SEoCIkpCjDUsHXw8g48CoMOePGDamsZQtfnupbVsG1AmeXh9r 9Ypf/OQkPWx30JTsMLko1dpQ3B9icKq2/mjqNqqF4xIksq2nq8zGi6j7Kg6hVzp5Q6Rt AVlbTut9IrzaZrMniwfyQZjcAnTzLgYaWVC0Kqok3A4XMM6xDmL4x9/73O35Oh/uoBrU BNq9Fpeq/oW7qhv7OeEnIN/AgYP+N9l5vf/+VeLa/xT5Z7gcmAYzxEWQk4naWK49p2b9 hBdQ== X-Forwarded-Encrypted: i=1; AJvYcCVlc6bKPGVlQ8tH7EJE2GBZ1QEWbhZTnQCG7flTbnVw1XOWea16SZ5WuVMJMvCfYzJzo8a4JWrjHQTVjMk5qStFwfQuhUOYc+KafCneg1EPL0xVhDNGtNLllGHxJQKmHQhd2kKzIXS0BbgFnp+TDePfJ2fcJJGazpes/POeIOdFUQdIQfURwc8d440by815LmrjQ1WfpqQKY8IF9mjrgs2ZBB1BeXlgyGyY1InQRU+UTnrMS84= X-Gm-Message-State: AOJu0Yw+4nZ29DYoE6RrSCMIv39OGvVnd7Rv6w5JXeq+Boi+AOwpsaVr R512UaDJS8NEPd8uytB0uAMAzc/5g014dJk/uRGlsipyP57GAYVR X-Google-Smtp-Source: AGHT+IEgboiDOACnMDW/LW0FiCtZfq/bakC9SgKt/T+YKx18pvft97POgcA+NAVH1NrTKBqUsmzF2g== X-Received: by 2002:a5e:d606:0:b0:7eb:d640:274 with SMTP id ca18e2360f4ac-7f62ee622b1mr1057775039f.10.1719957524024; Tue, 02 Jul 2024 14:58:44 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:43 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 24/52] selftests-dyndbg: add test_mod_submod Date: Tue, 2 Jul 2024 15:57:14 -0600 Message-ID: <20240702215804.2201271-25-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This new test-fn runs 3 module/submodule modprobe scenarios, variously using both the generic dyndbg= modprobe arg, and the test-module's classmap-params to manipulate the test-mod*'s pr_debugs. In all cases, the current flag-settings are counted and tested vs expectations. The 3rd scenario recapitulates the DRM_USE_DYNAMIC_DEBUG=y failure. 1. 2 modprobes (super then sub), with separate dyndbg=class-settings check module specific flag settings 2. modprobe submod, supermod is auto-loaded set supermod class-params check expected enablements in super & submod 3. modprobe super, with param=setting (like drm.debug=0x1ef) modprobe submod validate submod's class'd pr_debugs get properly enabled The test uses multi-queries, with both commas and percents (to avoid spaces and quoting). This is the main reason the test wasn't earlier in the patchset, closer to the classmap patches its validating. With some tedium, the tests could be refactored to split out early tests which avoid multi-cmds, and test only the class-params. Signed-off-by: Jim Cromie --- .../dynamic_debug/dyndbg_selftest.sh | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index 996e6fdcfb52..fccd2012b548 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -246,10 +246,77 @@ function test_percent_splitting { ifrmmod test_dynamic_debug } +function test_mod_submod { + echo -e "${GREEN}# TEST_MOD_SUBMOD ${NC}" + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + ddcmd =_ + + # modprobe with class enablements + modprobe test_dynamic_debug \ + dyndbg=class,D2_CORE,+pf%class,D2_KMS,+pt%class,D2_ATOMIC,+pm + + check_match_ct '\[test_dynamic_debug\]' 23 -r + check_match_ct =pf 1 + check_match_ct =pt 1 + check_match_ct =pm 1 + + modprobe test_dynamic_debug_submod + check_match_ct test_dynamic_debug_submod 23 -r + check_match_ct '\[test_dynamic_debug\]' 23 -r + check_match_ct test_dynamic_debug 46 -r + + # no enablements propagate here + check_match_ct =pf 1 + check_match_ct =pt 1 + check_match_ct =pm 1 + + # change classes again, this time submod too + ddcmd class,D2_CORE,+mf%class,D2_KMS,+lt%class,D2_ATOMIC,+ml "# add some prefixes" + check_match_ct =pmf 1 -v + check_match_ct =plt 1 -v + check_match_ct =pml 1 -v + # submod changed too + check_match_ct =mf 1 -v + check_match_ct =lt 1 -v + check_match_ct =ml 1 -v + + # now work the classmap-params + # fresh start, to clear all above flags (test-fn limits) + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + modprobe test_dynamic_debug_submod # get supermod too + + echo 1 > /sys/module/test_dynamic_debug/parameters/p_disjoint_bits + echo 4 > /sys/module/test_dynamic_debug/parameters/p_level_num + # 2 mods * ( V1-3 + D2_CORE ) + check_match_ct =p 8 -v + echo 3 > /sys/module/test_dynamic_debug/parameters/p_disjoint_bits + echo 0 > /sys/module/test_dynamic_debug/parameters/p_level_num + # 2 mods * ( D2_CORE, D2_DRIVER ) + check_match_ct =p 4 -v + echo 0x16 > /sys/module/test_dynamic_debug/parameters/p_disjoint_bits + echo 0 > /sys/module/test_dynamic_debug/parameters/p_level_num + # 2 mods * ( D2_DRIVER, D2_KMS, D2_ATOMIC ) + check_match_ct =p 6 -v + + # recap DRM_USE_DYNAMIC_DEBUG regression + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + # set super-mod params + modprobe test_dynamic_debug p_disjoint_bits=0x16 p_level_num=5 + check_match_ct =p 7 -v + modprobe test_dynamic_debug_submod + # see them picked up by submod + check_match_ct =p 14 -v +} + tests_list=( basic_tests + # these require test_dynamic_debug*.ko comma_terminator_tests test_percent_splitting + test_mod_submod ) # Run tests From patchwork Tue Jul 2 21:57:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720393 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D6B00C31D97 for ; Tue, 2 Jul 2024 21:58:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 49E5310E6DB; Tue, 2 Jul 2024 21:58:46 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UfGz+Xuk"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id DF3FE10E6D8; Tue, 2 Jul 2024 21:58:45 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7f3cd802729so172614839f.1; Tue, 02 Jul 2024 14:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957525; x=1720562325; darn=lists.freedesktop.org; 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=c/0f+WJi9XEdvmbVJJgJH3wGY/BCuH90DF46SNcsdjc=; b=UfGz+XukE+Jm2YCPv1g/tpuWwDvMfcnSQWU3gGesVVxUJ5WIqUb2MYyYOcafo6uh5J 0xi7aUyDie/56nNmKshjdSw2QGyFG3UNvsetmCwqEl3j5L85QvnYoeGnld/pLyG6ZADJ yZcvbyeZDQD95VIibAm4NLmrhgNlTMQlosXGAth5PiwJ6rjZoz6t3XCJ2Q6QEcCJ+j8H /E1+FmbUvIreP9DQuAFdyOfhfjnfvz1Yx0+N68IHNgKmRqGodD6+AddSfjhg+hGvsiF4 1iLcnNsgdjC3GCWlRZFrZhelVJFwf9oKTRPE9unbQgEKRHfUI6khhHB29SGWcV00BxPZ EVkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957525; x=1720562325; 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=c/0f+WJi9XEdvmbVJJgJH3wGY/BCuH90DF46SNcsdjc=; b=b+T8fvVY0kR/iWbtWq9AtRMl4JG8h7+ljEayTtAXPHCwLyBSwunVTabBUoXiLipDz7 v1IAlBW0yIReEXSNMm1fyIoGTCDG5hMGgvNwGIwdCq7i+jvjcQ4tayd/3r2tdkYySf9m SZYmoxqtRUn7i3VfeCTvJvmrCH4xwugIYMpZERneqJnUj/PcoytTu3kn3PHK8bJ0Fvhr 6E8qto4SmJqWkrqt2pdmgvJAtn4MdGWaVAyyHfHtA0UnScykGqsamxgwfPKvpFz2dpHn oFz/+3CyBoUzrTT3EfkSFcZjlcSBr4ps0bsHJyYQ8Nkceoh1/LH6TvvGaTkxjnMmdSyX EgqA== X-Forwarded-Encrypted: i=1; AJvYcCUNHIW2l5XU/7uGiL717Cw+w8LFnnGYpXrJ7VwIX1U5hkLHx7Uibag6TLWj3JWYuOmyJ3eKfAJCFhMMDzbLQh2iWdFF6EpYTMmFO7QhUm30TdrCrb70anObmR/uOm9Ky9WCuZXmPMw9vyl1T3I+z2+NIfzkYlz4OGAyn48Eq7y3qqNlm3u4cJw0ZLhkfWolKq3N3M4CEsFiYXUwmBINkkNzBASs+Ou3HrZ9K6MI5aafnjYv+/Y= X-Gm-Message-State: AOJu0YycDMs+I4gfn25O4RCEEc6OHGL6PZGLeeEu1y2XbLiJbKQK2xTq btOjDpJrKlFOWFZohrPARquMQvZIlKEoqyiXxge9aCCsy4DFZPHy X-Google-Smtp-Source: AGHT+IHLfOgNFYNQh7piopnisG8tXecKttMpNNloe2nsbJJt7+ulnb0/PNAJxeVF6b/DwLmUpVs2Gg== X-Received: by 2002:a6b:f212:0:b0:7f6:2b2d:8acd with SMTP id ca18e2360f4ac-7f62ee3d967mr1225918439f.8.1719957525100; Tue, 02 Jul 2024 14:58:45 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:44 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 25/52] dyndbg-doc: explain flags parse 1st Date: Tue, 2 Jul 2024 15:57:15 -0600 Message-ID: <20240702215804.2201271-26-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" When writing queries to >control, flags are parsed 1st, since they are the only required field. So if the flags draw an error, then keyword errors aren't reported. This can be mildly confusing/annoying, so explain it instead. This note could be moved up to just after the grammar id's the flags, and before the match-spec is detailed. Opinions ? Signed-off-by: Jim Cromie --- Documentation/admin-guide/dynamic-debug-howto.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst index 7b570f29ae98..ccf3704f2143 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -106,6 +106,16 @@ The match-spec's select *prdbgs* from the catalog, upon which to apply the flags-spec, all constraints are ANDed together. An absent keyword is the same as keyword "*". +Note: because the match-spec can be empty, the flags are checked 1st, +then the pairs of keyword values. Flag errs will hide keyword errs: + + bash-5.2# ddcmd mod bar +foo + dyndbg: read 13 bytes from userspace + dyndbg: query 0: "mod bar +foo" mod:* + dyndbg: unknown flag 'o' + dyndbg: flags parse failed + dyndbg: processed 1 queries, with 0 matches, 1 errs + A match specification is a keyword, which selects the attribute of the callsite to be compared, and a value to compare against. Possible keywords are::: From patchwork Tue Jul 2 21:57:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0DDF6C30658 for ; Tue, 2 Jul 2024 21:58:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E63310E6DE; Tue, 2 Jul 2024 21:58:48 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="flxSH+D8"; dkim-atps=neutral Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id EB3EA10E6DC; Tue, 2 Jul 2024 21:58:46 +0000 (UTC) Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-7f65715fe2cso34948539f.0; Tue, 02 Jul 2024 14:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957526; x=1720562326; darn=lists.freedesktop.org; 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=AlDKvAdBKoPRv/bIs38+uKi/tkvNJDzr4jduq2zKdbM=; b=flxSH+D8KmbVhPjqwmkFs4Zjew1GLvCq2f5JqM0lq2GttBpUeWE46hkqI718Ty8cMr V7N4xSVkxrpSW1VA7FWNGkLUTVYM1A+2EzliGpzCO2cM6Xs6uVBE2FZ1qTmwtlSFrxgX DyjiUShUUr2GjK17avrVmX28FMhsShMsOMGcVcn9/LPUYq1vR6VEM5GvGfrFhcd/a16f /HQIjSZ3n42jE/xAbfS8L2yu1r+DVQ1XOw0ksyt9cBuPPF80U7Ui7ERA/dJtDSUuQ0a7 /uIfX3eL9MqEsjYrDJkwYdzoLuz1cCc6CWk2OQmfMKdw9AESvMVaFttsqLdNIGkVeBHr mv/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957526; x=1720562326; 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=AlDKvAdBKoPRv/bIs38+uKi/tkvNJDzr4jduq2zKdbM=; b=rmn4ARhN/my5FHjegTj1AF0N6ckhCfbsOl9519rppgDy+VneZyLg7DlaXywjbZ9DnS Ik9ndvMlfiGCMXF+HHN5hHtgDbAUvAcyOHdpTfJlWPstP9m9fI5Uxc72T7DUC85LDkDY MUhb2nG9Wp+424zID91CS2bvImR/LMPrwxtcS4jE2eXtGC7G7TPZ1N5Z+pRdDLtkRDU0 eUPvY4OErboAxosv03v8fbltp5ZIQ6ltOwbCOG/vAMyDa096gfcFw7y33F9jZQTedkBL H5OKTwTc94ePI8Rto+zRKZlnYElgXTgEHh1ScETzy2JsWj7hdzczZ+X10+KBdKAG0ePt 0kSg== X-Forwarded-Encrypted: i=1; AJvYcCUwtn13TfHcSRqaXtWDTBtY21E0jOxtenYiIAgRxwef1AYBdJYCb/BEKDFcc0RNnMOFooNsbeQOrZPsBAeIewR92TdwTeghR4h1YHt3swZvcvEcTk4cUs9OfL3dKLgJozGCPdk28EYkrESvprGaanHIL0uLpVzE2cdjnKkb577brA10bKqGZO4AwzZZaKxHnG/TM2/HeiuRg3Zy2sRyvRFRyhwwkcP4FTVX/XWMfwd+t0c95Z0= X-Gm-Message-State: AOJu0YzkJuGMnH4lML3PgkEQJ9AGODpdXUbBAB0q7+NqRiI/nQs3nlS1 +29+LnsYxMViMu9t9bZ59UXCeID9nNJdVoNLirPDlz+SouAzIk9h X-Google-Smtp-Source: AGHT+IEykACPg8Yuh6xy1PBNO3lKJQHFEEJ8ReiFUL2QHWIsQS/wu8Ny162mn5gSs3mLVbeCJLAYLw== X-Received: by 2002:a6b:ce01:0:b0:7eb:7887:a496 with SMTP id ca18e2360f4ac-7f62ee118a2mr1185180239f.4.1719957526148; Tue, 02 Jul 2024 14:58:46 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:45 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 26/52] dyndbg: change __dynamic_func_call_cls* macros into expressions Date: Tue, 2 Jul 2024 15:57:16 -0600 Message-ID: <20240702215804.2201271-27-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The Xe driver's XE_IOCTL_DBG macro calls drm_dbg() from inside an if (expression). This breaks when CONFIG_DRM_USE_DYNAMIC_DEBUG=y because the invoked macro has a do-while-0 wrapper. if (cond && (drm_dbg("expr-form"),1)) { ... do some more stuff } Fix it by changing __dynamic_func_call_cls{,_no_desc} macros into expressions, by replacing the do-while-0s with a ({ }) wrapper. In C, all legal expressions are also legal statements, as converted by the trailing semi-colon in a statement-style macro invocation: drm_dbg("statement form"); Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 19f959f9a6b4..121a66b0ca25 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -287,20 +287,20 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, * (|_cls): adds in _DPRINT_CLASS_DFLT as needed * (|_no_desc): former gets callsite descriptor as 1st arg (for prdbgs) */ -#define __dynamic_func_call_cls(id, cls, fmt, func, ...) do { \ +#define __dynamic_func_call_cls(id, cls, fmt, func, ...) ({ \ DEFINE_DYNAMIC_DEBUG_METADATA_CLS(id, cls, fmt); \ if (DYNAMIC_DEBUG_BRANCH(id)) \ func(&id, ##__VA_ARGS__); \ -} while (0) +}) #define __dynamic_func_call(id, fmt, func, ...) \ __dynamic_func_call_cls(id, _DPRINTK_CLASS_DFLT, fmt, \ func, ##__VA_ARGS__) -#define __dynamic_func_call_cls_no_desc(id, cls, fmt, func, ...) do { \ +#define __dynamic_func_call_cls_no_desc(id, cls, fmt, func, ...) ({ \ DEFINE_DYNAMIC_DEBUG_METADATA_CLS(id, cls, fmt); \ if (DYNAMIC_DEBUG_BRANCH(id)) \ func(__VA_ARGS__); \ -} while (0) +}) #define __dynamic_func_call_no_desc(id, fmt, func, ...) \ __dynamic_func_call_cls_no_desc(id, _DPRINTK_CLASS_DFLT, \ fmt, func, ##__VA_ARGS__) From patchwork Tue Jul 2 21:57:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720396 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B26E4C31D97 for ; Tue, 2 Jul 2024 21:58:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1441B10E6E8; Tue, 2 Jul 2024 21:58:49 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lCNcOtD6"; dkim-atps=neutral Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1223010E6D8; Tue, 2 Jul 2024 21:58:48 +0000 (UTC) Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-7f6309e9f29so165188839f.0; Tue, 02 Jul 2024 14:58:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957527; x=1720562327; darn=lists.freedesktop.org; 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=Gt92vv+l+QrwNWjlUzQRBip24zXOkaNnGwWlphVTLFQ=; b=lCNcOtD60z6/lffkqzbQGu2EP4n7jyaR8sVCweWiKQRsIt/hxvJTRSYwzAQo4SQ0Dv WwUWihlHT88PpHSnFf7ZhU/zk5wZ8cyzBqzFRRVzxdYA6z2Phf9on1g6cOL619LtpZGr 5qXz4lwUsYOLDPliSTrlf1GXXJopZDyhVuEFR/yVIuL6F7EHYR5chValxYV8y3HyEaj2 io7wahKLST9cc8LSfmwi8YClqgssYq479WPKGCUQtBLRwJO5B1ozZLEnxKDTqkTVhZuf fj2aRNhB9JYMUQ7uX2iWPpND7kzZHkcxRKfzx2DTPGvazujb+JSTqYbKRgD8uhuVvqbX 0ObA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957527; x=1720562327; 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=Gt92vv+l+QrwNWjlUzQRBip24zXOkaNnGwWlphVTLFQ=; b=e1uRV6ZHs6s95eo6pS02jY2ZXJrT3TF5elZtJiuiW3BME+v4KuM//xoHaTXvVA6O+h V6lcHWU59bd6UTePBiQdQy9FpkzxedFGHw0seJJD/j9XGAPIRVYYPtJRxttHOmxmk7cH UoD6oVAIPScXVwUw9ID6I7caaskLGdTvc+RReZfIfYXALFno8HJm8IbXWvK0b2cvsdFU GVXmtL1tSbblaIFORB4BNjGwzKFSowNNig2futbBY1C5G8+aPw+wCiGUYoRyDsa/z/OR YDeCGXgmjJkD4suOG79hOGBo1npZdMuPAFXS/7hbPCqLYj+VnfiiyyvYkCtydYX/rZzV RQOA== X-Forwarded-Encrypted: i=1; AJvYcCWsamb5oV8SGnUetxu7ayEtXWAybUw7l9SoPFdwNuoqJs6nn6WN+oElEcj98JWag/xIVyCFFGwK7lZ2xPy26Qs52DnbmUklqAOfewusCEfktWQdaWzwDbqQ5BbLlvaBvf34k1SpPloLYuIzHNIYTeu20LtU608ujkcfBJeDplcDUV+hWvD4ezz5JNoZRcuWzLFzKTG5+M7S/9xCpp4CrpBasJ47fZN4SP3XzRDka4HRAdO0BE8= X-Gm-Message-State: AOJu0YxhX7ylJtAAJiHt2sWA8tYM40w/4deTws+JoQY8r2cvB0Y+P58L JradkL8nbIuI0drffGN9T8TvAOKJCNvkOKdvVI76WIGn3lEaKwVz X-Google-Smtp-Source: AGHT+IF3h87zduF7F4ddnH2q9ze+NFD9i3fNyFNxg/0ttCijjGWkOENGZRuQmey084nqd6Ft/oa1CQ== X-Received: by 2002:a5e:de4c:0:b0:7f6:20dd:7117 with SMTP id ca18e2360f4ac-7f62ed4675fmr1103892639f.0.1719957527247; Tue, 02 Jul 2024 14:58:47 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:46 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 27/52] selftests-dyndbg: check KCONFIG_CONFIG to avoid silly fails Date: Tue, 2 Jul 2024 15:57:17 -0600 Message-ID: <20240702215804.2201271-28-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Several tests are dependent upon config choices. Lets avoid failing where that is noise. The KCONFIG_CONFIG var exists to convey the config-file around. If the var names a file, read it and extract the relevant CONFIG items, and use them to skip the dependent tests, thus avoiding the fails that would follow, and the disruption to whatever CI is running these selftests. If the envar doesn't name a config-file, ".config" is assumed. CONFIG_DYNAMIC_DEBUG=y: basic-tests() and comma-terminator-tests() test for the presence of the builtin pr_debugs in module/main.c, which I deemed stable and therefore safe to count. That said, the test fails if only CONFIG_DYNAMIC_DEBUG_CORE=y is set. It could be rewritten to test against test-dynamic-debug.ko, but that just trades one config dependence for another. CONFIG_TEST_DYNAMIC_DEBUG=m As written, test_percent_splitting() modprobes test_dynamic_debug, enables several classes, and count them. It could be re-written to work for the builtin module also, but builtin test modules are not a common or desirable build/config. CONFIG_TEST_DYNAMIC_DEBUG=m && CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=m test_mod_submod() recaps the bug found in DRM-CI where drivers werent enabled by drm.debug=. It modprobes both test_dynamic_debug & test_dynamic_debug_submod, so it depends on a loadable modules config. It could be rewritten to work in a builtin parent config; DRM=y is common enough to be pertinent, but testing that config also wouldn't really test anything more fully than all-loadable modules, since they default together. Signed-off-by: Jim Cromie fixup-kconfig --- .../dynamic_debug/dyndbg_selftest.sh | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index fccd2012b548..d09ef26b2308 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -11,6 +11,30 @@ CYAN="\033[0;36m" NC="\033[0;0m" error_msg="" +[ -e /proc/dynamic_debug/control ] || { + echo -e "${RED}: this test requires CONFIG_DYNAMIC_DEBUG=y ${NC}" + exit 0 # nothing to test here, no good reason to fail. +} + +# need info to avoid failures due to untestable configs + +[ -f "$KCONFIG_CONFIG" ] || KCONFIG_CONFIG=".config" +if [ -f "$KCONFIG_CONFIG" ]; then + echo "# consulting KCONFIG_CONFIG: $KCONFIG_CONFIG" + grep -q "CONFIG_DYNAMIC_DEBUG=y" $KCONFIG_CONFIG ; LACK_DD_BUILTIN=$? + grep -q "CONFIG_TEST_DYNAMIC_DEBUG=m" $KCONFIG_CONFIG ; LACK_TMOD=$? + grep -q "CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=m" $KCONFIG_CONFIG ; LACK_TMOD_SUBMOD=$? + if [ $V -eq 1 ]; then + echo LACK_DD_BUILTIN: $LACK_DD_BUILTIN + echo LACK_TMOD: $LACK_TMOD + echo LACK_TMOD_SUBMOD: $LACK_TMOD_SUBMOD + fi +else + LACK_DD_BUILTIN=0 + LACK_TMOD=0 + LACK_TMOD_SUBMOD=0 +fi + function vx () { echo $1 > /sys/module/dynamic_debug/parameters/verbose } @@ -192,6 +216,10 @@ function check_err_msg() { function basic_tests { echo -e "${GREEN}# BASIC_TESTS ${NC}" + if [ $LACK_DD_BUILTIN -eq 1 ]; then + echo "SKIP" + return + fi ddcmd =_ # zero everything (except class'd sites) check_match_ct =p 0 # there are several main's :-/ @@ -214,6 +242,10 @@ EOF function comma_terminator_tests { echo -e "${GREEN}# COMMA_TERMINATOR_TESTS ${NC}" + if [ $LACK_DD_BUILTIN -eq 1 ]; then + echo "SKIP" + return + fi # try combos of spaces & commas check_match_ct '\[params\]' 4 -r ddcmd module,params,=_ # commas as spaces @@ -226,9 +258,12 @@ function comma_terminator_tests { ddcmd =_ } - function test_percent_splitting { echo -e "${GREEN}# TEST_PERCENT_SPLITTING - multi-command splitting on % ${NC}" + if [ $LACK_TMOD -eq 1 ]; then + echo "SKIP" + return + fi ifrmmod test_dynamic_debug_submod ifrmmod test_dynamic_debug ddcmd =_ @@ -248,6 +283,14 @@ function test_percent_splitting { function test_mod_submod { echo -e "${GREEN}# TEST_MOD_SUBMOD ${NC}" + if [ $LACK_TMOD -eq 1 ]; then + echo "SKIP" + return + fi + if [ $LACK_TMOD_SUBMOD -eq 1 ]; then + echo "SKIP" + return + fi ifrmmod test_dynamic_debug_submod ifrmmod test_dynamic_debug ddcmd =_ From patchwork Tue Jul 2 21:57:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720397 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03A4FC3271E for ; Tue, 2 Jul 2024 21:58:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 64E8610E6D6; Tue, 2 Jul 2024 21:58:50 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SB8obxTM"; dkim-atps=neutral Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id 143E310E6E7; Tue, 2 Jul 2024 21:58:49 +0000 (UTC) Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-7f3cd2c0a79so167774439f.1; Tue, 02 Jul 2024 14:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957528; x=1720562328; darn=lists.freedesktop.org; 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=FUz2fuyNm0/W+cer/IlT8tdUcSLjwR0swYFnYz1+7bA=; b=SB8obxTMY8VShzYnCjwVB0T13vpBZf3limFd/lYaLVCaIpwP5MeAkSKwoFYqRQ5vve M60Fs0Nlj2nlyJ1aCpkLhtfPnAERfxzUjCNgL6YWe6Cm80h6wJY49mnjNTZTt24+i0xp 4O8m/bIf1l3eRz9u7SdtTxT7AE6pt6VptJsdAH/zq2aluNgUNOm9iOApkVBwo1XdhSCo KVhf6g500qL2oAbIdzhvy+bEPp/LsHAUuIMN2tGSqQWIf3+v8QhViTtIhuGyouMPco2z DlcsZ+85MVohKLpMzdmoe+8Ohx0OowXPwKBIPOEt3MQNvlxSSX4wRjTbNArPRkaYzBOz qBgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957528; x=1720562328; 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=FUz2fuyNm0/W+cer/IlT8tdUcSLjwR0swYFnYz1+7bA=; b=qDgp3L3Fj5FFsNPoqSxKs22JfNY8jzZRsidDVGgcYGt2K0LjoSCONlD+OnWnc4I+08 QjHLf9mzJCHEPqQ6+i1tR4Zv36GwOzJMUk35nohfNUnE+hxV25O/venBAzlaYoeRz8/D 6dh+i2btCunoP63qrmSqY17cLK5LVzpWzjx5HQL9GxxYK55FABFFbpE+QdZQ59Wy9nK3 L+VbuPboZRGkyRfTTN/tCZ1Ijsj6TSuXVxLRAryR56yBho/FBBX6cb4W58JyrluqaHp6 PFD2rXw/K+1OF6EjD1TIFXvdR/FxKrLU5aUH7JukeBiu5BYDlFPjwnBFxSvSxZKdQYpR +YNg== X-Forwarded-Encrypted: i=1; AJvYcCV5+WSUFxDAVyyQuhMAz06A8vw+eZu7df0rBN5Yczr+3e2WLPinKEFR90sLV4Ry7JiByk6ZDFIYNDDPsJLyPy9D6JPc2jo6jyuYMBus9Fx+xz+fy5ey43b4DDlRpfu0N1FFRAZ08vmet3Oku6h4ek1SD5316udGZ76e9x6xI/tBBc+u6mqtzfeMRmdyzkcWU9xegcQYfYqWJRBc07QqeCDNhPHV7unx9ba4c9JXWoFqXLPJ/Ls= X-Gm-Message-State: AOJu0Yyi9+9Ut72Fa7Npl6q8E1rrl/c2Ft2aoMT42A5GQttYav+7Gu4E BQUuf4RNw0i0/ZVf9dXXegNA2F/2EfsONsbmGvvAZX0Iy86yWGSx X-Google-Smtp-Source: AGHT+IHBWcQbF7AzwbpraWmmrtlRBjOUVEzWk/QMFIDiv3bq2LCfSxlC7rVZKZrSP+Cf2khVoPBz0Q== X-Received: by 2002:a5d:8453:0:b0:7f3:d649:9fff with SMTP id ca18e2360f4ac-7f62ed4c918mr1080653939f.0.1719957528255; Tue, 02 Jul 2024 14:58:48 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:47 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 28/52] dyndbg-selftest: reduce default verbosity Date: Tue, 2 Jul 2024 15:57:18 -0600 Message-ID: <20240702215804.2201271-29-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Remove the '-v' arg from the tests in test_mod_submod(). Setting V=1 in the environment turns it back on, for all tests. Signed-off-by: Jim Cromie --- .../dynamic_debug/dyndbg_selftest.sh | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index d09ef26b2308..b3d7155cb45c 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -168,7 +168,6 @@ function error_log_ref { } function ifrmmod { - lsmod | grep $1 2>&1>/dev/null || echo $1 not there lsmod | grep $1 2>&1>/dev/null && rmmod $1 } @@ -316,13 +315,13 @@ function test_mod_submod { # change classes again, this time submod too ddcmd class,D2_CORE,+mf%class,D2_KMS,+lt%class,D2_ATOMIC,+ml "# add some prefixes" - check_match_ct =pmf 1 -v - check_match_ct =plt 1 -v - check_match_ct =pml 1 -v + check_match_ct =pmf 1 + check_match_ct =plt 1 + check_match_ct =pml 1 # submod changed too - check_match_ct =mf 1 -v - check_match_ct =lt 1 -v - check_match_ct =ml 1 -v + check_match_ct =mf 1 + check_match_ct =lt 1 + check_match_ct =ml 1 # now work the classmap-params # fresh start, to clear all above flags (test-fn limits) @@ -333,25 +332,25 @@ function test_mod_submod { echo 1 > /sys/module/test_dynamic_debug/parameters/p_disjoint_bits echo 4 > /sys/module/test_dynamic_debug/parameters/p_level_num # 2 mods * ( V1-3 + D2_CORE ) - check_match_ct =p 8 -v + check_match_ct =p 8 echo 3 > /sys/module/test_dynamic_debug/parameters/p_disjoint_bits echo 0 > /sys/module/test_dynamic_debug/parameters/p_level_num # 2 mods * ( D2_CORE, D2_DRIVER ) - check_match_ct =p 4 -v + check_match_ct =p 4 echo 0x16 > /sys/module/test_dynamic_debug/parameters/p_disjoint_bits echo 0 > /sys/module/test_dynamic_debug/parameters/p_level_num # 2 mods * ( D2_DRIVER, D2_KMS, D2_ATOMIC ) - check_match_ct =p 6 -v + check_match_ct =p 6 # recap DRM_USE_DYNAMIC_DEBUG regression ifrmmod test_dynamic_debug_submod ifrmmod test_dynamic_debug # set super-mod params modprobe test_dynamic_debug p_disjoint_bits=0x16 p_level_num=5 - check_match_ct =p 7 -v + check_match_ct =p 7 modprobe test_dynamic_debug_submod # see them picked up by submod - check_match_ct =p 14 -v + check_match_ct =p 14 } tests_list=( From patchwork Tue Jul 2 21:57:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720398 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8CD5FC3065C for ; Tue, 2 Jul 2024 21:58:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DBB6210E6D8; Tue, 2 Jul 2024 21:58:50 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JZwEcyue"; dkim-atps=neutral Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1719D10E6D6; Tue, 2 Jul 2024 21:58:50 +0000 (UTC) Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-7f3cc78afb6so165124539f.0; Tue, 02 Jul 2024 14:58:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957529; x=1720562329; darn=lists.freedesktop.org; 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=kydKHLvNbnZg3PNir0Er7pU83Hek2HX1+Oh0xgNXyIg=; b=JZwEcyuejXEaIxW+gBF1Q7d2tRtoNY6J71kjFOfGFc0bWyxdfaXBODF5NASfbQUo1O 7qtsqLzLTYxYMcNnjZe5bPwn4xa5g7LfqyKKRlfhJz03bMBhWex0Pk6iNP+f4Tkk/6/H xGUJeT26tJG7oLS5WP9QZQUDXnLsUvxoHHRSuQ4PV0WdmMMMLLwhyuXpQXqLwVKPplZG WNyD+DsywFBen65cE+WWy7hUqwKHlEyh3AUaKPqpUktDdTaZf51Bbf1HLvfCN40bRysK vHHrDUY9eRLAQbAtVC1yX3b0tv8qQomcBcVzm7yj0HrxyGa67ohUjjSL6XSGBiacV8GS VWtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957529; x=1720562329; 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=kydKHLvNbnZg3PNir0Er7pU83Hek2HX1+Oh0xgNXyIg=; b=pUqT0gbp0K9pdTClYmhbc2F1ZMLhJP33lljI3auMmlBKU2tX2BwyFYzIH1S3r9sbul ZOA1o32dsskgxxle478TjY8cgRstvWsHJDphb/Yty7+Ba4RXBUw5JW5+rl4tAuWN7neD K4NCw/zef6wrNe0dvbofd1qnuMwRhgoD8VbfD7jATGVftVaN4zE71ZNpPhxEl3/gU8ce WEnYggEPSroS0lm/krBmgZHsW8brK8QkS2FGOa6uAisVMPbHMoESpKOpZGR8lOv8yArE 9/8gZkGaauup6coHtXJL/76sdVu+5fkDSQmvPG5Wmcpxg6H5wP41YfW6OmOTrGnY+zLk raBw== X-Forwarded-Encrypted: i=1; AJvYcCUGBy7aWN21W1hjGCZSOHfIKQZOEVtAHiMukvEgAXJX8oZ9qhUsLofg+VjOWb857bFR8H0ucYyj2mZCLrYYImNfrCfrbC/Wcldko/qz7NrafxocPQZtBmX2BsGoJYgLqNwe4h0WdhZ2Oar1935MtvxZSG8GXj+qTxiNrAc9pAJXG+wmpllO+AAF7jIaYqp/J57AhgUYNNMrRhoCk82wU/aS4W5E7rT+5mlZKa6CGr7t6eJYtzs= X-Gm-Message-State: AOJu0Yz6tdI0NEkMEiH5+QjaYGKcxpO1/AD8ultiZX+LpdgWKtlv+4DS ftpb63dj+uZAII4VxYvwmBwzZ+z06TahIy4zGsJri8xkEi7cgYCW X-Google-Smtp-Source: AGHT+IHiT4qyllY61e86gEC6NbmhhO5i7DHIdNJWIww0KazUvs2igsL+Uh2C87ePfk+pKL5jlhS9Bw== X-Received: by 2002:a5d:8455:0:b0:7f5:bd0c:b532 with SMTP id ca18e2360f4ac-7f62ed69020mr1001616339f.0.1719957529366; Tue, 02 Jul 2024 14:58:49 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:48 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 29/52] drm: use correct ccflags-y spelling Date: Tue, 2 Jul 2024 15:57:19 -0600 Message-ID: <20240702215804.2201271-30-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Incorrectly spelled CFLAGS- failed to add -DDYNAMIC_DEBUG_MODULE, which broke builds with: CONFIG_DRM_USE_DYNAMIC_DEBUG=y CONFIG_DYNAMIC_DEBUG_CORE=y CONFIG_DYNAMIC_DEBUG=n Also add subdir-ccflags so that all drivers pick up the addition. Fixes: 84ec67288c10 ("drm_print: wrap drm_*_dbg in dyndbg descriptor factory macro") Signed-off-by: Jim Cromie --- drivers/gpu/drm/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 104b42df2e95..313516fc2ad5 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -3,7 +3,8 @@ # Makefile for the drm device driver. This driver provides support for the # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. -CFLAGS-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) += -DDYNAMIC_DEBUG_MODULE +ccflags-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) += -DDYNAMIC_DEBUG_MODULE +subdir-ccflags-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) += -DDYNAMIC_DEBUG_MODULE drm-y := \ drm_aperture.o \ From patchwork Tue Jul 2 21:57:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720399 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 39763C3065C for ; Tue, 2 Jul 2024 21:58:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A2D4A10E6E2; Tue, 2 Jul 2024 21:58:53 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ATWWM0jC"; dkim-atps=neutral Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 282A510E6DC; Tue, 2 Jul 2024 21:58:51 +0000 (UTC) Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-7f3d2d441e4so148773939f.2; Tue, 02 Jul 2024 14:58:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957530; x=1720562330; darn=lists.freedesktop.org; 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=MxDd/jlN1Gw8bPV0q5UJew/A89joWXWCEanlG0C3i6Q=; b=ATWWM0jChlaXkrt5gwn5hqXssyy3wjUSV2GyqvwJGOu/mkjwDLaDx701sCwc1NcJHl chwNxne5xC48ve3g3Ql+6C90P8yZkRiSHNxSCcIl8S13v0bPzgcMb/btlykbAwtWfCHD XZA3eHYBlN51ASUKFqIxSDwwQChMJ6GjXVMu9hm+RLkt5yFuLiEb34m9DOQQqC0/6aC9 U7cgEpStFcXwgCteaffvyl5QbjP2Y2xD7Xf3ZzrnH1tCCW14KRro46uNEYcJTdjRIgEa 4wO6U4uKodNGW6swcj2YBlwzx5a6deZ2rauVEn0qFaFLCREMlTMBvoQzAXBec9ci/u4J 9AuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957530; x=1720562330; 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=MxDd/jlN1Gw8bPV0q5UJew/A89joWXWCEanlG0C3i6Q=; b=NihAeXPVUjPEkNE6mq09vYY6Qtl7lyfSHyJrGzSTD27gBOF12gVCmOPC6UYugoVR6f u9/0p9cOCpqwcuoamm0xDy5Hno1F+XioMKeuUaaVqzwR08mRf+UTbE4KAusLnvEWnNeU bWy1QxEsiqk8MQDlxBWoFBHeEumU/NDtmenG533MBWgqz4nYFkfl5JkXwbdrY+eutgMk ymhB8Kxmm+p2ETPF2O/zzilY+tVSdtcRXPsjtBeDvqOsJMdb6M0utbpX+KV5rP+spu9D aOYPdZkTeD6H2PMcPHp4o0QUsdgkciN0Z+7c7ls1XyhPE3di0cek8bvf1KlAQRfwVfRK M+DA== X-Forwarded-Encrypted: i=1; AJvYcCUD6EOMA5eiqAen+Q2ZwI5Ind+wxjMjLR4qBK25CR/gE2Waf5sdxWtCkWoJcbYCuBB6Iz/uDgOlb2l/W9sV6Ww0QtB86k5S/zqsNWuDYMxur+pYu9VlLlmZTx8H2PsVIwJujaOHULhEHnxBeCttQqp2EJqwsr6sRd4+9XnWbSF5UumyVMlenEzFqOFBl3kWRqpTxqNZ7PiDhqg188mCUycPxKo3IIS0St3p5IEKrqreibjAg7Q= X-Gm-Message-State: AOJu0YyvTj7D6Z+FD2KMCcqBaqYh3jcnNVe4kI9I4BOqTPYUi9AGjTN6 KbHurwqeuM+vauzNTBgSc4CKqDpMTJpKhasx9zIgC83Kt9A3h6Ax X-Google-Smtp-Source: AGHT+IHA5cWQwG7sGQgG2GsZbHmX9YOZDWo74Sg5hZzfWG9rJh2QlSDlAZETNf1gZpS7tHAO3w2Pzw== X-Received: by 2002:a05:6602:1816:b0:7f6:1f87:70c7 with SMTP id ca18e2360f4ac-7f62ee1b1d7mr1169478639f.11.1719957530383; Tue, 02 Jul 2024 14:58:50 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:49 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 30/52] drm-dyndbg: adapt drm core to use dyndbg classmaps-v2 Date: Tue, 2 Jul 2024 15:57:20 -0600 Message-ID: <20240702215804.2201271-31-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" dyndbg's CLASSMAP-v1 api was broken; DECLARE_DYNDBG_CLASSMAP tried to do too much. Its replaced by DRM_CLASSMAP_DEFINE, which creates & EXPORTs the classmap when CONFIG_DRM_USE_DYNAMIC_DEBUG=y, for direct reference by drivers. The drivers still use DECLARE_DYNDBG_CLASSMAP for now, so they still redundantly re-declare the classmap, but we can convert the drivers later to DYNDBG_CLASSMAP_USE Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 25 +++++++++++++------------ include/drm/drm_print.h | 8 ++++++++ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 699b7dbffd7b..4a5f2317229b 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -55,18 +55,19 @@ MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug cat #if !defined(CONFIG_DRM_USE_DYNAMIC_DEBUG) module_param_named(debug, __drm_debug, ulong, 0600); #else -/* classnames must match vals of enum drm_debug_category */ -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +/* classnames must match value-symbols of enum drm_debug_category */ +DRM_CLASSMAP_DEFINE(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, + DRM_UT_CORE, + "DRM_UT_CORE", + "DRM_UT_DRIVER", + "DRM_UT_KMS", + "DRM_UT_PRIME", + "DRM_UT_ATOMIC", + "DRM_UT_VBL", + "DRM_UT_STATE", + "DRM_UT_LEASE", + "DRM_UT_DP", + "DRM_UT_DRMRES"); static struct ddebug_class_param drm_debug_bitmap = { .bits = &__drm_debug, diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 9cc473e5d353..905fc25bf65a 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -140,6 +140,14 @@ enum drm_debug_category { DRM_UT_DRMRES }; +#ifdef CONFIG_DRM_USE_DYNAMIC_DEBUG +#define DRM_CLASSMAP_DEFINE(...) DYNDBG_CLASSMAP_DEFINE(__VA_ARGS__) +#define DRM_CLASSMAP_USE(name) DYNDBG_CLASSMAP_USE(name) +#else +#define DRM_CLASSMAP_DEFINE(...) +#define DRM_CLASSMAP_USE(name) +#endif + static inline bool drm_debug_enabled_raw(enum drm_debug_category category) { return unlikely(__drm_debug & BIT(category)); From patchwork Tue Jul 2 21:57:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720400 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CE44DC30658 for ; Tue, 2 Jul 2024 21:58:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4BA2610E6E5; Tue, 2 Jul 2024 21:58:54 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="edI3UR31"; dkim-atps=neutral Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3E2F010E6E2; Tue, 2 Jul 2024 21:58:52 +0000 (UTC) Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-7f61f41eef0so205080639f.3; Tue, 02 Jul 2024 14:58:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957531; x=1720562331; darn=lists.freedesktop.org; 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=82cgNbRoYEtZbLGOSF5g6lGYBT3iAgTZZ5N8otaIkxw=; b=edI3UR31Z5ZgSERtLXBBy8YUMytYK/ARdjS6UyKtDx1SoiKTdt3X+z7WIM4L/wsQzE Ef0NOZc5wE/JadxRubGrsSlA5hYOuYr0bpFvYYCBGGeFe+U98oXGEGh04VuOOcW5A/4z 9tXqmucbJRJYYk1/mSQjgvAuGWkQ22Wq4UzetE5R4vkMeyLVDnMuCcqn1ve/Foth4FbL VfoxU1DtITZCBUSplXRVP4TGt0i7ZfhzOcHI0xcTsgIglO96W4WKJaZAevftd+Uu8sv1 Ult0AlXaPasWh+Dqm4ouYoKIWfrZKgnX2oveylV9LYPx/hBmdCbf/hwxQGskFMES3ZAp ERSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957531; x=1720562331; 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=82cgNbRoYEtZbLGOSF5g6lGYBT3iAgTZZ5N8otaIkxw=; b=vHwdDiE+QOybJEWrMuOWNu0HOO3+RaYcdmijJ4xIqWRhNcKoBYKk9C4afHNgR5+piC a0kxtnf9RYESVoaLfplRW10x2MrNPoNEVPCPpU3xG0zv8yzy0+RczK/Ru6brfHCyTk4C iXMacOcCrvdUrNVPXwVRjB4b0EqBW5ryJYlvOdZ1anPu0bMbH7lFUF3zwe57FnQBcB86 tN0rBHSGbUAIAvXZpDO8RZc8ZE7PJ4waAVF7iIiQUCT4Ceh3k2cOQxFMeNbvqVBiEtHf N8CAreVOWgdbRVgDXSZFhz7tS+Soxy5pMzf8onaMV7a0B+yVPP/ZQKK+f3RSeunkzYbE 8lXw== X-Forwarded-Encrypted: i=1; AJvYcCUUfxKFsXYbIRxMiv+lzIeLR022V6ucghyXPS+JxsfOt5/TbRklUkx2y94HKotBjX1KfUYQXTrnP0IOoG+fyIT+zeOfQEcHDVyxZYEGn6kwwo3faEwHTAMomgnzli0S7c/GrddbaLYz+37yeMHLoAq3uD2S8yaBMeYck3TiTUx66vopnpXJZ6UhqDyLK9X2hmSnbjZDyFgrOm/tclzLrlxoEb2JYKCtdTf+tQmwdL95UDq66rQ= X-Gm-Message-State: AOJu0YztCWwpNI3EKV8k1zjA/Gbhfxj/yd8wyeVUnuNkDYJiSjKIdMbk u//VxV0fkzgvnHcoLMvgdSh21m3y7k0RJUm0Id4o4LUIPZB4ixOF X-Google-Smtp-Source: AGHT+IF0XfGuaBZergfyh09/+1cwiSfDW4SSxiw5JoBgqXQoqE0seQNYvFesDvoSIIDGsiZcxnz7Ow== X-Received: by 2002:a05:6602:42c8:b0:7f3:d811:d808 with SMTP id ca18e2360f4ac-7f62eeae89fmr1232570639f.17.1719957531440; Tue, 02 Jul 2024 14:58:51 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:50 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 31/52] drm-dyndbg: adapt DRM to invoke DYNDBG_CLASSMAP_PARAM Date: Tue, 2 Jul 2024 15:57:21 -0600 Message-ID: <20240702215804.2201271-32-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Invoke DYNDBG_CLASSMAP_PARAM to hook drm.debug (__drm_debug) to the DRM_UT_* classmap, replacing the ad-hoc wiring previously doing it. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 8 ++------ include/drm/drm_print.h | 6 ++++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 4a5f2317229b..efdf82f8cbbb 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -69,12 +69,8 @@ DRM_CLASSMAP_DEFINE(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, "DRM_UT_DP", "DRM_UT_DRMRES"); -static struct ddebug_class_param drm_debug_bitmap = { - .bits = &__drm_debug, - .flags = "p", - .map = &drm_debug_classes, -}; -module_param_cb(debug, ¶m_ops_dyndbg_classes, &drm_debug_bitmap, 0600); +DRM_CLASSMAP_PARAM_REF(debug, __drm_debug, drm_debug_classes, p); + #endif void __drm_puts_coredump(struct drm_printer *p, const char *str) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 905fc25bf65a..95c667934bbb 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -141,11 +141,13 @@ enum drm_debug_category { }; #ifdef CONFIG_DRM_USE_DYNAMIC_DEBUG -#define DRM_CLASSMAP_DEFINE(...) DYNDBG_CLASSMAP_DEFINE(__VA_ARGS__) -#define DRM_CLASSMAP_USE(name) DYNDBG_CLASSMAP_USE(name) +#define DRM_CLASSMAP_DEFINE(...) DYNDBG_CLASSMAP_DEFINE(__VA_ARGS__) +#define DRM_CLASSMAP_USE(name) DYNDBG_CLASSMAP_USE(name) +#define DRM_CLASSMAP_PARAM_REF(...) DYNDBG_CLASSMAP_PARAM_REF(__VA_ARGS__) #else #define DRM_CLASSMAP_DEFINE(...) #define DRM_CLASSMAP_USE(name) +#define DRM_CLASSMAP_PARAM_REF(...) #endif static inline bool drm_debug_enabled_raw(enum drm_debug_category category) From patchwork Tue Jul 2 21:57:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720401 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 47C1FC31D97 for ; Tue, 2 Jul 2024 21:58:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B6EFC10E6DC; Tue, 2 Jul 2024 21:58:55 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fujtVhKl"; dkim-atps=neutral Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id A2D1010E6DF; Tue, 2 Jul 2024 21:58:53 +0000 (UTC) Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-7f3cd64e71cso138058539f.3; Tue, 02 Jul 2024 14:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957533; x=1720562333; darn=lists.freedesktop.org; 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=FbmqLbQI8HTQzNGF8HQCP2HSLNy1cuHjZEiMFoqqHgs=; b=fujtVhKl1k6JDElMk5UUNDrhSRanUS0X9t7ZBODeUVo9JlnlcACj9hOX2iR0YgmPk2 tvkpXC9ATRDvXgNwnLdqdlMD3EVtkIYSEcBZRf+QRCXhMUEzjL8aJvl4+wGVifNtTzXv RExA6tXSPr4nz6txtBbXxADb29W3fbBFpnPwS32eqJc9m4e08tlthUHqeWcaGlAFuSMN 697PMz+jWxBKh1pe/RDVYLiZ27twgbhufxSn9JjsROZ9+LJRf9nxHy1PYvyYcyLCJwL6 VjUnaMbOIAyT4IUTFcYACHvcsZ3w4hd5GwM+Qi7+fcUFgiJDctU/Mcq8bY260XTeb+ET QmdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957533; x=1720562333; 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=FbmqLbQI8HTQzNGF8HQCP2HSLNy1cuHjZEiMFoqqHgs=; b=Z7AzoEj74OmMpTx6CiQYiRpV+x7b0SSQXm8oOGvqBXpKstOl+SGUomoS5nimXJQpif KNbrttxFsK+Uoj2tlC1RE7il/4a21YUeyrr7/Kl3fB4qxxwlJMiuj+W2zHwcV2/ljDjF qJJTPRdKWnwgZa2sqE11KjrEiIZDsOYmUFEJ8qXqHKv1mOBkWXxmWoz7Jo8RRp/H+9uD B6Hb7DoEweE+SgOVwumDNfgXAnaXvYPJaqLzvR8dPxBRPI0olipziTm+9Y7tGG2NTVVD OR1vjTSH9Ec/6C/Rh9/M1OZ/6aNuhLeyzxEQf63UdmmZzk6wyAh3zGWVSkyBepLzwJpY o9dw== X-Forwarded-Encrypted: i=1; AJvYcCVHNmh/dgLubEMe8H+OLgkvD0B0041E62T5ys8tijk/JGQTKV4AsvqXINFKClYXE3ThFcswhw2LsY4miT3/thGHps+KzlwiGpNICfQjYHRmPH/24zH7bSfU0H8wpD5QjzC+JIsUozcA42ZFCvL1ylKaSbkKp11nhymPMGNwoWCMCsR+LJyqlYrvWOOkHcMfYICqmNtWspcWcwoQoqDTAGFrNgSxN50glXg1UltxraPPmiJqVi8= X-Gm-Message-State: AOJu0Yy+SxkKItTDC3D3nksPCHWXDf4D+vJEeFwXd14vNKxXSrIVvCZN hOX8FXfBhxASb/zv4iKavlPfP3f7NfubettL/mwiG3KjNH8zPenh X-Google-Smtp-Source: AGHT+IGlV5e4CX2/hYLHSwwmfK8aU2Z7WZzMU6zQISMzjPh/8c+A5mSKEdQB89WlGTCmF6ZX4oDK1g== X-Received: by 2002:a5e:8c05:0:b0:7f6:2b2d:8ad4 with SMTP id ca18e2360f4ac-7f62edff929mr1067071239f.4.1719957532918; Tue, 02 Jul 2024 14:58:52 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:52 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 32/53] DRM-CLASSMAP-USE in drm-drv.c Date: Tue, 2 Jul 2024 15:57:22 -0600 Message-ID: <20240702215804.2201271-33-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" --- drivers/gpu/drm/drm_drv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 243cacb3575c..f511d40f577a 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -56,6 +56,9 @@ MODULE_LICENSE("GPL and additional rights"); static DEFINE_SPINLOCK(drm_minor_lock); static struct idr drm_minors_idr; +/* single ref for all clients ? */ +DRM_CLASSMAP_USE(drm_debug_classes); + /* * If the drm core fails to init for whatever reason, * we should prevent any drivers from registering with it. From patchwork Tue Jul 2 21:57:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720402 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2A09C3065C for ; Tue, 2 Jul 2024 21:58:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1FA7610E6EB; Tue, 2 Jul 2024 21:58:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="i60weS71"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 93BBE10E6DC; Tue, 2 Jul 2024 21:58:55 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7f624e70870so253605039f.3; Tue, 02 Jul 2024 14:58:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957535; x=1720562335; darn=lists.freedesktop.org; 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=UK1rhky1L0Uh2dLu61vy8boLc9OqspSM7tQ5uDrS370=; b=i60weS71qjR1cmbPxH80g4E29ifwPSbgiTskn4tPfFeEGUR3nLDIYTaAMHGIGTH9sl 8u1Egugxd31G/YaDNMb6I4zpUw0RMIO5NZbWGo2yF+ifot5qH/oiKN9em2pqp+UkFyyn +EHjoF2wPVVJeHAwpBw/s4coVUYTo/TH/Mf2ghYrZlt6iEXYL3lrxCQczHDKYXSueURb omWmyFTognoMXxUQvY9fkAKvRy8/HKbzvsB57zLiIf1h8tCK2jmEO3yFxeY7fYYNwRwi KXiTB638tj+VbfOnyzrXyLENHYdxgsw78mpFk4DNMzR1Mjr/0rGcvxTyiXKxhGRU4BAQ obKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957535; x=1720562335; 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=UK1rhky1L0Uh2dLu61vy8boLc9OqspSM7tQ5uDrS370=; b=DrjbDbFl632SJGuDkV3iqn2znjtNJpC9y6wRDH4qDouBsXsASN0BO9jkJg5eeon2J5 hsoH7KRSxDlethA8IIACJfRsla5DJh+oSdhpTdSQEa+H4kep301LXxLr/o4d5E43OZHE Po+qrmwQoz0QbSSzMkT9+1M0vFfb3UCMHkpNrzh28iiHAwosER739qj6xt8ploE6hF55 Gz9xyB9NO+uTVLJ1m/NUFETuy0LPYvaaJ2zUbo6+1tOJ3KN3XcOJrzan8hmBfr1H0a+z 8xYyIaOGjwITgZk2UliDsLikw2PQBDjP4Eaf5AzSnCtk3AI5ayIYx/BZo/IsrNByhC/S tCmA== X-Forwarded-Encrypted: i=1; AJvYcCW6bsKT/fFKX9e6VFqy7/uad5grxElFb8WeziXvCCUwBItBX0b9ISNiN7JIkpKy0o6330fpwAsy/VLOYJ5MHs024u9QUPvaeSBDtSAqpAm8y2uQC+93+pKsnYiEXq5YkP3+Kmq5glJqYQzLMNnVJdtt8mH6v5QckAO8dEaUNcllGcC5DZfJA3MuDI9kPTpcdHypQbN2JWGeN1TNdT4ZyfwAZmXBXSmAP5VTwDwJ2FCmklXpYNk= X-Gm-Message-State: AOJu0Yw/nY7wNoZYaxdfePxWEFsDpLe+7SKEIyyCzIejYu+KJxTPRF2T q4CK9wih97zYVB89wmC2NwroNklKcr9HblEqsbbbc/0geIOUYXbT X-Google-Smtp-Source: AGHT+IHLc/l4rSLolOTsFYm7TsKqkhWE4Jfzo0NU47TaXhV5RuwQAoXmcV+1NSMfPYNESCW3q8/CLQ== X-Received: by 2002:a6b:6106:0:b0:7f6:2e72:e81b with SMTP id ca18e2360f4ac-7f62ee168f6mr1110047139f.4.1719957534832; Tue, 02 Jul 2024 14:58:54 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:54 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 33/53] drm-dyndbg: DRM_CLASSMAP_USE in amdgpu driver Date: Tue, 2 Jul 2024 15:57:24 -0600 Message-ID: <20240702215804.2201271-35-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.") Signed-off-by: Jim Cromie --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index e4277298cf1a..b287f0cfd8fa 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -217,17 +217,7 @@ int amdgpu_damage_clips = -1; /* auto */ static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work); -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); struct amdgpu_mgpu_info mgpu_info = { .mutex = __MUTEX_INITIALIZER(mgpu_info.mutex), From patchwork Tue Jul 2 21:57:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720405 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B8970C30658 for ; Tue, 2 Jul 2024 21:59:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3284810E6DD; Tue, 2 Jul 2024 21:59:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PMkbJMTd"; dkim-atps=neutral Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id B9E9110E6ED; Tue, 2 Jul 2024 21:58:58 +0000 (UTC) Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7f649f7868dso113927639f.2; Tue, 02 Jul 2024 14:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957538; x=1720562338; darn=lists.freedesktop.org; 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=94MIkUtYPNbEjf2ABNxMIbyceZTrdE5XkTP/b1VTHKc=; b=PMkbJMTdPdQr/dHpB6HVSZwPemuDsBX8+EheYur1j5c5BUO5o/bxYQGyydOAh2nLtD hB3nuQ8LziMNkXWC17sgiI6oN6BK6FpyYI0gUKtUvhdgCRHoC5fvpVOsYUuvDCFdO4yk aETnkz22ZeyTjMBfVXBHNSaXGswKEB/fc2qWBdjUSRbOc5kS0htKdiJ90Duq/wOL27uN cY5GIUOHk3N1fKMQ0PBy0WegI0UdcHs4hi4ZC4p6qIhMhcMTbns/wQ2rR6g1/65wRz+0 0lw2Zd2vbuhyMeXjoDMCLqmu30JiBtFxd2eLche2+Zrprl/Q2PzbQeU/KNy8mblLjNLi V4UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957538; x=1720562338; 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=94MIkUtYPNbEjf2ABNxMIbyceZTrdE5XkTP/b1VTHKc=; b=t/wU1dqvHQy+eoLo7Aul7G3J7KM7ks566CRVsybPGVFIh1ZkB8X3Tgdw8TKC2H4AsU 41zhrdjv3GkCK5NV2oxyzZDPDVhBl/91t4P9vC9wPzoKK02z4prHdFtxEMgbmXfACCBa 2gh4H+xXv1XBzhQvHHNxmq54cMl1JMvmK/8rtxkVWPab1PR9/LRI6pb3/1fuYu+tFXs1 IiHvYlngQu35nSl1WzrEh1M9/eDDA2Y3HNqctZX3bj+D2ZPmtcLh+EPRmlTNbyxRQ6nv Mobe6IJMQYnkZ7/+P7AOImRox2I/bBYPR3f3p6dtKF/+9yDKCWlWD4fYgoFgW3fidjpf Xt8A== X-Forwarded-Encrypted: i=1; AJvYcCUvrMg7CQNZQBW8zS0xbud8HolHftCdATDKh2iU9rw7+AEm+CvZK+QwIxy3rhW4kUx8O+1LDZn2q3EhmUKBKFZxNXSF7PEEPTgZRsrpXkheCdbMF5bZ8qXYhbqWG+MxB5gHdt9ZXhiYNWNwb8arPldRZzitYDMjP4bSJQC6t2ceKRrkh8P3e5yRzSIHG7v/xkTvanENVT6WDmJJmmy9L4w9+Nai6XfhNj6kj4L5oxagjRNQOD0= X-Gm-Message-State: AOJu0YxWXR2EMTEw2gRKPV7toAEyjhzb/J+tD9m1kXPNrWH5jrHNH9vB pceloqG+/0GOLAMdm6M2OO5MBfsAICWpo+LpS1ZQlHBgD8/yv6Oc X-Google-Smtp-Source: AGHT+IEeyfoDsrnF6r4ABpMFuIX2eN+Lbm0YqA2PfdZDRQYY0jl8O9vciO2Q9HKa3iN91XoM/brm0g== X-Received: by 2002:a05:6602:600d:b0:7f6:5035:1826 with SMTP id ca18e2360f4ac-7f650351c42mr444802439f.11.1719957538015; Tue, 02 Jul 2024 14:58:58 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:57 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 34/53] drm-dyndbg: DRM_CLASSMAP_USE in i915 driver Date: Tue, 2 Jul 2024 15:57:27 -0600 Message-ID: <20240702215804.2201271-38-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.") Signed-off-by: Jim Cromie --- drivers/gpu/drm/i915/i915_params.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c index de43048543e8..dccf12d05105 100644 --- a/drivers/gpu/drm/i915/i915_params.c +++ b/drivers/gpu/drm/i915/i915_params.c @@ -29,17 +29,7 @@ #include "i915_params.h" #include "i915_drv.h" -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); #define i915_param_named(name, T, perm, desc) \ module_param_named(name, i915_modparams.name, T, perm); \ From patchwork Tue Jul 2 21:57:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720407 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0E556C3271E for ; Tue, 2 Jul 2024 21:59:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B2FE10E6ED; Tue, 2 Jul 2024 21:59:01 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RASZiSGz"; dkim-atps=neutral Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id B78AC10E6E3; Tue, 2 Jul 2024 21:58:59 +0000 (UTC) Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-7f62bb42938so154641139f.2; Tue, 02 Jul 2024 14:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957539; x=1720562339; darn=lists.freedesktop.org; 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=0SUm8Nyqte9xAsE2tQLuwSyCdCfAncJgW1l33uKzz4o=; b=RASZiSGzBISE+oN1MrboB4PK4Nep4VHnkt5dqgNt+X5dng3n8sgCQYR+PAhsAK6BlC G3ixjeOFgl3ZiwkU7VocRRULd6jZ0JLjVCwvYhS+PYYWW1xUBqXeDJCRvbSKblF9lzi1 yxIv9QpNoMute3m16p755giZ1IGVe3vAZ4t1JLHqo0VcbCXZUABupSMwHzuCC7AP7k66 dGbYdQu/WqMK0NvgnbGgrr2Hgiw7+UtX8V2PISHDnq06iO9XctkieDEofOthw4PBqfkq xhpX/K46ajS6wPa8B/WW1QrJnzrIToq3QsxsHMwDfrGQWpLN9lcuK+c7/W+Onp2tCX9d TzXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957539; x=1720562339; 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=0SUm8Nyqte9xAsE2tQLuwSyCdCfAncJgW1l33uKzz4o=; b=Ks9f4Y5QA84uKsM9/mLACEyGASrcH3snsFoIM1AnjELIb3hIiIqakElbm4JtzLpMwH MSTbx57MxJVChxulYlUf5aPkGFMu6eiFWVKWXGIA5STueQVQtcmI2gv4Xed3xBGE92HD Hhv2NBfkpaIi4Frh2I7eGGPg03N93F5W58cc3lhR079d/aaHWkswl7/9eytiiIwtTF2O 4KYGgCW4NAi7b6E4j0suNanYXz6oJOdrTsnahwQJNVUyWxrJqr2GqybKbxi9QE7YeWFd MsZw+plH9AItKIBe6YNJZ1Dkp4/b1daqbayY0ZW0Ju1Gq263hVFp7wbPbpEsyzILgePE k9Bg== X-Forwarded-Encrypted: i=1; AJvYcCXZszmKZnvzJe3puwKc1xHmanTnbkm/cZhfLq1/Q72smWojidOtWyq+VSaW6q+SxdMIbzV2acCwIB9jkuz3lIq8FI2dwc1kzGdH8LvtAmhID5apQ6jLjsBWHLaaOcMxqABp03YNEqhUegTOhfZebN2iiJMwko43nQUdFo3Ayrs56dpSr9pcwzs0xSOyG6GH3AEf3/5ACk7ckvfoudWGpY4qrxz/mP7gtyZHFKjWe/2PtegdBhE= X-Gm-Message-State: AOJu0YyWIrmi7fGPSy4qi9Z6yqJ1BA/Bki6pZwwLB3IGxMCKPBizbUc1 RwZ76RZT93V5pdVTNbt3+pLnvmqRXn62t6wTo/Tn9bccnWSYPTtf X-Google-Smtp-Source: AGHT+IEUnJOZJMWFZCPfI0cb1ttS0mdFvKdodraHs1JHxvSWaTiAIpWzxzSmb2Z5C00Z5H72ikNb1w== X-Received: by 2002:a5e:d606:0:b0:7eb:d640:274 with SMTP id ca18e2360f4ac-7f62ee622b1mr1057821039f.10.1719957538981; Tue, 02 Jul 2024 14:58:58 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.58.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:58:58 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 35/53] drm-dyndbg: DRM_CLASSMAP_USE in drm_crtc_helper Date: Tue, 2 Jul 2024 15:57:28 -0600 Message-ID: <20240702215804.2201271-39-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.") Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_crtc_helper.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 2dafc39a27cb..e9d229a393f4 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -50,17 +50,7 @@ #include "drm_crtc_helper_internal.h" -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); /** * DOC: overview From patchwork Tue Jul 2 21:57:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720409 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2B42AC3065C for ; Tue, 2 Jul 2024 21:59:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8EE2510E6EF; Tue, 2 Jul 2024 21:59:03 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DihhHGoT"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id D737D10E6DF; Tue, 2 Jul 2024 21:59:01 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7f620f349f9so193149739f.0; Tue, 02 Jul 2024 14:59:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957541; x=1720562341; darn=lists.freedesktop.org; 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=Axn4TdT8TpzxyaaFFwTK+y02x0fRA+xhIqgCPO86CS8=; b=DihhHGoTjANxuaUg8J1dqOi6jZykQklU+d4NkHNSoCP7ZUpK8soLrkaWob5dl32TZ5 uniz/Azi0qekqIhc7PIIC+17K0DUVNmhZhtr1/0cXlhWjdPgXwTlfItGkff3ptjjj6jk YU6qf4z5BetI0eVQxlLDXYf8fZShIlrND+y+89UPr7oCIHPjL+7jBBi8M5s1Ueknpk0y 7fEJCCTS36MIreSxj5sqviVu+IIHw8iy9ZNtJXPFZscshOXkxo7rMZlOz/brT4/kksJM 5SnC0LGS+s9KqGIJdGS21viNP3IJ0KCw1SB9ms/SgjFXe5cMFXIu7UYpwi7r/unkwSgq gb9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957541; x=1720562341; 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=Axn4TdT8TpzxyaaFFwTK+y02x0fRA+xhIqgCPO86CS8=; b=GqbRUkv77vS/WB81OTscOKn02lH1MZfeeHs2eMw3cib+bB2bW3C1K7/WHqxSAwaG1o 4n5r1Q2BKDh0E9rKdGTHDZM6eQnTXNb3TrQaVqYeOGu9ZfQJQAy6SO7aihGdm+PHdZgD ljlcxoBL+qcXiliBtuCBE+LOfPW7ITunSjpk6jZMsk1vrnqfq70wHetJEY10FQFN1WGx 21xLnlY9zAKN4qpzI9Sl9HsusLnbY0q+qFvS5SOnfZfQ2NtNuOciaxhJYnvfMbhBSB04 /HhoxVqmJhNumWOFWIgkj5/jIG0Mb+T0qrqtJpHFyBKuKAb6qoTtXRXWoNx16HFMsIBR H0ug== X-Forwarded-Encrypted: i=1; AJvYcCWuqUYhAlNXgkEbOwEUpz4y5nzBWpGcDUb23vk/qKPA+arJW5AMR7ILRWF7jft7mNZaOJQz3ELgaBSITxJ3wL/8njGDG0eLdpuEMj0T/+rhK3gyn3a9yr9DNkOwZLPx1gZ3FhZowzD3cabJmkXeI4AwRQ/OTjPmeuR9WYG1Xy6cPEgVoN2hpXd6ed+fBPSlCb8dNsxseyMSh/C/zTV8d8H0LXWzTxLqMkMU4py6797G//Jj/vA= X-Gm-Message-State: AOJu0YyDrEZiWOT4OtfWV5WmGZzi9jyWXfXh4J6/A070iNd1I7R2kGFV Ut12cbkyazKSuu3q0uxYjZBCkI2PUhqf8O81fVOGb5KaYIWn688E X-Google-Smtp-Source: AGHT+IHjv9k2KwZ55PoCGQdZFNcDsK4OFlHELx0TrRLo/YHjIbxVBPr7YJh6jsm+YsFDmma01GPMGA== X-Received: by 2002:a5d:841a:0:b0:7f3:eda9:8037 with SMTP id ca18e2360f4ac-7f62ee3d7famr1042777939f.7.1719957541077; Tue, 02 Jul 2024 14:59:01 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:00 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 36/53] drm-dyndbg: DRM_CLASSMAP_USE in drm_dp_helper Date: Tue, 2 Jul 2024 15:57:30 -0600 Message-ID: <20240702215804.2201271-41-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.") Signed-off-by: Jim Cromie --- drivers/gpu/drm/display/drm_dp_helper.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c index f5d4be897866..d3a7df09846f 100644 --- a/drivers/gpu/drm/display/drm_dp_helper.c +++ b/drivers/gpu/drm/display/drm_dp_helper.c @@ -41,17 +41,7 @@ #include "drm_dp_helper_internal.h" -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); struct dp_aux_backlight { struct backlight_device *base; From patchwork Tue Jul 2 21:57:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720411 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 662A2C3065C for ; Tue, 2 Jul 2024 21:59:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D650010E6DF; Tue, 2 Jul 2024 21:59:05 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="W7B7RwEQ"; dkim-atps=neutral Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 23F7C10E6E6; Tue, 2 Jul 2024 21:59:04 +0000 (UTC) Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-7e21dfbc310so177447139f.1; Tue, 02 Jul 2024 14:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957543; x=1720562343; darn=lists.freedesktop.org; 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=Qc7kDWbr1ZOLQ8+EMlKcMIOk0gPIa550UiXaV/Fsdqw=; b=W7B7RwEQXDkUp4Y8s3xjUL2EubDTh15y8kDR9XK41jBwNkedNcoSSEfB1xxRVCiM40 ezZHAb7OiZ8DbjG13Ds/cQcyIQI/Sxll1Gg9Rgp/4DDbiGhF3sVkn/32CVKGJRInoJgd VeTXxVNx0yf55P6ukBvPpZ/cDmJjsiZ3liBltRgUNbS1iywNCZWs/FItSAuV+cGHJjxb RXoge3623nopVQHqN9bbfoWUr43IobXp+jg9oABphxED8O2iFdU68E//SjJZSX8e2i21 n0NOtamGm6udNRkKkcYXJskSfS0EjKVmKwoAJAEC8cpF7qCaBx3XwdQrlzQTo1c3HDLJ 3ZVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957543; x=1720562343; 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=Qc7kDWbr1ZOLQ8+EMlKcMIOk0gPIa550UiXaV/Fsdqw=; b=St9jtzKSpet4bmFVRMc5IeLe1sQPWbY2RpVQ7Q/QKxh/3vtG8BPA5eURVQb2Ef7gsX K/VcJD2iS5fiW3Cj3fipdznVDDNn7Q/pf+cqAhbgm1MM1K4mHEybG+QUXPDfde1jVDUd KdxQC/br+gZYi7EIBVXJR0ekuwmSOWJiJ/1ehUTEWqq6ryjotd5vNyIYdalVVQaDAMXa DZXXhuXTK1TITOSSec0dVwPcs1Dc7B9sV1R+1F5S8Wzwkh/aqyqsHz2iR18iBxKj2Civ gXRK7gluO5kC3Mec2T3H4ykdCk6rb1hZn/8jKPztlcAWoS1vVNyVOskhEN+H/wWZ7zrK 5syw== X-Forwarded-Encrypted: i=1; AJvYcCV3tCxXIoQXicSNMJJ4dB15tmsd5euIvA9opwBgheK6zgW5mH833y6peskcE7JuvSdcwewjhdG0YdEgBIXg08wgXX1YS3pcsohJKCNztOculH9Y0l8x0m1z6hnAd+P8/c2zY83IUvwoIbmUyncZkLe6vC6fhAtfZgfess46K3cPPszfi1hEXffIPKC5PTKL4l18FsJObOZTMhpwJg4qZG/RG4dmfrIvoTV7p0yILrT+Qxs2PF4= X-Gm-Message-State: AOJu0Yzyoh6ne3iYmjETv48/Q6940SeydtK8Wj3dDSNQcbzVuITPr36n XiCsddf1Ch2aHEPmWkqUugqcaZi2ggSz6iyVdG88+b3Tj9C3xle4 X-Google-Smtp-Source: AGHT+IFU7HE3OnORXf/jPfIvwK8ZL9okfkzaVw0Y9XlHErXhQ5Il5ia22RtTXqA/C72TmprohxCaoA== X-Received: by 2002:a5e:a819:0:b0:7eb:c68b:8250 with SMTP id ca18e2360f4ac-7f62ee8d422mr1089812139f.18.1719957543284; Tue, 02 Jul 2024 14:59:03 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:02 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 37/53] drm-dyndbg: DRM_CLASSMAP_USE in nouveau Date: Tue, 2 Jul 2024 15:57:32 -0600 Message-ID: <20240702215804.2201271-43-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.") Signed-off-by: Jim Cromie --- drivers/gpu/drm/nouveau/nouveau_drm.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index a947e1d5f309..27995c0c9b31 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -72,17 +72,7 @@ #include "nouveau_uvmm.h" #include "nouveau_sched.h" -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); MODULE_PARM_DESC(config, "option string to pass to driver core"); static char *nouveau_config; From patchwork Tue Jul 2 21:57:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720413 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D5021C3065C for ; Tue, 2 Jul 2024 21:59:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 50ED510E6E4; Tue, 2 Jul 2024 21:59:08 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FrDhDq4p"; dkim-atps=neutral Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0844010E6E6; Tue, 2 Jul 2024 21:59:07 +0000 (UTC) Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-7f649f7868dso113933439f.2; Tue, 02 Jul 2024 14:59:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957546; x=1720562346; darn=lists.freedesktop.org; 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=0tTLQ7kYNablnENIf/KeDz5dGwor+/R9FnQHvwE/Et4=; b=FrDhDq4pexa0xNfuA2LEFm0bRsXzC9BeE9ce0dk86FXzqyLzi14xhTdfrQAAro0Uja SaymzteVhux0BOC762HhUNTfCYyajOO466NCwNrGgeNC7HG5WPm7YJHZFcBXaKgPJCQf 2fIDNGqg4872pgerlbscFXEYRxUHx4WWnCxfxJVcKI82IUG1MUrZoLwgZt/7LGS9Am6/ iEpUU4keVJ0vBR+aawdIqvm3Gww4I2g6N/QNCuplkf/WOycrCFSfIg1/5ahJ4rwzNkR7 MOcLxRAthM7/vRkmU1pSODknH11GBi4e0om4mBaOieqrsc9wx0L1BlrwfqcsDjdL0axf 2B/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957546; x=1720562346; 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=0tTLQ7kYNablnENIf/KeDz5dGwor+/R9FnQHvwE/Et4=; b=lf47A6fBUd7N6JJPnGUl+4a+TZzv3jPR4Qdv0K1osaMn3JT3xDJH5rsDDExNNehAYf jbK6wiOqUTk7r35V4QmKDrlEUbUojnA6UaaAdVYJb5you9be7q10ZmsMlJe3vvhmirJf fULNGhlxw4pmatisaFiQEbxR/GpyyoS0FxiiJcDWmUIF4vjnOgjqkqvaHCFF/a8UIlVK bON+W+bnqltkG2zhXpcS9zRCrTT3d2mYa8ppBkmntYih52fhcdNs+nxGHtImlChNcuoF 03poHXtlzt5bSmkMKMjv6OfOeO6Yo2iSFhyM1paHFqkhU6sEwIhj1adk5KC6EiQAMYCQ C6Ew== X-Forwarded-Encrypted: i=1; AJvYcCWtLkt0f6+Aats8RBjL5JGG5d6wZEUCUSye4gaOWCCrmoW7KvGqNGdcyURqTzm6f+ckDtY/gylnihA7W3oyxdg7CVa4ZhHflZLJqWpeledx62eXc24bOQTKCQQmphsNNpNus8vu3UOk7uX3rGMykfwKmBIQ+OViVHea9HGloLTqhX0kUhfyS8Yoj/NKbJdfnPdXZngJb89/lx8NA/a4eGIkTqg+U66AS9GIecjjZ53XBI77bYE= X-Gm-Message-State: AOJu0Yx85Yo4wBRbxwdsqf/8L7lLWoC1gRiST/c3uDbQtLs/ZKpKj4h8 8eT9BmBmkBx30CoJlErL3kgEOH+SqeUd3eZF3/kYjJ9oiWoLe6V8 X-Google-Smtp-Source: AGHT+IHVzUq+7oBbjRhtfUg8hR7fA0Vm3TWdJRFj0erHJhGLHrI/NeeXyYjOwGHjAwtUEfGXKXA+rQ== X-Received: by 2002:a5e:8f49:0:b0:7f6:1d7e:a9c9 with SMTP id ca18e2360f4ac-7f62ee085a0mr1058272839f.6.1719957546282; Tue, 02 Jul 2024 14:59:06 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:05 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 38/52] drm-dyndbg: add DRM_CLASSMAP_USE to Xe driver Date: Tue, 2 Jul 2024 15:57:34 -0600 Message-ID: <20240702215804.2201271-45-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Invoke DRM_CLASSMAP_USE from xe_drm_client.c. When built with CONFIG_DRM_USE_DYNAMIC_DEBUG=y, this tells dydnbg that Xe uses has drm.debug calls. Signed-off-by: Jim Cromie --- drivers/gpu/drm/xe/xe_drm_client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_drm_client.c b/drivers/gpu/drm/xe/xe_drm_client.c index 87c10bd7958b..c61163d0d945 100644 --- a/drivers/gpu/drm/xe/xe_drm_client.c +++ b/drivers/gpu/drm/xe/xe_drm_client.c @@ -15,6 +15,8 @@ #include "xe_drm_client.h" #include "xe_trace.h" +DRM_CLASSMAP_USE(drm_debug_classes); + /** * xe_drm_client_alloc() - Allocate drm client * @void: No arg From patchwork Tue Jul 2 21:57:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720415 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1D5FDC3271E for ; Tue, 2 Jul 2024 21:59:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 87A6810E6F2; Tue, 2 Jul 2024 21:59:10 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="R1hrGbSJ"; dkim-atps=neutral Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0CA0510E6F2; Tue, 2 Jul 2024 21:59:10 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7eb5dd9f994so174432139f.2; Tue, 02 Jul 2024 14:59:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957549; x=1720562349; darn=lists.freedesktop.org; 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=0tTLQ7kYNablnENIf/KeDz5dGwor+/R9FnQHvwE/Et4=; b=R1hrGbSJDOgO+LXq2CgpDjhGMsO59CdfgMETPNk+KkSKyzw+AMSY/Wr50Yx/h/lxcQ /wLrxo3c4kq40DBz5n+SdRpEJi2QEtiMNVd4CLEjd6cnrCxCXhvKXigUrkvYdRWNEyrj i0OD62Nk/u8RarHAxfA0zrTH2C54NvDneydCwjDNlnVUAlXuaqbkGpbTTG/OPtsQ4v6Z xHD2eoSE6XtrGTjZE6hU/WQVdi7ACITAqcEhL6DmQJWg/yzRaM3pE3YhFdL8db8/V/UW 8KgSstmBne7yxTomxwOr3YrnFWl3AxXvJDDB2ZCd07ojfhM1zgNILSuw0VNwrkKOZz+Y sKtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957549; x=1720562349; 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=0tTLQ7kYNablnENIf/KeDz5dGwor+/R9FnQHvwE/Et4=; b=FEHlLOl9lcPdzwOiJIQP+JiZxnK/kkpY7qlrI26FkUyNlc3R5vpPyfRmDbcJ2H1R6D oLyX8D0w+O4BA2dr2keMzOcdCBrU/IikoZ1U5scMIVM36QjycjkYKgTxY/U6X7/etjhq V8qF/I6EBZKnlMTQ4FMDd49HnyE1/CI+mg//L6x52pUejI7PYHY5SEYRA9tJ0K3TgPHo Cm3M90vmank/I6gd/DfUzH22fvYYmPVDXzrul5cdYVqOLmMER8U96g6bSWixfAaaqa1f 0hpxeF2eCFGOFK0+4eDzdt3DI7L59KrKD21+73vbBV9Ap0TgSnPDdkFn9Th2L6jiLRrL J/pg== X-Forwarded-Encrypted: i=1; AJvYcCUdMLS0WYwgCgxPqLWnj1CJePm73tjBar9WWIfki8Y5GJYT426QKXay0Gq7y5/HupAb5jd6PlY5AUCKlgDHcJ3pzHSG/uFLQeKsMPomK8v5s8JNNw4RUXbStQ+VhTog7IeYV4TXG+5QG5BFDftn3+YXAmO4bLmOAV7pct/b1C6aBcY4jh5NNulL/0RYrzsPnooByL5I7Bb4VtfyPVu9V4Fo5dZELwI9y4wa0WQ6M6drMOZdos0= X-Gm-Message-State: AOJu0YxnYpB7tOY6FAHcwsVB0ShvuNS586ebgnoYDQgPMpcAqCQpa+zk gQpi5NGfi7q5AmJAcgucu7U6mNO3LqIEGhuIyrFbGVAENBqtIkuJy0eanA== X-Google-Smtp-Source: AGHT+IE2I+kZLU2rS/pXH2LWHejqkkSB+OxH8ZpJWiyY2BdB6lV2bIk60uhOaSqkSLWh+0iOsTHn/w== X-Received: by 2002:a05:6602:1651:b0:7f6:51ac:bba9 with SMTP id ca18e2360f4ac-7f651acbd92mr409692939f.10.1719957549276; Tue, 02 Jul 2024 14:59:09 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:08 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 39/53] drm-dyndbg: add DRM_CLASSMAP_USE to Xe driver Date: Tue, 2 Jul 2024 15:57:37 -0600 Message-ID: <20240702215804.2201271-48-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Invoke DRM_CLASSMAP_USE from xe_drm_client.c. When built with CONFIG_DRM_USE_DYNAMIC_DEBUG=y, this tells dydnbg that Xe uses has drm.debug calls. Signed-off-by: Jim Cromie --- drivers/gpu/drm/xe/xe_drm_client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_drm_client.c b/drivers/gpu/drm/xe/xe_drm_client.c index 87c10bd7958b..c61163d0d945 100644 --- a/drivers/gpu/drm/xe/xe_drm_client.c +++ b/drivers/gpu/drm/xe/xe_drm_client.c @@ -15,6 +15,8 @@ #include "xe_drm_client.h" #include "xe_trace.h" +DRM_CLASSMAP_USE(drm_debug_classes); + /** * xe_drm_client_alloc() - Allocate drm client * @void: No arg From patchwork Tue Jul 2 21:57:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720417 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4538EC3065C for ; Tue, 2 Jul 2024 21:59:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B7B2F10E6E7; Tue, 2 Jul 2024 21:59:12 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bYaRLu8b"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id F3CA410E6F5; Tue, 2 Jul 2024 21:59:10 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7f61f41eef0so205093239f.3; Tue, 02 Jul 2024 14:59:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957550; x=1720562350; darn=lists.freedesktop.org; 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=wzxAaDu6jznCkYGTIESxKGj+agIaj+uEvHm/3W7k4f4=; b=bYaRLu8bRvedLrNBl13wFrRm6W7dHu5+oj6WI7hLTcECxpZX5NyAjS3N5oSaRCpl2X 2vgkMGKl4T2LFauOht6qeW7YemC1Rtsf6uL4RHUdP57rKb0z7yE3+UhPODNnnp6CM7KH 9n4jt4wvaNXk30c6DXHSBYfVOO21DJMDoulqHdppYUFVjWhzHtNJFDfKz2ZmDFAbzX+k cixP6FE0WomND8Ni3iStJeEOcX4x7OGEiuq9p0c6AhH+XOGU2SNUjJXFUZQ+mWjotyuD rK6SWLGAEuEbZ93y/sayFl5TyCeeM4pk8HqCK5nUG/UsR4zGBBpXzlvWIdrrpp20j/MS caTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957550; x=1720562350; 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=wzxAaDu6jznCkYGTIESxKGj+agIaj+uEvHm/3W7k4f4=; b=SSeMf4g6p+9lGtcx1Q0n99kqVBJLIqnicsUb7vZB9u0JsnOYsdjVHudaLtYPP0/ve6 t46YeX5SEjNUFtpMZAAYufM8CNiMgfBvOTrNyNL/Cj0tP1+kPZ3+WrhSBcHUtdN394PW Pt2kBNoHpwXtobRX7DiLXsRK6wkFn7NbtZne6yr/gDVW676ATic1OqjhfK1f3fDempBj iLWlekIaDw2Npp13FPsal4LQWPfCOLgaeXgegD5qLDcfNEqdKe0maKcfmOSTYX2eThvZ wSO9FB8/eiKeUSzYrkmQc2pemYOfjYHjVxFGzpJ94zIcoHw/HfJ1bDjYNwKDpX6YtldI 2viQ== X-Forwarded-Encrypted: i=1; AJvYcCVXnQjZlO0LKwnRzXw/SYl2LFfX6HXM0MsjNVH68ixVHhvKJnvNmbAmMD0a87Qt2a06S+pzUS0p5Dfvgt2X0l81wKHIt/WkhLVxW0GPw4pgNa1DfAu+wgS2fA9Ft32QnjYPCuEmWxjyVIM8Axj72atS5rs1NF3TOn/+N4pBzT31+DyhLSoCTm73cSmdqvWHoE8ssoPx441f2flpNpHAd0eysBc4e86VSNaYvvKPf+/z5HgThyI= X-Gm-Message-State: AOJu0Yy0t2XTU5Kf/rMQXzEgYHSmytUbNv7Yea8uJ203WWqhGqBCA7n3 06CswTVEoD6hGRzGtTSwywaJ7NOubBKnIsIbpbQG6ubDQOk+Pu3f X-Google-Smtp-Source: AGHT+IH6FgmYtruVie6MYmI+39/gsTLr9f9UoNDdF0ISkmNJ1lHfdTSInJOZogzQSQ9dyJk1hbdfQA== X-Received: by 2002:a05:6602:600b:b0:7f6:4f7e:b87e with SMTP id ca18e2360f4ac-7f64f7eba13mr445681639f.21.1719957550253; Tue, 02 Jul 2024 14:59:10 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:09 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 40/52] drm-dyndbg: add DRM_CLASSMAP_USE to simpledrm Date: Tue, 2 Jul 2024 15:57:38 -0600 Message-ID: <20240702215804.2201271-49-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" tiny/simpledrm has 3 DRM_UT_DRIVER debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/tiny/simpledrm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c index 7ce1c4617675..9cab48bd0581 100644 --- a/drivers/gpu/drm/tiny/simpledrm.c +++ b/drivers/gpu/drm/tiny/simpledrm.c @@ -33,6 +33,8 @@ #define DRIVER_MAJOR 1 #define DRIVER_MINOR 0 +DRM_CLASSMAP_USE(drm_debug_classes); + /* * Helpers for simplefb */ From patchwork Tue Jul 2 21:57:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720418 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0E45C30658 for ; Tue, 2 Jul 2024 21:59:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0ED2E10E6F5; Tue, 2 Jul 2024 21:59:14 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ps0Lg4fy"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4B45910E6FB; Tue, 2 Jul 2024 21:59:13 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7f649f7868dso113938839f.2; Tue, 02 Jul 2024 14:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957552; x=1720562352; darn=lists.freedesktop.org; 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=BVVliFbCcRiwMu0SQpi190huBei8IpcPa+B6oudggrw=; b=Ps0Lg4fyMYhXlMOE43XInYOvlidYm6bHkRTwG7b1DH+vdOClX7y0mmxwXJuOubZQ3L xUIwellnjXSM9DkHHlporRqN0Ffe9Ck7R19rZlMfLhQxRget8vmgGAlfcdru3wtIP3nq FCCCD8pY5+fndH/updnGU6Zk+V6qP657MIbt9V0AbQaHMnW3QMPrjPTsX6Yz0Xtjeq8v Gg8zCgqBCUho0R9qjSLJHZ0kd8adX6BXKLjrPgDjUlyX9AizsUH/Pg7DFRqwMzTBAH7j liTPlB8ZnohdIXn3NeOX4NSHQ2L1ghvB5r4+ht/E1lC/Nkrh+v7lai4z4GOcPKeUAJHW Oo3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957552; x=1720562352; 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=BVVliFbCcRiwMu0SQpi190huBei8IpcPa+B6oudggrw=; b=iDf+JE0Gj42Kh6AbVGeuo38xo5rzRjw8eBwvjH42/ZJhs9tFNixtRjjy5HoWdQjhis e2cG6jMweuHYVEyupqZsmrVbLvcYNi3nNbz/zr6peXFBqYLQZ2T0det4HQMKRI9U/TiS m0T8PM4HB7TCB20nY7Syr+jlXXKrlMh6Gw/J4mRB75HKk8cDm5UNaHGu/0xbrgrN2eI5 YttEE9afRxQi5C8IL86JFFIh0IaGG/Qj2wrD23FJI/MgyfTZm4NLowjCJl56J29GuSdk QtRQMKyxvn25uGXopnanGdYWUF4lUEM6bQAVq3t2pmZVJO+K57oZk0ig+yGjekgwhol8 PXDg== X-Forwarded-Encrypted: i=1; AJvYcCWQzjyQvJrRMRxkoUGFWqON+GYaqBydtKKNzxwAr8tT0oaQPcIw2uAHQB/uRRFJuI7tC0szbJoUX2c+CQm2hnVoHgnWppkiibj3GN4CfJ7K8F6an5v99NlSdUWdK9kDN8bQ06KlvOEIIIYPoGwokNQJLd4F+et3hT16DY+qMSNCXxCXNNk/6LIBSfvrN2lLqgCwoTU54qozwD8HDndu6AWAfWM32RQNCqeIkFyoLHJU3q0OxoA= X-Gm-Message-State: AOJu0Yyh9sleqCT9WeNnpR45l6sfyrUnPpkmnwpBqTborzl0nPyBAKgl xNQl2YwWdw16iFPmBl0LgtB13QsmM75/PCU6DaULoeT2YIPn87z+ X-Google-Smtp-Source: AGHT+IGEAKvO56UJsUl2ag28O4BHU8pNps2SJqU5SLk78nG5JzHSvTWkp76KWdlSdUH9XcNNV90+ZQ== X-Received: by 2002:a05:6602:718:b0:7f6:1cd3:9660 with SMTP id ca18e2360f4ac-7f62ee647f7mr978614539f.13.1719957552546; Tue, 02 Jul 2024 14:59:12 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:11 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 41/52] drm-dyndbg: add DRM_CLASSMAP_USE to bochs Date: Tue, 2 Jul 2024 15:57:40 -0600 Message-ID: <20240702215804.2201271-51-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" tiny/bochs has 5 DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/tiny/bochs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c index c23c9f0cf49c..ee98fab5597e 100644 --- a/drivers/gpu/drm/tiny/bochs.c +++ b/drivers/gpu/drm/tiny/bochs.c @@ -54,6 +54,8 @@ static int bochs_modeset = -1; static int defx = 1024; static int defy = 768; +DRM_CLASSMAP_USE(drm_debug_classes); + module_param_named(modeset, bochs_modeset, int, 0444); MODULE_PARM_DESC(modeset, "enable/disable kernel modesetting"); From patchwork Tue Jul 2 21:57:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720421 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CFF74C30658 for ; Tue, 2 Jul 2024 21:59:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2164610E6FE; Tue, 2 Jul 2024 21:59:16 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="H1lwlLqr"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 38EEE10E6FB; Tue, 2 Jul 2024 21:59:15 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7f6309e9f29so165202739f.0; Tue, 02 Jul 2024 14:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957554; x=1720562354; darn=lists.freedesktop.org; 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=BVVliFbCcRiwMu0SQpi190huBei8IpcPa+B6oudggrw=; b=H1lwlLqrblkCrQ9Gw3kT52IynwuEGUAZOLvCis4ITaYgM+CIb5RPQ1OeQtcGkO0isI NGPVN3ie2m41cWVZvv8MhjFQgnUxi9Vk6SN2QAFM/r3Xstlqvr5x4W4Voi4IysgsFRF+ iBEUez0oD8d1S8Delot2Xx5x5UhLedNYlx1w0huJiA39UnY+dDzaKZ8jdo4rVEKpevRt oatXGwkt+5K1zh960BDKtGT/JhKJn6U3h5smBOMGDJvgniCJcVqWdvIdQPr59OtYmYf5 7frQo69F/m4zdMaYUUXPFb1wRfFcLPdLMLVTRbxL8xxSijv/z8NcAGYlcz40s5jPg50z 3hGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957554; x=1720562354; 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=BVVliFbCcRiwMu0SQpi190huBei8IpcPa+B6oudggrw=; b=qo5d+BfnfxziX2j3neZgSR0EJlo56q1XJff3Ox6PV9JPZN8oBVIbS6mPo58RF2zbHh c6ABpaZUgTbIqkHkIrv+m/vsmbPAPV1LK9zu3SrsPRgqNOO9giUs2m0D8AgIqSURNmdp bmuUYrSJWIzGMURWKgo+U1fUmhXKsgS7gSd+cb0obd0gjAIod5Q85rd3ZBjVYKzUe16M arI9wMo9aStUIMTSh+RtmKNWIP0eSYjKrQYXZ0ys64Y6ZY0iXHVltE5AtLOJu8b08IHl ArsOuXkjmB4TSEi+53D789ny1dGE/nCGGQhgxxOsEiGi2qV0Cs9tJQDu0aGzzBUx0zcw 5xbA== X-Forwarded-Encrypted: i=1; AJvYcCVpbcwGLydHaiQxgl0rZPoTZ90wgGNQr05+sXic9Q1BvS4pXWjH8iiPn/fy5Foe/pGL1kjEN7Rupi13Gf7x8K0nTL8xK/Qb439/N78VUzTIJIzKnV4JeL9Uj7zHQb9/j+EEKcEjjlNAEcb+lD+/DpbkJHxJk5SxF58HwdWQPuQoGvDIZFsIaktdb2QCoY2u7vhqTm/hYuwesDVSKV1PMtCvLg65+xjz9lzLopAPeC4S52rrc5s= X-Gm-Message-State: AOJu0Yz/3e3pVTA8AWRkRljnQRhdMVsgdN/Gly+TZ/Omdocjsn8l3YPP NJuN5jOYgsA0yz1L3JK8lzgG7Hf5zKXhLWSV+1WDe3cYyC6IXp/D X-Google-Smtp-Source: AGHT+IFZ62yf97Gt7+RArnHZHhfQvkUmAT8LPZ/RRX0mXtYibWBEHGPj0AQZKFILtjlHvXFtoqdSew== X-Received: by 2002:a5e:8c05:0:b0:7f6:2b2d:8ad4 with SMTP id ca18e2360f4ac-7f62edff929mr1067144439f.4.1719957554487; Tue, 02 Jul 2024 14:59:14 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:14 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 42/53] drm-dyndbg: add DRM_CLASSMAP_USE to bochs Date: Tue, 2 Jul 2024 15:57:42 -0600 Message-ID: <20240702215804.2201271-53-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" tiny/bochs has 5 DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/tiny/bochs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c index c23c9f0cf49c..ee98fab5597e 100644 --- a/drivers/gpu/drm/tiny/bochs.c +++ b/drivers/gpu/drm/tiny/bochs.c @@ -54,6 +54,8 @@ static int bochs_modeset = -1; static int defx = 1024; static int defy = 768; +DRM_CLASSMAP_USE(drm_debug_classes); + module_param_named(modeset, bochs_modeset, int, 0444); MODULE_PARM_DESC(modeset, "enable/disable kernel modesetting"); From patchwork Tue Jul 2 21:57:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720423 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DAE83C3065C for ; Tue, 2 Jul 2024 21:59:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2BD7210E6FC; Tue, 2 Jul 2024 21:59:18 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VeOf4UyH"; dkim-atps=neutral Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 47E9910E6FD; Tue, 2 Jul 2024 21:59:17 +0000 (UTC) Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-7f5f7ecacc0so203296439f.0; Tue, 02 Jul 2024 14:59:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957556; x=1720562356; darn=lists.freedesktop.org; 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=pIsdMzCagTnPqkjtDJJFzcS6RuUfrVRwKo+d8V5q9yk=; b=VeOf4UyHwwDAgF/xcqBvqH2qDgdYNuq+AmjnToKB3vS13zn71v1Q2NvNPw6Oef5CLX BkkkeOLBV2jkwlMBYkZCFPP7tjBweDo5Ji+UXARm8QOR99f3NTGt5tk9oGFaNgSsZf6v X01/BfRRMvmDwgPeu0L+R8JqG76lv/0dGrbX1B9FZCn9mxIju7WatMsMN2RfkgOr0X5T 5J7Lk0zXojnzvDIJnamo9vPs4yizlQgJvmViCdzwFkRyXfRSp+4ERl/p7wCg1i0O/9aS vIgKW+HbK7cYhkw0j5Lza+46dbwcnnL18UDh075aW826Bq8/m3Svci9hEVXpmxcQS2YI nR4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957556; x=1720562356; 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=pIsdMzCagTnPqkjtDJJFzcS6RuUfrVRwKo+d8V5q9yk=; b=xFcr9gu/SGevMOkoXAjmOGvo2NgW1IcYCRYdEqnotqCbJt6ulyLh2tX0qhtpHXPigO Q2eBIgB9bwmuzk49N+HzY6R/suO/SMJoDSXugdYRw8+dvmnESzkGw70tNieWN5tKRpal ctnwI2MCpu3N78Dclkey/sIXeJHW96cIjUL/971uRUKZw3qmEnDONUY/srW2drUWAsfR zw37wwiiyz0L9ZxfOxbeq1z7raTPdizmkWnxtXQcQr2QPssd9aJAtk9p7ojEGBHZ0Dqz jdZA8hVd3TdO9hKVAOkNAZc5wf9nG/n/0ezGqS4WTg+tGU10wPHiGMjn1R7WuRu4G8lS 1TDQ== X-Forwarded-Encrypted: i=1; AJvYcCUn/Mx2cKWjShM635oig/7QFYZRCkUCGDlzHEXqJvLy9js6NIV4dtq+QJ5OQQWJCW81CPqAjM4RAtkiba0zs9YyFyPLmJTHivzJCknCzDfZXR8faE8v3clOdEUG63Go7ygkfbDTnuyslayYmff878GEf+bEx0vehYdNcrJ7M2rDxxPUioG5vFV9Igqdhw0pgFJCXpXo3IKuCSIj1GmoNz4BhY+4JOLm039gdqdRA6nzVFKDOrU= X-Gm-Message-State: AOJu0YzxVr3jW0pO3fsxGoFy0Zmz5s0Dyi0pbbUGaUUnEu2IDvT7LkHF yIvqzos0ZoOcqnqBvavfw1I7G4ZNoBseE9mQ3YI6SOghACOEZhbn X-Google-Smtp-Source: AGHT+IHkqfivsiD8dHTonTZAnkys7OGTa2LDBnrQBx2fInhOiG5IlwUdftnx+Nl9cVfwsK85+z/TuA== X-Received: by 2002:a5d:9544:0:b0:7f6:1f20:f137 with SMTP id ca18e2360f4ac-7f62ee3cc32mr1102400639f.5.1719957556538; Tue, 02 Jul 2024 14:59:16 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:16 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 43/53] drm-dyndbg: add DRM_CLASSMAP_USE to etnaviv Date: Tue, 2 Jul 2024 15:57:44 -0600 Message-ID: <20240702215804.2201271-55-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" etnaviv has 5 DRM_UT_CORE debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has class'd debugs as well as plain-old pr_debug()s Signed-off-by: Jim Cromie --- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index 6500f3999c5f..1d1ddbedcb5a 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -25,6 +25,8 @@ #include "etnaviv_mmu.h" #include "etnaviv_perfmon.h" +DRM_CLASSMAP_USE(drm_debug_classes); + /* * DRM operations: */ From patchwork Tue Jul 2 21:57:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720425 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F0B36C31D97 for ; Tue, 2 Jul 2024 21:59:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D929210E706; Tue, 2 Jul 2024 21:59:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JXk5JRGf"; dkim-atps=neutral Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 464CD10E705; Tue, 2 Jul 2024 21:59:19 +0000 (UTC) Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7f64f66fdd7so60635539f.0; Tue, 02 Jul 2024 14:59:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957558; x=1720562358; darn=lists.freedesktop.org; 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=MstXp7FK88BMTd8JHXdyfJJm9pHe+R2QRKpv7nuxLhw=; b=JXk5JRGfz/XUghx2gX4ZYw7n5Y9coripDpjDfFe4VLICxHru/GLAHYUBKdVNQWsidF ER/mfsBRQ/EHCReKHNPLxbgJBWb/yco1g6/UQtp0aNzOi7A+wV4iURznA/GTTsL17sAM SGnSsUKEdxp5bX2WYc5e+eJriZP1MNFVaU9BrMY2l3LFmN9/yOpjX7rX3lUxEL+Kukwt ae36vnRGMss7UyzleyQoVMVErcAca2n9IrR6Vg2nrDNsA5zGre3106+xJxe6LdG5Vpca Oh3QO8jaQJBpj6I2xWwPVF8LHaHeOmImpSbHJtSd8UxNibfFuOlI6LpwaJFfpNkEd1uD 40eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957558; x=1720562358; 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=MstXp7FK88BMTd8JHXdyfJJm9pHe+R2QRKpv7nuxLhw=; b=JvVRwFE2kRilEiJMwI1JrJ8jPnIB3EBlJ5FgdqrxHD3TEiMdmELj80+QwwN2QBA77q lRvsIqozBkJxiHlrPBxkELE9nr0fyMwaYao8moMCH4G9106oWO1tdhZpmx4I5NO1YWGQ jleXdnNcYDpOLUjkGg2zuDy1Z4r3MZMHe+63Ey2J0VxquoyRgrLaic6GfuCO0mqvNgTU 6i5XrR4LuXn2/u1plbp65FSomOFo/NgIRH3nNS1/l3UWt32cLTDMSWjSEvR//jm9vORL 69Rp15GeZeR355SazcnpBlvLKVL42yMyzLbToTnuT3ZIY6ffLwyv06KCmyfv1aM8uX+h 2kMw== X-Forwarded-Encrypted: i=1; AJvYcCW1lOX/tk87fra0XnzazZ9Gs9uB9cIcLK/rcm28ZE98M3IbP9Ba1FeTe7oI1mZCK02jPleu8EXptxqyDAyyRMEidITTUhtn9OhuFvLSuM6lZlWAhT9cX4vLUiD9Id6qRzmYKArh7Mc1QRPsM7PXpIuwRqEZqOLh57pEkw/wWgyKtHdvbPEQLwGT0MFQx4ugtUQsijvzTNvY/hiSLmOixtReMVqopgUXcDI3plBLf5FTejaZ6/M= X-Gm-Message-State: AOJu0Yz/bntEzjDGuezthNAW54deHFFgCRYtSaUILt1CLz7xIzn66Jhg 1r0B1mQFnP1m1+gMeF9uQNeyIsM+CytbARGy0HxyLfcmStI3CKlZ X-Google-Smtp-Source: AGHT+IFcIORp9H/J73OiEqri32U4KgwsO40eee8n6IPtXvMuMDoj2ETHViN1dw0w41V6S4LRy3BoYA== X-Received: by 2002:a05:6602:1d15:b0:7f6:5c30:3717 with SMTP id ca18e2360f4ac-7f65c303a28mr121899839f.5.1719957558467; Tue, 02 Jul 2024 14:59:18 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:18 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 44/53] drm-dyndbg: add DRM_CLASSMAP_USE to gma500 driver Date: Tue, 2 Jul 2024 15:57:46 -0600 Message-ID: <20240702215804.2201271-57-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The gma500 has 126 DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/gma500/psb_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index 8b64f61ffaf9..5e03ac7ff433 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c @@ -39,6 +39,8 @@ static const struct drm_driver driver; static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent); +DRM_CLASSMAP_USE(drm_debug_classes); + /* * The table below contains a mapping of the PCI vendor ID and the PCI Device ID * to the different groups of PowerVR 5-series chip designs From patchwork Tue Jul 2 21:57:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720427 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 989A1C3065C for ; Tue, 2 Jul 2024 21:59:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 16CAC10E711; Tue, 2 Jul 2024 21:59:24 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BCa6XYIH"; dkim-atps=neutral Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1941210E70E; Tue, 2 Jul 2024 21:59:23 +0000 (UTC) Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-7f6309e9f29so165206239f.0; Tue, 02 Jul 2024 14:59:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957562; x=1720562362; darn=lists.freedesktop.org; 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=6+Eqreo55RWzciyFbwYCY+bKp2K8wKhzwrrhakb4uDM=; b=BCa6XYIHJT3FG/3v2S/eFXtn93NG6iPFUHDay164cYxqzWGwJ8EPT5LtrfCeIZp8Fj pMtVaftq77TtWAJzPeYOU9sMQRR420o+MD+Al45xXVZqN3sl6wHOFrB57fz7LoxcfDRi /5NvbENt2fxl2O5THDBst4okn2RB/0Sd580Rk9GQqJ8lDedn5vfb/mtZA6STyld7Du2o oBXFAZ/+zvKyS85zMKgjgTe0Tf8Zh8AlOiZkGFlcuGVgPO7E+qBYN0YVMy9SRw4i/B7h NSZi3Fw4JUPXdjLsJGd2CV4inHQE1347rWJzcPMW1X9BpPMSShqIILPNuQFftUCGD5mG EffA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957562; x=1720562362; 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=6+Eqreo55RWzciyFbwYCY+bKp2K8wKhzwrrhakb4uDM=; b=ZBtE+LbykqC/48gt52iMcLZRMSw8bdLlHmYHytq3ob2ni7shK7K+6/qOwbRhjXWoRL fFehdw/b7WaWrjrrIVlB9oPInj3vHAO2UAP/YKegCrC4MPq3yc77cWroidQw8x1icL4u F+Fles3aR973lRhl29WA/vHirt1dyntFeA6OG4kaf8FfHmqKkeHVIDUP5vkldsvzbh+u PENnxT5SCjGRjndSLDXsmksEd/34Nuo8rdVBM0ZDlnG3vouXxhJtj6UVYBkm5T7R4yl6 GS9K6GXx24XA2OzIjxa10Zfnc7T0VfIkb/HR0NLVEatWIrMS1nJA6io522FD7qbprE3S nZMA== X-Forwarded-Encrypted: i=1; AJvYcCUjdY6ovGLLpiyNcrMouk5yjwxMPog+jSPxwiPtUwT745DjKyMAAP1PhHJSYqjmN8QSivvUWHGj5L/M6Gb56R4pw8KIvIaS+7/2ThKB0lFKoscGDbgmzxXvIp5CzMabwx2hH9nwxGvxZVwHTAlekZ8F0eZ/tH3/lBtFVD0x44nflJkhkQrtqYRnno5Pf5bfrIY4zKYrNoLa+694bvBx9QtP9Oxih6RP1eeOf2JZxa0cQ93DlBw= X-Gm-Message-State: AOJu0Yz6ry9gqXI+e13pLuxp1MfHiW3jwZqcNJrRhIn5+X5c+UI80edx q9p66sCXdZhH+rlKSJsYN9is5N/rlSJ0MOkcrIAgfEBCnJnvfmDy X-Google-Smtp-Source: AGHT+IFbVFUYm+0pu0T514FItDcAvbDhzBeP2fYzyyuJhvxQn5GvEZPQBzd7j+fZ1Xji8n6rJpg1qQ== X-Received: by 2002:a6b:cf18:0:b0:7eb:7f2e:5b41 with SMTP id ca18e2360f4ac-7f62ee196dcmr1130557639f.9.1719957562323; Tue, 02 Jul 2024 14:59:22 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:21 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 45/53] drm-dyndbg: add DRM_CLASSMAP_USE to radeon Date: Tue, 2 Jul 2024 15:57:48 -0600 Message-ID: <20240702215804.2201271-59-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" radeon has some DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg about its use of the class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/radeon/radeon_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index 7bf08164140e..d22308328c76 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -247,6 +247,8 @@ int radeon_cik_support = 1; MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled (default), 0 = disabled)"); module_param_named(cik_support, radeon_cik_support, int, 0444); +DRM_CLASSMAP_USE(drm_debug_classes); + static struct pci_device_id pciidlist[] = { radeon_PCI_IDS }; From patchwork Tue Jul 2 21:57:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720429 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0FAEC3065C for ; Tue, 2 Jul 2024 21:59:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 431E410E722; Tue, 2 Jul 2024 21:59:26 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VWGK2C8l"; dkim-atps=neutral Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id 180AA10E721; Tue, 2 Jul 2024 21:59:25 +0000 (UTC) Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-7f3d3f1294dso169401139f.2; Tue, 02 Jul 2024 14:59:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957564; x=1720562364; darn=lists.freedesktop.org; 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=Wh8QJ3ROh21ShBzcCiOPzlcJgoRl8pzdhd6qJVNHlVY=; b=VWGK2C8l+IqLC1Ig5sX6NNwTpHCwK1LCSk4e+DnmqZO/sx2vwjFmXo+DN3SL+Ed5GR usrq9yMBEz6PiUerC7FtzlGDHk3vJytPV4e8qbK/qFOAlkREImm+B8z1z+OunAmLb+fX 6Ki7OYNHW4w7aT3rZ+anShyweXfJxvwfodjT7Cx3EZKu2ocBTRoTCwv9+KMFK2oVzWbg N0QfF9yhS/4QnfjlfWzzNW7Uo5guAf1eLxES2rWX9384x1jhXVFYLsGcVHKdvv6qvSfb uvBx7Ss4O9EHfHJy8RdPZ40MSXp/fdvTsPTrTEDQTQ6HrW9oVK0jf8EPzmTbTJ0LOR6u p1hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957564; x=1720562364; 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=Wh8QJ3ROh21ShBzcCiOPzlcJgoRl8pzdhd6qJVNHlVY=; b=IywNjV9ZF8qiZO3WohfMqMupGRhznooyVATUFCqTP1dQEvsfyyLd9rNhG0Sej0KCza FECQFFi7w9YwOf8O0plUCxVErSO62cf+jCBY/1BDeg4Jo1N+Z9k/+kkryBw85ntwkQZO KvJuB1LqZ4vki4xzDA/JAnZOtF8EwtqHToNROtDCPyYDXEO4cVHnK080f/mS61sG0CGi 3Jmu9LYuymlpEK8fzKD2kZvBoudDMY4mj+a+So5dESGA6ASFL3ab4L9RpFTzJ7aVDtCn AnST/OUtqTWI1SREbck2hfOzBs8PSQmZinVcYoKCBtySOojOkljFSLoDO2pFpdt3pbp+ 8meA== X-Forwarded-Encrypted: i=1; AJvYcCVOpVSO/CX78jFWSjw++ahMwfsay2JU79qjMBin0aqW1WIBCZko51eZjdYkp6jwr4jD9ECbk0FjQfdrGQjZdTvQCT7zCN9hAJoXX3wf00SPmFkEV9PMEbC5tQSxINvZNE1rp1mFd/8/q/fm/4hiFojcbXEkoz7CIGEZs5APMs3HHlQ3Kc6hV6YqfJ2z6wTSiuXZRl0s9xvVOSzme5a732M+mTiHRBHJQozbsAqE0DmRECPBaMA= X-Gm-Message-State: AOJu0Yyzas/JpPZZpZqwalmoRnFzrDYnazMItluhP1WfRn3/v+7qjoIn LfKraXI/HdFHHDLu5eFW0ayxJbb9quqfc2iIUGa9F7WkkE+TBowV X-Google-Smtp-Source: AGHT+IGsvIlCZD+c570Neze+GHw9bZoFgMkgtz4aIrGReUzG3qZZPt9ry6B+lTwl9sdSHvOE1K8YBA== X-Received: by 2002:a05:6602:304b:b0:7eb:8874:99e0 with SMTP id ca18e2360f4ac-7f62ee3a19amr1042539839f.12.1719957564338; Tue, 02 Jul 2024 14:59:24 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:23 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 46/52] drm-dyndbg: add DRM_CLASSMAP_USE to vkms driver Date: Tue, 2 Jul 2024 15:57:50 -0600 Message-ID: <20240702215804.2201271-61-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The vkms driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/vkms/vkms_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c index dd0af086e7fa..086797c4b82b 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -39,6 +39,8 @@ static struct vkms_config *default_config; +DRM_CLASSMAP_USE(drm_debug_classes); + static bool enable_cursor = true; module_param_named(enable_cursor, enable_cursor, bool, 0444); MODULE_PARM_DESC(enable_cursor, "Enable/Disable cursor support"); From patchwork Tue Jul 2 21:57:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720431 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 68157C30658 for ; Tue, 2 Jul 2024 21:59:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CC25B10E707; Tue, 2 Jul 2024 21:59:28 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="J19QX6D2"; dkim-atps=neutral Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 642E310E707; Tue, 2 Jul 2024 21:59:27 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7f5f7ecacc0so203302239f.0; Tue, 02 Jul 2024 14:59:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957566; x=1720562366; darn=lists.freedesktop.org; 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=o0YsvOK5afJ8qV3rkuOU7CKX9HpGcds0hiKx8bDl++s=; b=J19QX6D2TcgiODZaNPJbGGTWcntKUhxitmDDibgyNQl6XDa0qrE+5oZode1JP33mCs tF5OIhG9y9bWIK6qHaQDviN5Go/RoNWOpwKrLn18BoCKWqXU9sCHLowKxE5XjIQUxYM6 eCfYt3pLXdXdZlB8Ex71KcSftpPdJ7UYuJXqiruwUmH3To7l/nW0I/wONBvJ2blzJXnm tw1wYyUsZA/6TYbd6xD3wn0mAXqveifBhPJEWfKfK8wmuN7WJrUbvvmYEM6iArdzHJ9l OUjdiOviGAUug7xSO5b3BJCtzHVtA0ryN1J45AG9peDMjYGzlm8ld5PK0zKA6BjnZvm1 k/5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957566; x=1720562366; 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=o0YsvOK5afJ8qV3rkuOU7CKX9HpGcds0hiKx8bDl++s=; b=nj7D1yJJnSFOpcp93s4xxBufegWw4VykJO1l0uddKHpXtQpfm+uHWWQv+54AxMI/7F Tq0Vu60k/V2icsG+709ulOwzFBEEKHjCpQCfB20szfWyqVe9Ws4NWmwvHZNx3oM6jtyM eF7t3h94JEssECrf5qBBph2txKAhARME/P4iS0Ox88EyhT9ujhJ/4B88IdcOazGDEKC+ hYMwFmfCRTbVGqCNcRN9wcDQwRHOAKmEcuON1u8bzmqKfgADwJipqyKiUfjFqvO6v1jJ f/cpe7/ljGGkXmFpligD7i/1iYdKiJofyVE6EL//wSpfqbwlw2XH6VL6g0alcl7y6Tym NErg== X-Forwarded-Encrypted: i=1; AJvYcCUWo26U9e70eKL7YxUy/7rC0yI2xtjFtnOWY1xyITpiestVHd9gxnKmmd8ajrY1yb4Ho7Z/rlUrM0z7YN/Gz86xosSI66VJdDYtRM8JaqKHyQ4tAloiN6adTsuoaOwAlEVKwW1FoPJ7Y0nqvoSkAcY8b9QwJbMDwiRzzJnXbpY4NJy7Wxy9PGwlwI1zXoDQ8wv71oDzSTAijG/A/kY85v3PktMxGTSFK41TP7Z5YxtA+LDxrLM= X-Gm-Message-State: AOJu0YysKrjhwkkGbD9wentVg0xxlEPvrKK53/cVx6fluYnktDig9YAW vXlIi/HaW87qNhUBl4nb8+SjCWucyela5U5ORMDY08WYkW17ueVT X-Google-Smtp-Source: AGHT+IGvYws4ZnTk2jdkfQbNphXRfxlVgTR2bSz3FZORd7ias08UfIGbv4urN9er+A1Gk+gnXV2vKg== X-Received: by 2002:a05:6602:1306:b0:7f6:27cd:b054 with SMTP id ca18e2360f4ac-7f62ee17f56mr1125065139f.4.1719957566686; Tue, 02 Jul 2024 14:59:26 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:26 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 47/52] drm-dyndbg: add DRM_CLASSMAP_USE to udl driver Date: Tue, 2 Jul 2024 15:57:52 -0600 Message-ID: <20240702215804.2201271-63-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The udl driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/udl/udl_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c index 3ebe2ce55dfd..ba57c14454e5 100644 --- a/drivers/gpu/drm/udl/udl_main.c +++ b/drivers/gpu/drm/udl/udl_main.c @@ -19,6 +19,8 @@ #define NR_USB_REQUEST_CHANNEL 0x12 +DRM_CLASSMAP_USE(drm_debug_classes); + #define MAX_TRANSFER (PAGE_SIZE*16 - BULK_SIZE) #define WRITES_IN_FLIGHT (20) #define MAX_VENDOR_DESCRIPTOR_SIZE 256 From patchwork Tue Jul 2 21:57:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720432 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7F218C3271E for ; Tue, 2 Jul 2024 21:59:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F0C1710E715; Tue, 2 Jul 2024 21:59:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CiCrDpo3"; dkim-atps=neutral Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6765F10E70C; Tue, 2 Jul 2024 21:59:29 +0000 (UTC) Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-7f3cd802729so172629739f.1; Tue, 02 Jul 2024 14:59:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957568; x=1720562368; darn=lists.freedesktop.org; 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=oC5iipR2BEVxGSl/++A4yY4qqMQYODae2mcnPNjxpHM=; b=CiCrDpo3BqPM9ru84OeEF3MTDWHhzPMCNVM4LIKFF44r1jCoR5DBNHxnlZW2HGCMlw FxsHqcpn7hp+oRQBEKMhOdxthqTcXd5m07FLjquiizD66+CxnLDwb8wiop8QOAFqrKKT RxJi8npxcyFs2n5P1CuV3/JSEi2YmZr/Zhgi1PPsBy1J0UgaCnvtSRWIJnpzQqMCkNhI 2AYdgy/iH71vmABsrWhq973BRzXdjCywo5xSmMbsAE80tpsPoEfAEsT4ptRgmHTXyT+d Jl5y2KDULeeTRLK2IdB0n8fLze44aJQCu6CwoN78NNqRFLHRE1kUmtHGRUyERYKu/LHV Pd1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957568; x=1720562368; 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=oC5iipR2BEVxGSl/++A4yY4qqMQYODae2mcnPNjxpHM=; b=dhPjfw+w+afnsYYWTAT9TKPWRARpWIF1kCyD+9mEmUhDe6K8xvZikynpgJwR0Ud90q SWqH4EJczLT6hkVDs7CNHDAvpi7suYNGKduvdWMi8Hp51qyyWM1dl99zFqnFhGBc8O/L EPaAJpCpg5ZsJormglIQrC9UzWTOCk4KefosXE+s5As/ZDYIqpC5bbSUwcWMVXn4jcLy XwrV1esW4fckGyBTT6YD/uVaOF0pUwGaxYME7IJ+UA2KXQfCQJBtAt5nwxIgaP4lcISr fGrfDSxykNMQmopw0nnOo3VCqB+FiBbvblKgeuQO5ltmb/7VmSwVi872n8BtKe4vRTrB AT/g== X-Forwarded-Encrypted: i=1; AJvYcCUF1n+mHZf12zpKuQv1iyDx9jK4YI/ZvsC4IxMxLcEXfIAIu5/DBlQ2Pou13i474iRyWAHWIY8LEubnFQ4/1DgPVvlyiCuqYLV8nu9UpuGwuKUB789UckLQ+4qdZMEHnWO6lOUYekLPhFh9wVVAupBGk6d1GrnxePZHvnVGBzdLhoClzEFD+6v6eakrqvyAiB9Bo2R3EDZR7ithTTQhUDsyLtZo7kHSZHGEg+I6+OKejwCJmj0= X-Gm-Message-State: AOJu0YzqVejsXKu1XJGaxEjM4N5pkQyX+svYJlN7sGSJ+jz9PRGNMc3Q W/MBsRDF2DnDh3QVo1m4LE/+mgJIejOd5+Q64WinAOMATS7/SOXM X-Google-Smtp-Source: AGHT+IGxhTOcr4ji5IFiskQTbP7XplIk6SNXi5lLsntoYpdRCPZ1vof9lF5GiOngaUP5FSepVU/KWA== X-Received: by 2002:a6b:5113:0:b0:7f4:861a:5e5f with SMTP id ca18e2360f4ac-7f62eea3032mr999757239f.20.1719957568654; Tue, 02 Jul 2024 14:59:28 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:28 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 48/52] drm-dyndbg: add DRM_CLASSMAP_USE to mgag200 driver Date: Tue, 2 Jul 2024 15:57:54 -0600 Message-ID: <20240702215804.2201271-65-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The mgag200 driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/mgag200/mgag200_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c index 573dbe256aa8..88c5e24cc894 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.c +++ b/drivers/gpu/drm/mgag200/mgag200_drv.c @@ -25,6 +25,8 @@ static int mgag200_modeset = -1; MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); module_param_named(modeset, mgag200_modeset, int, 0400); +DRM_CLASSMAP_USE(drm_debug_classes); + int mgag200_init_pci_options(struct pci_dev *pdev, u32 option, u32 option2) { struct device *dev = &pdev->dev; From patchwork Tue Jul 2 21:57:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720433 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CC5C3C3065C for ; Tue, 2 Jul 2024 21:59:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4FD4610E719; Tue, 2 Jul 2024 21:59:32 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DJZbmr/u"; dkim-atps=neutral Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4DB8510E719; Tue, 2 Jul 2024 21:59:31 +0000 (UTC) Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-7eb5dd9f994so174442239f.2; Tue, 02 Jul 2024 14:59:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957570; x=1720562370; darn=lists.freedesktop.org; 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=oC5iipR2BEVxGSl/++A4yY4qqMQYODae2mcnPNjxpHM=; b=DJZbmr/uFhsPWxLp5cGq1pJIx3mefNR5d33G6U7RMznspgFJtb6AmYM/8sfaM7Vy5/ lYXbL0ZzvT4eWI9QitA2W+LT+15dhiO1yLJJS7iWtniykA+WAEiNAWW3olEwgImkHCvl D3mtKRzqj859Mfec9Qi0r3dxG3aTgkFYZYi0gmAowL2L6ZYZXjpJClKi2DPZVJZrXolk MG2kDxD7MYo/q9zWdMXRF5QZ7PL36HOuC/MRL/X1jkiIxarprVVf9a59LTZh/ANRxNB4 rgWvazvpSZ4c2C1EBAwYXdewbQP8rlZNYAxo/A4BVMPOAD4yKIJv+FHhZXn7j1DuHdAB xsZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957570; x=1720562370; 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=oC5iipR2BEVxGSl/++A4yY4qqMQYODae2mcnPNjxpHM=; b=bqhSgxOHbgnsUgoEKL9cvSeoIK02DVpfMqp9gPt2UHm2I55Pcz27d/BjcJcm2+HA6U o7p/la7uCUmegNWZpPGyolBtrJ3fbNvRxub1UAm/WxPbM3g5y9zH48RDNQBssCLTVbDR g4KqdpsPrhSaNvV1A9vzVoSWK039Nm+nCtueup5G6+2sDudIN9cdSZ4JCC4h2BZgw+Ou 2FKt+cbraokUbM9m2mT5V1two50uBPgHgrK6fGOUgmenH0Od4FPDTHDIHsCeeP9YAwD2 SgrNXuYemfE8Je/t/hcF4tpETIUZd060aWIEOo4ecEhQXbP/txCqGtBJZUO7+HoriGw0 40jA== X-Forwarded-Encrypted: i=1; AJvYcCWPPs3PxKIWlEymZkPY7P4XhiqTXD0WJoL1aY5RmS/VHmPE5Ulm4T6D88hYF6v7ThWBgTUUd/zGF6Q+kfFrOjDmZlG1ybbqjE07LGV2CD+0v4gYxJehm5BjFWsqQCFsQ6tbRFFl6CuvZrUwhaFIeKIiuBrXTMmyTNZaGV+RAgwbuZY2r9K0egJyx2hpmSFR5RjmZ5Jcce9c/qSgzlBObeSxLGMZ+s47dtFcE/PQKysnhdKwSog= X-Gm-Message-State: AOJu0YyhqvAy91PT4MyW/+0U9VygUl0wFUPmujJ3CaPBLyJ8mR8nA9p/ KpT4ijMi62pPPVT0/PRz5eiqtTutq4o8HrRrhK59tBUD8lVI1Eum X-Google-Smtp-Source: AGHT+IG3KnjeWk+tAUHTPovE025jwoX/P1iby1t4AUaiPLy6INftMDEvgITc5Zor5sYmFDRxWWvjqA== X-Received: by 2002:a5d:8408:0:b0:7eb:d640:267 with SMTP id ca18e2360f4ac-7f62ed4df02mr1061790439f.0.1719957570618; Tue, 02 Jul 2024 14:59:30 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:30 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 49/53] drm-dyndbg: add DRM_CLASSMAP_USE to mgag200 driver Date: Tue, 2 Jul 2024 15:57:56 -0600 Message-ID: <20240702215804.2201271-67-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The mgag200 driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/mgag200/mgag200_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c index 573dbe256aa8..88c5e24cc894 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.c +++ b/drivers/gpu/drm/mgag200/mgag200_drv.c @@ -25,6 +25,8 @@ static int mgag200_modeset = -1; MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); module_param_named(modeset, mgag200_modeset, int, 0400); +DRM_CLASSMAP_USE(drm_debug_classes); + int mgag200_init_pci_options(struct pci_dev *pdev, u32 option, u32 option2) { struct device *dev = &pdev->dev; From patchwork Tue Jul 2 21:57:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720436 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2D9FCC3065C for ; Tue, 2 Jul 2024 21:59:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7CF6110E727; Tue, 2 Jul 2024 21:59:34 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cXF680gt"; dkim-atps=neutral Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id A93DA10E720; Tue, 2 Jul 2024 21:59:33 +0000 (UTC) Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-7f64f66fdd7so60644739f.0; Tue, 02 Jul 2024 14:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957573; x=1720562373; darn=lists.freedesktop.org; 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=LdxS3Fv+DdtdyD/OX9RwYgW//DQBvhU2TaujYV4igeo=; b=cXF680gtH8SYwWoblbmHFkURxwlp8Xxtf6YFagCu//SKEyFQkBpJcbiGDhSkOewRJ/ 4kFDpfGxbGFpGNDOTrbySwjUjKw1Z2HwkDLQHrRRcP06KEmgXNRAM5vBH4tN5olw4bPG 9y/iYJLWjsrpiRXOok7EcDw0vyhjszk98pgsRj4d8iWdMJ1W+aO8bjtajfVjx1EwaC/T YA1zqDDaFPwHfBZnqC+o3u3iTVlgwWbTp0hqLWkiK9w3QU4VJNXB6lQqkRHUxIt2Kk0e 7jHxz5Ux7mA9p55fwiYFK+/tepQabDbGqTwmZp3uL9w2WhZ3hNiDSKch8BRheEhG2G6x gEuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957573; x=1720562373; 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=LdxS3Fv+DdtdyD/OX9RwYgW//DQBvhU2TaujYV4igeo=; b=OXJesDAf8bs2y/MIYtMPMLf7he9IivMWwHcgplUn3HXZONBvOH6o/pj2sl2/Fv470y F+ZzUr5N0evnsZe6HGt2T46JoHrfGw2aENTleE3DhueUq4gW9n1lPUD6ZtZI9nhHFxLW keIZpeGXiqradk4wU4Sdg92W5WgwW9XJqqjmAvkUdoyamOzMCfuv+RRcWSdcDklHVXee kpjH/Och31n3GALVjDo6vT98P8DMAlV1kfGD38mEAWZn1e9JJzynyyb4e6E9cHDwIWuE ZTGCCJbVzZU/uo2s6ZvvPDNi5uqXVTpSPe3Y41gzWHMsh9Q5T4FVDKIURg/YNYrF64C8 A2Aw== X-Forwarded-Encrypted: i=1; AJvYcCVDJdEFIfAA/G1EOEJ/1AEGZdrEkr8kUF6ZiMXyEU6ldWpdR6EXV1op0JwXjSM1aoTJmY83tlTCZF/UV3qP5xds8feTRf79fxS4IHZQ8Da6f7OQlIIln0BPCrNo9vaS1RLwhUUWG+vgKz3DTJnCsOSdn0uLdPVZPUUezvaYOlcWBuRKdRw/GqdUzMxBKqPlwST2MAQfO9/zpL8DuFJbYKDietuzgxkX7cn5C/y3cgPBhw2dXJ0= X-Gm-Message-State: AOJu0YyU4B3IH6P+OgO47hZl5LzqWARmtYYxFsDpiDLPvnrfTKFhs0XP QqhIPgzqIgakVRGZEpAhMhdaBeCI1mOn1BbJ8cxlZ6H5N2VgLaSk X-Google-Smtp-Source: AGHT+IFp5rzNQzwb9sgT1JzgctraTYuaU8bCdfBAOCqgX/PcOHZ/BlCJIM7oWH0DudtrdomfiUMnhg== X-Received: by 2002:a05:6602:600d:b0:7f6:5035:1826 with SMTP id ca18e2360f4ac-7f650351c42mr444974339f.11.1719957572948; Tue, 02 Jul 2024 14:59:32 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:32 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 50/53] drm-dyndbg: add DRM_CLASSMAP_USE to the gud driver Date: Tue, 2 Jul 2024 15:57:58 -0600 Message-ID: <20240702215804.2201271-69-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The gud driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/gud/gud_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c index 9d7bf8ee45f1..5b555045fce4 100644 --- a/drivers/gpu/drm/gud/gud_drv.c +++ b/drivers/gpu/drm/gud/gud_drv.c @@ -31,6 +31,8 @@ #include "gud_internal.h" +DRM_CLASSMAP_USE(drm_debug_classes); + /* Only used internally */ static const struct drm_format_info gud_drm_format_r1 = { .format = GUD_DRM_FORMAT_R1, From patchwork Tue Jul 2 21:58:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720439 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 869C8C31D97 for ; Tue, 2 Jul 2024 21:59:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F41EA10E724; Tue, 2 Jul 2024 21:59:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MqwYo8iL"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id D47C610E732; Tue, 2 Jul 2024 21:59:36 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7f3d3919a4aso177958539f.1; Tue, 02 Jul 2024 14:59:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957576; x=1720562376; darn=lists.freedesktop.org; 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=3JTbEivvcQUwAcXrAriYcuJGP77J1qAidh1sZIrKRVg=; b=MqwYo8iLGylUJ8LwniuiRgPW1CwkvEFTys4YEFcSDhZu3sY2nK9V8fJnnunK/xdtxr Zu45MMj6CPNvV780w6JeEQTGcGU54AAcKTQV4uBUtqlOqOEXyLfKr6Fxaw8rQEhcuEBW AnbDWs9uOnnnVa3sIvf6XmX2tzLbYW63xKcIh0Yv18/LRt2UW9ZjaiU0sbpyTarMC9+v lhwYbe54i3qJ1zJ55w62i+jAQ/NWZPNiKSr5HpFZKtPVDuujZI144WABla4YPGl7JX0m s/5P+6nV31BVg77k1hy7WoIiId1ke6A49uD7b5K+Sh9dhewiFKkJ28LqiP3OmbqqZePd W/1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957576; x=1720562376; 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=3JTbEivvcQUwAcXrAriYcuJGP77J1qAidh1sZIrKRVg=; b=XBd8wvw2Ei6nrU9OoteQYyGHtJx4cOfwx+hPLxQhRBCX8nbjoAda1NOPEEoo56fbZ8 NflkyGT0rFi4m1RHztsnmhqkki6C1tTyRei5+KAgFVwBqw7zy7p/LdU6rYuVeGfAGpVh 3XbDZkSv48QBEl4vmRrlU/E8ndaozi01Bn39OuylhOpNGqtDqgWHLZvOm05EXS31vsvd 9JTXuxQXNljL55MsqoErXvwJrwdv9dPJBU8XTXROCpiyHvz9iw8qvRF3jYV7Xar+guRR D1GISfnRuyOZr1P7sS7Gwcf3U2mhIpw4H8IQ3WWlpv7ow06FLSiRgDtYhHgKHoSu987M wOUQ== X-Forwarded-Encrypted: i=1; AJvYcCUw7eCgE66PgTUTCVQvDd6GOuHxBxhBC+6wlSsu+r1O7GsEdktxgygSqN5NB2bAc+dCLJXtrHbMqefokXRT4tcwnd9vqb5Rc+scd0PO6ioBMVCsYxIvwMt1WLklw3EOoEQV62DNdncdQ/GHfnNnXIYeQbBx6B6PgsLmp7rWC1Lp8BgRqIsGVnRBuK2qINZ08QYbDvWfuCfWImpJopmt2gDXWjTjhRWYaiBEwIkrs5mhsgHogUs= X-Gm-Message-State: AOJu0YxwT9mKLcK4yWwJjpcM7VZS9O39lGG/UJJWWTiEeutDLlkxTHeL mVVnhPDVdOUdTr6rUlDcFBp6OfRC4iLBwTGc7uIwnqWwCih7X+hT X-Google-Smtp-Source: AGHT+IGZ5ru0Gbzul6gBrJZ696v99JPj2evs0BxHq6ZuGzyQecQi/AACVhwVexMDvP0Uufc1BvrHMA== X-Received: by 2002:a5e:c60c:0:b0:7f6:5143:34ba with SMTP id ca18e2360f4ac-7f65143367cmr343431839f.16.1719957576037; Tue, 02 Jul 2024 14:59:36 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:35 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 51/53] drm-dyndbg: add DRM_CLASSMAP_USE to the qxl driver Date: Tue, 2 Jul 2024 15:58:01 -0600 Message-ID: <20240702215804.2201271-72-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The qxl driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/qxl/qxl_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index beee5563031a..1971bfa8a8a6 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.c +++ b/drivers/gpu/drm/qxl/qxl_drv.c @@ -65,6 +65,8 @@ module_param_named(modeset, qxl_modeset, int, 0400); MODULE_PARM_DESC(num_heads, "Number of virtual crtcs to expose (default 4)"); module_param_named(num_heads, qxl_num_crtc, int, 0400); +DRM_CLASSMAP_USE(drm_debug_classes); + static struct drm_driver qxl_driver; static struct pci_driver qxl_pci_driver; From patchwork Tue Jul 2 21:58:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720440 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0740C30658 for ; Tue, 2 Jul 2024 21:59:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E42A10E726; Tue, 2 Jul 2024 21:59:39 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="NwTvldGp"; dkim-atps=neutral Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id D0A8010E712; Tue, 2 Jul 2024 21:59:37 +0000 (UTC) Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-7f3ca6869d1so192060439f.0; Tue, 02 Jul 2024 14:59:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957577; x=1720562377; darn=lists.freedesktop.org; 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=QvF7XGglS4kHqkr9T4qnSlSKUYwSoR5J7DGEbyHu2+8=; b=NwTvldGp7M+bDp2kwkGygQF6SNBJhuGbOG2jvsu3EWmIkzJWkI7MrIVjH37i5ANk+k KvLHpEWtwElPinWvteX60eN0XueZbR2VcCbSpvh5zo3DBzOIhqy42cZz0oeZvXXjXP3t zHQNy7Tyedl2aqLMd0BoqGUNk7I0m0LbRctfF8s4ATWrFuBhMQRjMdrgRlX8dHPzrBNZ 7tZPBtHkhThYMvW3Tn40vkOj6s5Q9CZVIaI7W/7+ZM1UqeCeiFl6PravfNRAwDJctNlA WTHfkwipuf7XJw4TiSGNJybn3sRTrZ+cKWCK8fExblDLNIG7LvOyOlrnjYAUFCTD2A4h 0uQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957577; x=1720562377; 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=QvF7XGglS4kHqkr9T4qnSlSKUYwSoR5J7DGEbyHu2+8=; b=WrENujxF6/uda4oM1FCNnwJtsw0RAm4qGq/e0ak+a3njB+GD4FnjIOt0dtuFF1Uwsm ArQIGnzyOCD/pBaByNEumsrWPcFROxSYXh3UeFvgu8b8TBaGw8VCZHAyuq79R9BVK7FI Glfl8fEdhEvlgQhS5bFgbgJ14xN6idWzndidKPXRPGtm0U9VxEfvLS3Kf8okV1+XS9ts 2RYskWzUA90aCVR2Ct8XQFJzZwerypBs67YIZTYC3CgzkEErfSRJPlI2vw/b9m9eW1J9 RI+zj9dvA+9GeoQsBK50W2u5NFlibKvhcEEVWScP/vqeGk5QHosrEAwtOOJXufesysaI ZKDA== X-Forwarded-Encrypted: i=1; AJvYcCXvD6qwthNYajoNBrfA7mxx+CdA7lIV+mKEdMewUfOXxE/B6HXy84voSTIw+nXSnjfnu39ABzJBIruiWVtbo7OYwi4m0qskNcpex26mPiVKV3nNSpqMbxPee9O3hdj/LTQggA5I6QxcAa3yypZp4k2fhCpJ6MTj93reLU0KHIud10jUz08+v8XhcuIZL/2uKWRTr2Ts7AeIbOvrMa/rhQyOTTZ+IQhR0oWWJ+rCet3nAuu3Sa8= X-Gm-Message-State: AOJu0YxqpnMtNL0fv//eD1ukL6K3rn48DEBkR9bs/UUjJs7ahJVNKar1 X0bc+cFLkylQgXAPiVX+s1EVrvMWSz7zYypopbh/FINQyrWhXhYN X-Google-Smtp-Source: AGHT+IHr+XWp6uUkEIN9sTm3FPIKljPJiX78B0Egj7pbRiS24t9LgvM6Rlaa2+c/8txTvNCTHxslPw== X-Received: by 2002:a5d:8418:0:b0:7f6:2c16:149a with SMTP id ca18e2360f4ac-7f62ee6e7c0mr1127312339f.13.1719957577095; Tue, 02 Jul 2024 14:59:37 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:36 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 52/53] drm-dyndbg: add DRM_CLASSMAP_USE to the drm_gem_shmem_helper driver Date: Tue, 2 Jul 2024 15:58:02 -0600 Message-ID: <20240702215804.2201271-73-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The drm_gem_shmem_helper driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index e435f986cd13..066d906e3199 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -23,6 +23,8 @@ #include #include +DRM_CLASSMAP_USE(drm_debug_classes); + MODULE_IMPORT_NS(DMA_BUF); /** From patchwork Tue Jul 2 21:58:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13720443 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BA8D8C30658 for ; Tue, 2 Jul 2024 21:59:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7ABD810E72F; Tue, 2 Jul 2024 21:59:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PGUwxlvs"; dkim-atps=neutral Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5491A10E712; Tue, 2 Jul 2024 21:59:40 +0000 (UTC) Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-7e21dfbc310so177462739f.1; Tue, 02 Jul 2024 14:59:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719957579; x=1720562379; darn=lists.freedesktop.org; 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=ym+La6D/NLLhNjjl/GCbF3WdukVm3ek2K4bqw3UNhOo=; b=PGUwxlvsqq4047XSh3EK9Magb8Hsnbmen0wIhfsGeKlMk3THMKrEIj89Xj0BjkqdWj yCIiCeApLqj9aqQW/KqfyAmcROpD7+XSoXYH4SKQ8GyjBhRDWYDsppsnHQWHAlcVt1uY 1xlOMZMN+aEiR5BjsgFnZfYqO3VrbmK6uh7ge2k8f1NW7rNA3ZLX9tIEbarsEW6Go6zM ldJ++ZQjfqn76JI6FUUqC4lsGVgfpvhozIUBrAmzRD8HZ3G14SIRw22vr+fhd7d6qcJL 50hgnLxyNJZDihAawCOtIaQhkiRsHDZtd57ilgs4ypMG7goX3BOvj15CR+wt6iYOxg8Q uUSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719957579; x=1720562379; 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=ym+La6D/NLLhNjjl/GCbF3WdukVm3ek2K4bqw3UNhOo=; b=h712AUCv0gm0CRRL3AOIv285hew5GsD/t2NHjFk0Es6CvNSEDK+OJ6Vb3K2rO+IjX0 DBcf6wwa+zdFFXbDJmbZL5mW5d2Y19zVwiJj2JSmlpA+Okx8SI9/+NiNtvYvzRdZvcHN Dq0ke6X3cn98gbyCiv9TqQhVL3+tgtNXAWCOZOjjvpL9R96L2CPpLP3p8VXfjTSnKA3+ PKNGHbI4DEGtTEbkgMVqWveTQ8/+1J7WcsW0ACO/1wlU84WLqH/TH+FwBvShrws/bRSA U0bL111MxQiFVQ4GZCjCHqgv7PHxwJQlR78F9o1PIwh8FQ+bzo3+GCuOIrrl/FU3sR7m o4Zw== X-Forwarded-Encrypted: i=1; AJvYcCXf/EIS3eBItu6udQg/C0bdlkeJaMd3ZTMxfzZJH9pkJkVC5lqgJzQpj/3AdSP52BZ17D5maFw0q57NO8ZMvyq8AjmUfcaXFYz5fXkz39fMG1y6kf4cYVX5OpkcXwvzPENHvBasfkC8rvrv12aimTOy77JAop6Gscs/l9LyN8IBRzrbxh7pbhLR1qB9p3ZHWQi+4u7Ye5XJMrZy6E5Ar8q8SJvawcKcdF2WL5r3xN9GTkRZYxw= X-Gm-Message-State: AOJu0Yxjtlb7woOlCr24wq3OKH5/biVjntGtsFnX+36SIee6Da6U3stv h+XKq8e6+4TrFzEU50VxX6zEoAqcZDS8JycKSrsfyKofP9SHgDNV X-Google-Smtp-Source: AGHT+IHIRUIlmI3WUW2mIpy7hm5XHgMqtIZ7QkWlOh59CvhPr4UBjQt+AtFMIBoct5NjwYy95AHiIg== X-Received: by 2002:a5e:d606:0:b0:7f6:1fcc:25c9 with SMTP id ca18e2360f4ac-7f62ee19639mr1076084139f.9.1719957579545; Tue, 02 Jul 2024 14:59:39 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-7f61d207fcesm279944739f.51.2024.07.02.14.59.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 14:59:38 -0700 (PDT) From: Jim Cromie To: daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Jim Cromie Subject: [PATCH v9 53/53] drm: restore CONFIG_DRM_USE_DYNAMIC_DEBUG un-BROKEN Date: Tue, 2 Jul 2024 15:58:04 -0600 Message-ID: <20240702215804.2201271-75-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702215804.2201271-1-jim.cromie@gmail.com> References: <20240702215804.2201271-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" end of official submission. Time for some quality CI Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 5a0c476361c3..b2ea73ae48f0 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -54,8 +54,7 @@ config DRM_DEBUG_MM config DRM_USE_DYNAMIC_DEBUG bool "use dynamic debug to implement drm.debug" - default n - depends on BROKEN + default y depends on DRM depends on DYNAMIC_DEBUG || DYNAMIC_DEBUG_CORE depends on JUMP_LABEL