From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE3E93224 for ; Sat, 25 Jan 2025 06:46:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787600; cv=none; b=K867sMrS5c+Bvb3WYJKV2RD3DkCeTcqO5rb0dhmeIHE+ze2q3ySz9yYijHCPdvvbAPuGqJSM2IPj//DU4rh3GjyFESvjpoCqeOlR4WSvD0fhVq1HjvdJRDQaLpR28tkLo8YFn6yjHbM/DIadXY0nXJDTpb6ouXiE6RbYo4ISxFs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787600; c=relaxed/simple; bh=/IQHOwDTPBPFbEhGu0NCFq4bX7TepZG3qE8DZo8SoSs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PM1R95BbJeLrAbZpQxm5VXDDMQM6lLfX8jFBEzCmhhR4vH8/Zf2gRjwzIZ7tJZ+ghMD52gluP2Zjw2urCCWPJif4uGyiUVAiFeCwc1ZR8fmfH4aeQYce0jOuJNr6RKNDInqRoZzRKR9kfhI8SCfaqCBBab2uhumZMuYPKj3p/vM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PtFoQKTo; arc=none smtp.client-ip=209.85.166.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PtFoQKTo" Received: by mail-il1-f169.google.com with SMTP id e9e14a558f8ab-3cfc934af74so14337625ab.2 for ; Fri, 24 Jan 2025 22:46:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787597; x=1738392397; darn=vger.kernel.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=AU/BJVCrYw/L98CqP4xWM6IdTrod6CaHL5wpnn7zk9I=; b=PtFoQKToUki5UwSdMERMYZ6EFXr23Wm1bqpGda8CIlrx/6OIxxAsTPYDFZGLqbXyua qJZ+uMWRdpG+UOTro1NfeRFPQNnk0sEwzvi9rD0hI1+QnIm3vpceZahycmrIXNekgegU n0kwDYHBynPGN0rw+RNdUsHonMKhpzDsPeU+e4YmKInw8USJBcN3HaJNVfyBdkV6Rrc9 HpsBwSivYUdVTLM4bc/eNFuapY/5Z6oT0iRfSCmqpN8bAOXMxq7L+oHodue35i/ZN6rl wZ+U3LvCBrh8uU8Rxru5uaRoK4T536yi2g7SNBJw8MMIWp2FnHDpOMRCh1t+Rov+tBdL L7GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787597; x=1738392397; 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=AU/BJVCrYw/L98CqP4xWM6IdTrod6CaHL5wpnn7zk9I=; b=Yd5+Wepyug65yzFqbKexWDaoJ2aG6cqbaiXlYKVzM8Zww+sbsFsC4NSDblYrrj4bOm lzpnn5K0bpAMvduy3YqLHk8Uo2fbeFRVISPjNIExjYgUIaiqI17YanEFRYlh7zKM8CvN vMbVQATY76llvSkWuHPsYrnNtuux/GTnrJtxmKlJyN1zSPqXPr+DVWxoI8Mgb3RWZr9B lJxxThA9akQf41f85Sn5QAefIDQyHFGHtlj3RKTRrzwAjW6xYot6xbNG2O89qF+qE717 nbxlE88EK0gIESpHXdA5/mzKFZqHZwQRMAl8nVCOflFpbIeVuNQuc8N5/kgf7/59C4Yz LzaQ== X-Gm-Message-State: AOJu0YzNE1UAT855+GhVrc6UYXqC9cLdrCd1GwbYyx/9P3YLK5Q7Ws/X FvVn6/BNuzN34hcDHzOGSvHs6lsdSkXIaOsKAToXavbKcVHmiQ4z2qV+1A== X-Gm-Gg: ASbGncsfKnhS20Nw1IvLiH38oulWLv23+gbiziYxBU8wYrA67SkIBdavPbuGOJDhrwG MavyDC9fpYQUBtuhdW25SBlEYfoTryU83FGBcWsBspzSZU3d6cMlNyDvjj8jJDkuOJvlyCjLcyJ Of2FVYzl4xWPoeQSpeG3xB+oC8teyR3Ul5678sy+FGNh3NM6fLe8wrIb8iNb4pdP6n/ZeW9Sje5 V4TzY9CelKc06XpGSmolEMCJGX3jgoDGUUZuUTqTIha+euWcAw8vccPoBQcewkmyYHQW4rdX+xT yI2e3KxCxC7UfbfD93AUBmZQL5fzfsVnSfuZTw== X-Google-Smtp-Source: AGHT+IGGQmsmMU4LyFcc13bApx7ltT6qUdG974W1OcN8PUVNTeEuTSdgnGp/+eHsAuANJUqP1kdN+Q== X-Received: by 2002:a05:6e02:1fe2:b0:3a7:88f2:cfa9 with SMTP id e9e14a558f8ab-3cf744386c6mr233064305ab.11.1737787597495; Fri, 24 Jan 2025 22:46:37 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:37 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 01/63] docs/dyndbg: update examples \012 to \n Date: Fri, 24 Jan 2025 23:45:15 -0700 Message-ID: <20250125064619.8305-2-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet Tested-by: Louis Chauvet --- 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/Documentat= ion/admin-guide/dynamic-debug-howto.rst index 7c036590cd07..691e0f7d4de1 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -57,12 +57,12 @@ query/commands to the control file. Example:: # grease the interface :#> alias ddcmd=3D'echo $* > /proc/dynamic_debug/control' =20 - :#> ddcmd '-p; module main func run* +p' + :#> ddcmd '-p; module main func run* +p' # disable all, then enable main :#> grep =3Dp /proc/dynamic_debug/control - init/main.c:1424 [main]run_init_process =3Dp " with arguments:\012" - init/main.c:1426 [main]run_init_process =3Dp " %s\012" - init/main.c:1427 [main]run_init_process =3Dp " with environment:\012" - init/main.c:1429 [main]run_init_process =3Dp " %s\012" + init/main.c:1424 [main]run_init_process =3Dp " with arguments:\n" + init/main.c:1426 [main]run_init_process =3Dp " %s\n" + init/main.c:1427 [main]run_init_process =3Dp " with environment:\n" + init/main.c:1429 [main]run_init_process =3Dp " %s\n" =20 Error messages go to console/syslog:: =20 --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A43BD1CBEAA for ; Sat, 25 Jan 2025 06:46:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787601; cv=none; b=o127JKFcE5EAjgtqoRTtPrvFLOphHKTEjAFSQe3uIIyf3LYeClXh9CTUDfjUI3g9ZDV5SsAqSnbs/WHv/Qk87uEdEaLLzS9yi7xhBjwsZYJDYR5X95EhXenF2+xxjUaoptYZvHfzttFpeIJt+Xe4biH7nG/BIw91VcSIz90MsS0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787601; c=relaxed/simple; bh=+nbdECC6hr4J+KZFF6I8gsN5VGowechQ2lRt7/u0VFM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M8KdOEJ0EuNcY7uAGTgKVJSv8aOWUcO4dD/sOxjxXouFtQ4fWE6YAjh/7sCf/ALGXxn47HSB4BE2jdJq5B+lzUhyYQ4a4If0C1ngIvT166uGvYPbVPIMaVqxJ3SJYlD56Iw78bySqU+sny3hTUspSucYBps6RDw0AOrcMrPLpF4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gOMft61x; arc=none smtp.client-ip=209.85.166.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gOMft61x" Received: by mail-il1-f174.google.com with SMTP id e9e14a558f8ab-3cf8c7b2dd5so8338565ab.0 for ; Fri, 24 Jan 2025 22:46:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787598; x=1738392398; darn=vger.kernel.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=Ft3kaHf3s63Qx64Oiqt5pWkoJOlyyMIiN2I4om5s3ck=; b=gOMft61xCV9cu+a/oUZOVjItf5x7/+DGBH7X1uiHTuYkWzKKibm0ALUTM/qP9K/gDL arzVuNTGhHc/j7hEeMtlNmzq1yfQ+IlLFXiG5WcDVD030jD1/ahx1abvvUXTLIqp3Z6g lAtFsqFmfMwv4kkq0dSXk5+tiEbVVH6DtgQS6ftf/KodeOu4A6aDDYNs4PYHzfIK5yvw 47RI+S2KYP60tmOFGYV9y+pMMpsN9J3q/HGFmMvvZpV8SYQrLs33rZYD6w/Y4Wp46nXe Fd2OXHjZi4Y7oRStAbAvpVt8T+wLwdgGCKHqchXnEgkoeYBRBX8aqGpT2XtcwRf4wfYZ d/jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787598; x=1738392398; 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=Ft3kaHf3s63Qx64Oiqt5pWkoJOlyyMIiN2I4om5s3ck=; b=hJFiatXwnmsnCYiNfdOrWxrKjv4l9qSckPb2koJltcaBWcerKwD7ZXhXltq1/uB8GR 0/2nSoO5e1sjZYKVfUb2Hx/N5ZOnljJsLQ0aMdueW6ZrYELEBE2shJDhSNtxw/FikgEs 34/aP84XRD/jlVY+4LW+uJ1IxmfO7J82HqQdpsI8O5DOP5XRYarnrnGrZSarzCp/dnQC RTOxlAeYUlxkKLBIE/Ajm/t5igAqFpSJRbUK87900ZqaLf2nLzlBroKeFGZsT8nv26rw 7brAAocKcIyn5jOP8rknoSh3s9EkYLcfzy5LLjw7XXY8HlMisG0y42L8aA3QlxEG2DB+ 8qeA== X-Gm-Message-State: AOJu0YwUZhUn68SV4LTyNI67dmiecjYklzDhX1itqefG97O+OEdxfjJH KuWRQ4xSv6twuXlmcmq1v6tMc9IvlqFd5vUGZfkJJ9ZJhz/sWmduxIwwOg== X-Gm-Gg: ASbGncvKqIqzJCOUmINrxhZZ4jj3z4VukVYrjv2O7rReHhrP/FdfOS7534bbQrpspTp qZ/Qa+kMhBkgu5UYCW0tD0zRcmR/JCK4hVCQ+7md92Kg7PzzqdMaYaUSp5zbmPwDqPZTJIksGK9 V4mXRvf8J5qv5TnVWldmbRGP4Enif4HJWbntCRvgykOXoTrUegqisrZ6h0+hZW2m0h7+hr90+jM tBrKdmKh1P5i7H37v7sFb/xKNu8kibtbx8DcNnZ21hu0TO0U2PwfQndntvQrrt16z7fGR30cxif r9MR76CNkt/gCD1EsbBF7Q8zNABJtz9UJAEBOg== X-Google-Smtp-Source: AGHT+IHVQ3SPCoXjVUywLVkrU9R+6hMn47R/0EYJi/tmo6RYCSpS/s01/z4ThGKSbkXCoFQMv2RC9Q== X-Received: by 2002:a5d:9f04:0:b0:851:f176:9827 with SMTP id ca18e2360f4ac-851f1769e4cmr1422016139f.5.1737787598471; Fri, 24 Jan 2025 22:46:38 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:38 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 02/63] test-dyndbg: fixup CLASSMAP usage error Date: Fri, 24 Jan 2025 23:45:16 -0700 Message-ID: <20250125064619.8305-3-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" A more careful reading of logging output from test_dynamic_debug.ko reveals: lib/test_dynamic_debug.c:103 [test_dynamic_debug]do_cats =3Dpmf "doing cate= gories\n" lib/test_dynamic_debug.c:105 [test_dynamic_debug]do_cats =3Dp "LOW msg\n" c= lass:MID lib/test_dynamic_debug.c:106 [test_dynamic_debug]do_cats =3Dp "MID msg\n" c= lass:HI lib/test_dynamic_debug.c:107 [test_dynamic_debug]do_cats =3D_ "HI msg\n" cl= ass 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 Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- 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 77c2a669b6af..396144cf351b 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); =20 /* symbolic input, independent bits */ -enum cat_disjoint_names { LOW =3D 11, MID, HI }; +enum cat_disjoint_names { LOW =3D 10, MID, HI }; DECLARE_DYNDBG_CLASSMAP(map_disjoint_names, DD_CLASS_TYPE_DISJOINT_NAMES, = 10, "LOW", "MID", "HI"); DD_SYS_WRAP(disjoint_names, p); --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D210207A08 for ; Sat, 25 Jan 2025 06:46:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787602; cv=none; b=CiVp/Qn3hnu3/vBt/Bz9CJ2lNAe1zmrqMac21XA2J055D25OHQfjhs7b2up8FCYlSdo36IFz3JTLTXbKeD14oXuTTdzTa9r+qBaxV5AqIorPvGV1pd6rKBBVSBOfT6/Gn1j5YG/142oU+WDrZtyIDeSSuUBCKWNfB2FNik0Veyg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787602; c=relaxed/simple; bh=nWgPi3L5Ju6RPUAPjOidsUriqNoQ0PTJ9Qx1+By8rf0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UxBkfrTCwfllawVLYu+DePcb3/rQfRpY/koI+LuI1ZrB0bM8E6OOA8PaZQmNRRjWgHR7DDZQc5PHe1b6j1tUC/4hxmymQxeS+/vj0lOQngbdXBZVdX7w1goIeMwxB70oqA4wPD2ehynp5e6Gz9u4hHUpV3NdV/qumJqjUiQrDXw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XxoEt6Fi; arc=none smtp.client-ip=209.85.166.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XxoEt6Fi" Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-851c4ee2a37so198172939f.3 for ; Fri, 24 Jan 2025 22:46:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787599; x=1738392399; darn=vger.kernel.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=lC0bEfQkqUFUX2DEnhyRE7tZ3eJxkUlfRX/DOTIhCKw=; b=XxoEt6FitcFxmFDzkysiJaAyZMwSF0+uN0BvZAj6WTXEdPIpa2wfhpti0m+l9JNzO9 ryajozYNOv4XwB12CWRyQx/kThnhZDdpvz5/9xJBGQPw53ILR59xT9n7HH1LOJTpKQ89 ONy87qNmhdS55gJ2bI/Iho9CyaPOOl+vedzpwAGNcv5IPeVRp96rVEaMx9pL7XTMMAUn e1wmZhyyjEjM6oJBexho3VGijMTRQX+4AsmSZXPKlZCHF5RgTCcTvJ3jumGEa9TuayIz M7Sc3p6NgNH2gFol2mlVBeeQ/+g8Bgi+KU+4zcFGCTBYV8jUIRiFui2X1yuiqiDYFKri NyEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787599; x=1738392399; 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=lC0bEfQkqUFUX2DEnhyRE7tZ3eJxkUlfRX/DOTIhCKw=; b=tho0Qy4QGQI8wcOnQdpzSPZUcDK5uVDfWBIqhqIQfnM9gI6TW9LIIilrWlD+ATTTmw c3LaI+XFxgbtg62x+RfYBD7cMS76ien6LUENL42XRCbr2ZlWmUa1hYhblGb+hVVlOtHv lKb8S174u93z8moZitDZRrci+pObNInaUfC377gltbCoVGAt8spcc5keEZQUFKZdRNfP UcNEL2ESdiSoo/k4rvlPI7xd1/NsltebxwajXPwE0iusf8EZxCdFVUbuHNWuZ5D9ZYIS mg66+sSmDJ/kYSNAThBjG70ycewPDaVYHhmWrZAML9IGwidnnaJFL/C0d89umqFCmoHN Z1tA== X-Gm-Message-State: AOJu0YyTUtXJyK4YSuDrcAhdJ3j9j88dZRMX4qIn+TaZ8Rc5lRPF7/NT tRdlmDmB6bDc+20iLYcEp1B58EsSPtCrscB8ajyuIR1O5gIgN+MkJaj8QQ== X-Gm-Gg: ASbGncuMYU3mxShy1vLLWAxIc3Vr8uTHTDAU+01vkDnEDwQhNsIJHVVXItH2JKfbZNA jqxFkRILwBmvjgoIHbAXMpQ+jfhpBdLd5U7DhS0H7T4vHttKSWmIpJsukPTOq3LhZXLwyg7ybHv eFoDtyrU0iOVjuZ9A/f2SmnbzYARkoKgiwDhYISxfcXWMgawD3hgAqaR106ELgyQZPg5Xr0vuNL 4Al0jLPJ0435MhKGzSlfKlCHt6ogXhzlwc6+mxfuISyEb08WwRIKUuNq6OTy0LzoFBN8FMHasZc 4aQyiYE7NCOnV/ltunfKwahpo5EAKKLzteYnnQ== X-Google-Smtp-Source: AGHT+IGCJkMDi6QJz04QzrJP+6InsJu9u2vONXpHhIfvz9GYsm9WZO74SuyY8vqfLEAfr6A647uPAQ== X-Received: by 2002:a05:6602:488d:b0:849:a2bb:ffdd with SMTP id ca18e2360f4ac-851b618abd4mr3617977939f.4.1737787599462; Fri, 24 Jan 2025 22:46:39 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:39 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 03/63] dyndbg: reword "class unknown," to "class:_UNKNOWN_" Date: Fri, 24 Jan 2025 23:45:17 -0700 Message-ID: <20250125064619.8305-4-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- 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 5a007952f7f2..147540c57154 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_putc(m, '\n'); =20 --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBA70207DE2 for ; Sat, 25 Jan 2025 06:46:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787603; cv=none; b=ly8GIwUhoHw+Y0CqVpt934e+ZsUP9rfQFnRUktniv6YINQ3t25VldNXNKdcwlB7ejJ+LzqZH0YqnJjWYiploElwxkoVZWoky9IuxclW1KEFvFFcz7KvuNsBEK+OekUlwLPkOBGXG61+kigldpwDw/3TuJo8FspLH5hPdiWuNSWM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787603; c=relaxed/simple; bh=xBSBEQNBO39rbIFsNyyaVaUZyAazvXvcWuDuIXuvpNU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aFB4SUHYkqjpCY7eMCW1qWoFL/REsDtWDN6jUONphUcMxfpmYrmcztrAip4GA6bE2/GUcMddd92diq/AxxuVBWlm+N6iURfETu4enFpmt5fOdbdOj4WdvDYYvV1vSIKdCnqu8XwfXVC6VEGPAiknzV0y4O0r+Ia0rsw821Cvwoo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nbwObuyR; arc=none smtp.client-ip=209.85.166.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nbwObuyR" Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-844e394395aso80202539f.3 for ; Fri, 24 Jan 2025 22:46:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787600; x=1738392400; darn=vger.kernel.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=g9s7OD1sQ4+HufNRNHWDoATH13uKXMFeEAmrzFZExds=; b=nbwObuyRqJYBljOhlUvULUPgNGksKms6r2p8rOZzIWVuwMsxdjH7oGFzHjRHLJ9tM3 zoidPUtWuREIQa11T7AO27R3R87QxT4uHtB9kLfDpyTsXAImvABv4ZzdO/iyxNGaaW44 DEhWOzuohSq84fioAFlJ9tzGS91C037g1QfNkOlgkbOokfaI+tcO1BVi/vgKbg1ESFJG SCWM8VZcZ3KNcdRYrB3cOF8tee9atplN5NOHKft5yXlPfNyiJznFT53SToknrW9sWBGE 2p98D8XomhDCw6Lr7xiWGqLoqtCzqNyBqZVgiRoXZ7UWVQ+IP674DU+JpiD63dbrv1Kd Nwhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787600; x=1738392400; 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=g9s7OD1sQ4+HufNRNHWDoATH13uKXMFeEAmrzFZExds=; b=gvPylGEiIRlYKwBA3322xvDfS2T+oG8SVXGetNs2fhDtygRSXezm7puhIuaV3GTOoU vbeqy/jmQrkXl/NoTmCrbbg0lAMxkvZh0/BNxoskLhAlsK5qEeyg4Q+wQKNaxHefeV22 qnsAipvTWuj/33bGazvOKf7p8rF3j/ixL4r7ZzoBNj3rxK1Eb+y35ogOk/uEaEkbxnD5 blpNbhGmz5vVVrn6IxfDhNtTtAWuccXrLcQ3vqNDQbV+WXyLU9jfS0bu4cLl++HBIoGd tcbe3X9Nl41dy/Qa26EQ1fMu/D1Omup6bxakgPhulwARBkuNGq5jMAxnmh9WaSFkkNAt Av9w== X-Gm-Message-State: AOJu0Yx0Ld90MpOZ/rpmHR8nmGoaf0D/hVgsD/PyOCOD9EW8PZqkKNwl Z09ml7AXjxXLo4awG6rvewZd4pkC5qB+dy7s6x6NyCQurvFGgKcjeaCb2Q== X-Gm-Gg: ASbGnctpsMPGtcj8lWLUOj9tL66khW7gr//o0CAKv37rYqzfBMMK1Cr2GJh7L7ky/dY NMeo8GcDJYFGtGkXJC8StLcxJS86omN7kzAOgoJa0ENcZmBPwJ9nCjL9gc1fYDzEcQcm6jAh10h yBWkYmenuWoQ7/njPC2+PMDyYEfmr+I5f7DEHvEOFpiKwTh56osh79UO/YplCcJ4S+cplwNVpmr vCjTyT1onFYNCYJ+fXg0imJtd3/m7g6ARbOhQVAdCoqZbfpdO9JEk/MD+8v+l9SJKchWoeVTuNk PpzOsb8OuFs2thWZzgE4qEBreV9qRA/MEoCK5w== X-Google-Smtp-Source: AGHT+IHgbpWAw3ToF51VNapcA24BXvqXwUUtA2PGPS4mT2XtqGWGo3JjVejPDRtbOWoXeUzU8vi6VA== X-Received: by 2002:a05:6e02:1381:b0:3cf:b7c0:8809 with SMTP id e9e14a558f8ab-3cfb7c08be4mr109840195ab.8.1737787600600; Fri, 24 Jan 2025 22:46:40 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:40 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 04/63] dyndbg: make ddebug_class_param union members same size Date: Fri, 24 Jan 2025 23:45:18 -0700 Message-ID: <20250125064619.8305-5-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- 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 ff44ec346162..b9afc7731b7c 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 147540c57154..55df35df093b 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) =20 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; } --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E84E3207E1F for ; Sat, 25 Jan 2025 06:46:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787606; cv=none; b=GrZDrBWwBW26/m/d/JfKqeMnL0Un6vGk8NN7Q9nzwBZSk5OVT34o3fcZN6OWtFFLyTtcE+r4fdAPjL//INFOmC9Su1pbFEKwIqAVx1OZlEEL2WE3PmwzSHfqqCqlrTWxGasySUD2FSVNc0PYMzCQTtpdhvHp3oQ9PmitkoFHP+I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787606; c=relaxed/simple; bh=EIYhbxTUMhRw3ToPItoiDCqkJRHa7xfxgNYYKsW5p8I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e6x/rlMWB3r6p0DWP1EIgI6+iWpu7odKuO+qJ+mHpGEV8xidLiJiK409MxEzwqT9/AVeXp9vTDOWN+EFX5d2rX8CrDftTP67uwQki/Q0dQPQgUtkb6D6QnllxJAiJeWm8aN1YaIKeBwCTjw1bqMdR1aTmc+dmiWMKm6y5nuy2H4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XJP5m2M+; arc=none smtp.client-ip=209.85.166.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XJP5m2M+" Received: by mail-il1-f169.google.com with SMTP id e9e14a558f8ab-3a8146a8ddaso7563575ab.1 for ; Fri, 24 Jan 2025 22:46:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787603; x=1738392403; darn=vger.kernel.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=sV/JSNgUN2kOhspoJIscYn3MOHKykltv8W9GFMXLDKA=; b=XJP5m2M+OGJIaQiaq8QcY3yj/9HUNFKVq26876RFwnFPAv1fDZdxzz/d8vH09ax9QR mYy4rjK552OK4Qc66f4cFWDUwK9ESb9ie0JrfbkogR6u9KAQ8Hcr6pi0xCMr0bV+q0JC dnKd6iTvdEd5955bzPhJSapCKL65zJPy2ksK744fvUQBnqU75ymSQtK9xEoSvWgi6I5q PYGzIVfNcOLecyJ/+GNOeSJYxAC+FvL7G61CGYGP1E6yFy0tTWs/+wEztySSwqUfIlZI PWvejNs3/s0VsrnGm8yA47tKVkbPDq+XKAkFsRbVkNPjp7BRG8VNU6rt0One/Z+qv3CH lJTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787603; x=1738392403; 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=sV/JSNgUN2kOhspoJIscYn3MOHKykltv8W9GFMXLDKA=; b=oX6u2exZeWRjNhsdWsfkzy7doN/eQ6fXw24iw4baJgnKgVkbZVklJziVIAMsNwcnG5 EW5ZGr9BFGEuFreLSsi3bDzsOIm+EcZZQCrh2GXiW9aSm/vHkf+boQuRieK44rkhp7J1 c12hLWkxqTajLs9cOCSE1MoUp327/OwDdPWQct0omUaIfgcZ8JfiTx7rYUtV7VJqnbWg gm4VN+IACqGUBx5JePvCUvhaKjiYRBxKoQ/WY5PlYaoaPqVA6NTQAgkhImjPFWl6YLag gazggEROMnX5AbEo5/psxNcWJVGrmLfbb95T8TK9SjEhXZ3RW/SR1zI+Q0Fi4xA6jcC+ KiAg== X-Gm-Message-State: AOJu0YxpYLt7OvR8s5rt66/92iQ2307E6ZufnEybU8NCbCKdW0ZITpSq NjWwA77JVHPf+uAj9SfZJbtRjgQGJZbB6gWYD0jFGGW7XRH4UO1cWjamgw== X-Gm-Gg: ASbGncuhuMoFgrEP86xrahHsJ5HAxRHqbFmCx3rWghXE814Cktxc9nle1hL8pFBraG7 SOQ2VwcpM0WRMl1651i8nw8VoCy7jd+8zi+J1DV5Ny6W4wr+Npm2eUhstfAzS88Vm6tAD5Byb7Z T/yDX6YDvNAGpoRkQd014JWDnb8URsB0ZfocFYWaTBY3NajsCQvhWYV9DRMfyIWXL0GOYDguYIA VJALDXaSqje8clGUSiuuVc5cdbVDYfxeDy7mVJUPLtj0Oe1FmFE7Rfr8J8pxaASTe4pfbURzOUL RWjEyMGeytpwNG0DsRS+7BxrkjwIsBULYf+M1A== X-Google-Smtp-Source: AGHT+IH54SsfpEYFO4ra8A4an4dLcvoG9wSBjoRiIYetoUV1RolCgaxWz0ul0FtpQ0GQuZ5n6MM7Gg== X-Received: by 2002:a05:6602:2d83:b0:847:22a7:2412 with SMTP id ca18e2360f4ac-851b623bb6cmr3299746039f.8.1737787601748; Fri, 24 Jan 2025 22:46:41 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:41 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 05/63] dyndbg: replace classmap list with a vector Date: Fri, 24 Jan 2025 23:45:19 -0700 Message-ID: <20250125064619.8305-6-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Tested-by: Louis Chauvet --- 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 b9afc7731b7c..2b0057058ecf 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -83,7 +83,6 @@ enum class_map_type { }; =20 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 55df35df093b..41cbaa96f83d 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[]; =20 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; }; =20 struct ddebug_query { @@ -147,13 +148,15 @@ static void vpr_info_dq(const struct ddebug_query *qu= ery, const char *msg) query->first_lineno, query->last_lineno, query->class_string); } =20 +#define __outvar /* filled by callee */ static struct ddebug_class_map *ddebug_find_valid_class(struct ddebug_tabl= e 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; =20 - list_for_each_entry(map, &dt->maps, link) { + for (map =3D dt->classes, i =3D 0; i < dt->num_classes; i++, map++) { idx =3D match_string(map->class_names, map->length, class_string); if (idx >=3D 0) { *class_id =3D idx + map->base; @@ -164,7 +167,6 @@ static struct ddebug_class_map *ddebug_find_valid_class= (struct ddebug_table cons return NULL; } =20 -#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, vo= id *p, loff_t *pos) =20 static const char *ddebug_class_name(struct ddebug_iter *iter, struct _dde= bug *dp) { - struct ddebug_class_map *map; + struct ddebug_class_map *map =3D iter->table->classes; + int i, nc =3D iter->table->num_classes; =20 - list_for_each_entry(map, &iter->table->maps, link) + for (i =3D 0; i < nc; i++, map++) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; =20 @@ -1200,30 +1203,31 @@ static const struct proc_ops proc_fops =3D { .proc_write =3D ddebug_proc_write }; =20 -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 =3D 0; + int i, nc =3D 0; =20 - for (cm =3D classes, i =3D 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 =3D di->classes, i =3D 0; i < di->num_classes; i++, cm++) { =20 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 =3D 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 =3D cm; + } + nc++; } } - if (ct) - vpr_info("module:%s attached %d classes\n", dt->mod_name, ct); + if (nc) { + dt->num_classes =3D nc; + vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); + } } =20 /* @@ -1256,10 +1260,9 @@ static int ddebug_add_module(struct _ddebug_info *di= , const char *modname) dt->num_ddebugs =3D di->num_descs; =20 INIT_LIST_HEAD(&dt->link); - INIT_LIST_HEAD(&dt->maps); =20 if (di->classes && di->num_classes) - ddebug_attach_module_classes(dt, di->classes, di->num_classes); + ddebug_attach_module_classes(dt, di); =20 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 =3D list_entry(ddebug_tables.next, - struct ddebug_table, - link); + struct ddebug_table, + link); ddebug_table_free(dt); } mutex_unlock(&ddebug_lock); --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDDFD2080C1 for ; Sat, 25 Jan 2025 06:46:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787605; cv=none; b=aMLw2jWgRl4ypM2hR4EDVYcSmemmUS1Js0a0K5ofvQraEqVeP4TiG/kjvO7nbXZogIi9Sf7JD5RAIyXrjZY2fWftZ3/nGMP2El2kJ27VPt6FNoD2ONdJe5miY+ZLqtA9bvidnQIVpBLT4hN2fATztgjsMdPvVlc8L6pUgF7AS5k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787605; c=relaxed/simple; bh=Picx7G5c+bSoN2bXvLcIaJ2p+WmVCxdOBIdUNxnXsE8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U7GJgHTONXggpgxORNf3WV2I4yk0rJoQz+B7n0pJj7/R6qwvKzglo5F1HqaKxWxF1X8S8FmFkYJW1iEH1y/xAWfdGufdE6hNOB3+IM50fxzo4PwLJp+h9hZYqSern0tPloFsQkJ+SP8c8GdocrPuxw9Pt6nYsUDNB/H14c8GZGg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MYqP+10L; arc=none smtp.client-ip=209.85.166.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MYqP+10L" Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-84cdb6fba9bso226652339f.2 for ; Fri, 24 Jan 2025 22:46:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787603; x=1738392403; darn=vger.kernel.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=CqVpFbHHatr/2ING85ieH4d9rnOXpZNWBvi8gxx8k90=; b=MYqP+10Lbe1bcdxYx5Ma8BuPyKZuRILoIo689agPuxIlP29+nKjVJXH68fRJllRfEy Lm4Vghp2y7V0q9LgiuscE6gftR8iTiE50nVYic2IRhlAg2orue8LOPUUMd89AW6/l/lI jBHm65ks9tXxR2nKzcTzA2xIRn7THDMd0CLs+dlgyiaMS7r9ShmxMCbxUbDyUuh7/1pJ 0e6d3ZQkdn36O2uw7HPj5JO6m0Ord7y2N62U5iQ6X9pWUqgo7/BZ3OZxzJx1hMSYR+EL clrscloZlcmRZ852qwY4JhbEsLaPzef6h0b8s2Jqpk2rJ/9/o3klLQ/qn+lSGukDpK6K 6PzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787603; x=1738392403; 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=CqVpFbHHatr/2ING85ieH4d9rnOXpZNWBvi8gxx8k90=; b=ttsH7d56uWUa0grqTZx8r9fmgtvnTGIAZCjZIuuOWXczOH4/IYXPggqwT8u1egc1xA fcqdlqdKt/kyC4uyGoKVeUvn/93vtC7rMqiZ6tXTMaMVhieLhEOpPq+XcsG0lvisOuc4 CL8Yn/VAmJsREY8bLGlucX/vndNFbJNva96PoZfsHGeUuon8RN7NCJcUHIKU+nmNo1fC Xim3KnkSqBdhjlr0R19Rm3sfnmgqi5WocvrzL0UwX1dRpd0uPfItgKllpbXr5+JSSiFB kiJu7Ma2JVagAAQLaanWrTJZO7BgYBQHSPI+XAjeeIQd+te4yfNCqi7BiYDIylqooo9f 51dw== X-Gm-Message-State: AOJu0Yx6UT9FUMtQn9aEYWm2HKLOsv3lxRbTUQ39nkcol2LK46OUhcdf /jPXUj6Sfj9k0GG9ioLpYcX87Y3/YHUS4uJyVW3F4sDYqh26SdBGnIi5Vw== X-Gm-Gg: ASbGncvMtiR+hazxtFvaYbcVnf6gbO+i2WUVcVNRpswtt2Fe42J98IaZM5FCrocoHL/ HE9PeyRyANmKeNicQF1l4XUKe/dY+0DGsBwUenjOUD7YgsNpz5Shh39nVxbQHPeS12kihGVZWUr FzrJr2kvaW/y1Y5fXMVloKCXQJg8nc27FPocrrHYiuP5fQRzzw4ORGNYGMS1B0hHo1M5WXBAV/f YtNCjuOgTHcrpsrQ6Cw83RR8tvr0uDUffd8qFsAjw279QiQ5+Aydwy7Z3EtG/7agoW6mIXbIu7g J0ooI6O/pZ6wNwvKGidoJA4zAcl9T6Czfmlj+w== X-Google-Smtp-Source: AGHT+IEG9pcmO7ys8hwr6eegaGLDGSEioGdLb+KAZBSau8bqMWNW5dSAy4HzShNFq1TzGgbki4fQoQ== X-Received: by 2002:a05:6602:4006:b0:847:560c:e7b7 with SMTP id ca18e2360f4ac-851b61f053bmr3495732039f.4.1737787602874; Fri, 24 Jan 2025 22:46:42 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:42 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 06/63] dyndbg: ddebug_apply_class_bitmap - add module arg, select on it Date: Fri, 24 Jan 2025 23:45:20 -0700 Message-ID: <20250125064619.8305-7-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- 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 41cbaa96f83d..8adb81e75a16 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) =20 /* 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 ddebu= g_class_param *dcp, int matches =3D 0; int bi, ct; =20 - 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 ?: ""); =20 for (bi =3D 0; bi < map->length; bi++) { if (test_bit(bi, new_bits) =3D=3D test_bit(bi, old_bits)) @@ -622,12 +624,15 @@ static int ddebug_apply_class_bitmap(const struct dde= bug_class_param *dcp, snprintf(query, QUERY_SIZE, "class %s %c%s", map->class_names[bi], test_bit(bi, new_bits) ? '+' : '-', dcp->flags); =20 - ct =3D ddebug_exec_queries(query, NULL); + ct =3D ddebug_exec_queries(query, query_modname); matches +=3D ct; =20 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_bit= s, + query_modname ?: ""); + return matches; } =20 @@ -682,7 +687,7 @@ static int param_set_dyndbg_classnames(const char *inst= r, const struct kernel_pa continue; } curr_bits ^=3D BIT(cls_id); - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits); + totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits, NULL); *dcp->bits =3D 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 *inst= r, const struct kernel_pa old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); curr_bits =3D CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); =20 - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits); + totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits, NULL); *dcp->lvl =3D (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 s= truct kernel_param *kp) inrep &=3D CLASSMAP_BITMASK(map->length); } v2pr_info("bits:%lx > %s\n", inrep, KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits); + totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, NULL); *dcp->bits =3D inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -768,7 +773,7 @@ int param_set_dyndbg_classes(const char *instr, const s= truct kernel_param *kp) old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); new_bits =3D CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits); + totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, NULL); *dcp->lvl =3D inrep; break; default: --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 200222080D9 for ; Sat, 25 Jan 2025 06:46:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787606; cv=none; b=tvKVvNGvkdJgnDH8AYQWpZTbx+f5XE7ya1Eb+3uXyyTj7D7GrTc91rvskFqY7ao383on/mIRL1ycmxnggHtl9spDK3FcC9nTuriTz2sFoAsmKOl/nDPp01AbfaS8PquqkUyPfv37kuxTuzLF8x+4BCXd7us0ruh85ExB06Fm68U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787606; c=relaxed/simple; bh=MZv3bpfTSyCGgEqbsD5gzfkax2h9z5yPX7PR0S81+Co=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M64WuC/YMO821H5OqS2Yijq+u9T4zsv3Lng+8kzvaLeDE6/537dgOClphLCaXayG8MEzFoTj1jsID2LGa9KbxmMsBrpfCbHX86AGSzTQeWmM13aJ+BIRSL+1QyVD+aojCTkfhMCahDUb1uwBb7eh6jXCUc2jRhgbvKEXoh10Pt4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZyunjDwe; arc=none smtp.client-ip=209.85.166.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZyunjDwe" Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-84cdb6fba9bso226652739f.2 for ; Fri, 24 Jan 2025 22:46:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787604; x=1738392404; darn=vger.kernel.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=gfV6PeTEsI0VgSdAZwuy1u+rsYeivbmD+1moBtyYi7s=; b=ZyunjDweUlb0DcobXh3gnCjA24F+Zy/Bn4gQIzPvyhJ7jnQHsPgZU/9ZzK8qyxg3X/ pm7V2ot7fCTkcqPCXfaHyeBl05FNUb4T4tJhdF27SBefkR0/6Vt0Hau9qZveT5+4UACD KNwaH+/n/aDRPQeakWWN/nWIMfBrSCweDIQH/lMQwLT29rmtWGQvEG1fnr4PASKB9/j9 i1dezyaxKnaMaB3M7i21HTlsGXG93AYjT0YbTD15HQvdexh0qVCE0vWRHxfvd7L05Tml hI/fRXABX9DSc0x0bzMKwSXioha9duMvqGVB7UZT+g7HaWSE+IMGLo7wfe9XxpAM5tVj He+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787604; x=1738392404; 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=gfV6PeTEsI0VgSdAZwuy1u+rsYeivbmD+1moBtyYi7s=; b=mTKAKPNbDiQzAdlYXIZ9qxt3G8VlfdUMWt+vP5xhSvsyJFP+4BzUkoajb9IfUw86ob /nVMMvXZfwZZJxA/p5KSOJX+MLc0u0Cqg5RBvkRNvdz9xcKkI/2cTvINzkOafhEo3jF2 GP884E1MF44VeL/tOpbe95isPJosaMoTN53JY75dRrWtvVUgUVaGGaLOSwPd3OqntTv2 iAd5LzOsbic43QmhEPVLsVFnH8Gh1F/TqIZG2qk2B+wkaQzB7Z9yVWw76ldS8VLBFzGe RjN6DS9Drv1FDJci4dvhdT3aE2jVivnHnyfdSdItg6NFHvkksYYCn3T5UStxsbjkO7vK ZulQ== X-Gm-Message-State: AOJu0Yw1u5zLM+sgvC3MzRfZ+pzxeFjn6RLfsBA/rz4PUgpb2oTN5pRe NvTFJ+b5yr4FuYcRmBkbLshueYDcHX+Z2pdhpFkvYTTnvIqeEFGToRBuwQ== X-Gm-Gg: ASbGncu3xbwPZS8Wvr6jttxdbyXtxOL3L68BFKurrnpv9iSHzmEJgWCqbRdr9ZMC6/r PXZJbMoIcf2QPrfgwaE/1UjNzc10XdS3t98U+FaY88gvZlG2YJXAULoqtjXALCPXQBLhbJ5aUHG /kES9aNazsQ29jeDkn5leXZwOSvc6VlkDlPZeRePDBZhjssRRs9dM4SQZHlDZD6E9MDA21g92qJ mqvMJFio6mnbB9cfZY+6at3hIo5tenfTC/y5+xCiOt02+BylMkxlnWG4c3eMzZtM5U/3XupOFU7 4Xv9Ffwl7sMpaFx8z/kMjfYjsRgD56P8SQPQiNo+RGxonuFx X-Google-Smtp-Source: AGHT+IGNmawZ5H7p5nSdLzECedgsD/gX3TGGq70Fq+Pnwp8P7+wi2jDLWawGYzx5t0CkZCBiLMpQ1g== X-Received: by 2002:a05:6602:6c06:b0:84f:5634:8a1b with SMTP id ca18e2360f4ac-851b619f8f4mr2827044139f.2.1737787603950; Fri, 24 Jan 2025 22:46:43 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:43 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 07/63] dyndbg: split param_set_dyndbg_classes to _module & wrapper fns Date: Fri, 24 Jan 2025 23:45:21 -0700 Message-ID: <20250125064619.8305-8-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- 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 8adb81e75a16..9adcb9fa7110 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -711,18 +711,9 @@ static int param_set_dyndbg_classnames(const char *ins= tr, const struct kernel_pa return 0; } =20 -/** - * 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 =3D kp->arg; const struct ddebug_class_map *map =3D dcp->map; @@ -759,8 +750,8 @@ int param_set_dyndbg_classes(const char *instr, const s= truct kernel_param *kp) KP_NAME(kp), inrep, CLASSMAP_BITMASK(map->length)); inrep &=3D CLASSMAP_BITMASK(map->length); } - v2pr_info("bits:%lx > %s\n", inrep, KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, NULL); + v2pr_info("bits:0x%lx > %s.%s\n", inrep, modnm ?: "*", KP_NAME(kp)); + totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, modnm); *dcp->bits =3D inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -773,7 +764,7 @@ int param_set_dyndbg_classes(const char *instr, const s= truct kernel_param *kp) old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); new_bits =3D CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, NULL); + totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, modnm); *dcp->lvl =3D 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); =20 /** --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F3F52080E6 for ; Sat, 25 Jan 2025 06:46:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787607; cv=none; b=q2+QuLR/jjC7myFAVevEv/Yv33DcUhjDQJb5Fgu/NAEvOPYF92Hf+LRrx8+1rgdzkiDYnIopTyV6N+SNYUk3bwSXkB3uaQxSgD06gSNDmM+g8z56wL17AvvEcILj2WxtXikDroQyL/IsJRbFAasppOPIlhl3C5yn0NBhaPhkn/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787607; c=relaxed/simple; bh=Ogp31Zz7AEoEiXw596gilyxyNTSfdeIxK0x88UwwDEg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WR0i1ZFAh1mSDDu1+/QaG6YrZUTBvbV1z7H/6B2ossADIHqlqtTAwuyasBmzDhO244BMamLkH+H3QfJ+RkLpdXDn1+DXfr2iSpSIb26Brf39lUXghA61sK6nFMuczJHjaBkNLqaho2/x1YIZZVh2s0wOX80zksLcNB1rSTvyohg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Pq+iYJ/X; arc=none smtp.client-ip=209.85.166.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Pq+iYJ/X" Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-3ce76b8d5bcso25575535ab.0 for ; Fri, 24 Jan 2025 22:46:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787605; x=1738392405; darn=vger.kernel.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=VwH01EKRazu4m0X1GohDgfdyTIUPm+sscqi9yjO/S80=; b=Pq+iYJ/XSh0+YCBOJnkTn4JHo76aX5ZRe/4AG2gEWy5eE3QLrVp4mzndUqwZAvYkP9 x1mczGXsFjFMb1bE3lqKtK+mmwWBRCM0boH0nh4s9IG0SqCOT4Lgy2beqZ1tECXzdirl Trcesrv1URS9M1h8ap14+1M1bQVGCeFae8ptEeT/e0lZfy+fMfQljEjXJp9kcINbyt6B RO1qnj+epRLeXQ7C4wgi+j6q/r6+fPG1rc/cY285R04QBmresYHHrlizWu5RY/hIHqH7 OgiAdf8v1rqn2aedO6TNZYbVCCxl89rHY46H/7PH5MWz5Cq08X6ZAtbDf6Np69we0wqa ajJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787605; x=1738392405; 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=VwH01EKRazu4m0X1GohDgfdyTIUPm+sscqi9yjO/S80=; b=m/PiRkU+kGsSUNQs1xolcQSnF5NCKSfRna+CD1qrjL6RsO5DlQfk1uYpuObKJEgt5H 3uP6cu+RbLJnagPkSVzRzXYLBJJZwXBiskGaHJxV9QR5z/+gDzI0EEzvEBF3VsscqHvO 9tjjMoDa7T/L06H7rsZVBiCEaLiV1R2V3r3S/Lc0inysBikEs8780PAo1Gu2IV/dp07Q QiCgc7egYxtXshp3v+Qm9cefHI3JbvtWWfQ9mhpzhtMKs0J+EplsLgm47YukXgWEPA2I ONG9hPvvw7uObH5igP1G1a0St/Wb4flWn3df+ltkN7thbik8vSHbX5l31WGnZ3jKQzLw a8Dg== X-Gm-Message-State: AOJu0Ywiv3EIMfSeqK5PGul/vEB0pdaLVTTJB8oQzDednLliriPPR+7D IBE55QvXtpoBFcC8mv/Kc10MN6yyKvf/jJI7ukrfz2r0GgCLDMU+7ydIKA== X-Gm-Gg: ASbGnct32pAnRl0HSAgB2g/ZpI51Dr9kux6vYodYT7MhAg1gHv0XAHug3+YfdadA6sR n8h6pL4dxrP6FOOY2akOf2i4RWLdQsV95EykAnwZk4iln2TWTU3c7clR/MXSl9zzl+bbVOQIhEu jxBsvrcIkCRnT10mCam5fWKunY+Z+fa+i2wpixucoyaSeAo5evLgOE09c+ZxkHyIWQk35xxXxqk eLvTqWGsfUOW8Dh4MxRN9zBvvZEPJRT+B6pM6RQNVv35TePzTWBgUrFVad/yxBp4nPG8hCN3Ae0 0ggZ7Vt17nYwVjc3ErJ9bl4ZyKlBXSgtjKZidA== X-Google-Smtp-Source: AGHT+IHgeLb1/OEHSiTpUB3Y4KC2A/0xBQxJHz/T9Jw19RrYDifFspA+XBrdojd9CQ+kqm6DqciOMA== X-Received: by 2002:a05:6e02:3601:b0:3cf:b6c9:5fc9 with SMTP id e9e14a558f8ab-3cfb6c96229mr126365525ab.8.1737787605241; Fri, 24 Jan 2025 22:46:45 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:44 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 08/63] dyndbg: drop NUM_TYPE_ARRAY Date: Fri, 24 Jan 2025 23:45:22 -0700 Message-ID: <20250125064619.8305-9-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ARRAY_SIZE works here, since array decl is complete. no functional change Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- 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 2b0057058ecf..e458d4b838ac 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -106,11 +106,9 @@ struct ddebug_class_map { .mod_name =3D KBUILD_MODNAME, \ .base =3D _base, \ .map_type =3D _maptype, \ - .length =3D NUM_TYPE_ARGS(char*, __VA_ARGS__), \ + .length =3D ARRAY_SIZE(_var##_classnames), \ .class_names =3D _var##_classnames, \ } -#define NUM_TYPE_ARGS(eltype, ...) \ - (sizeof((eltype[]){__VA_ARGS__}) / sizeof(eltype)) =20 /* encapsulate linker provided built-in (or module) dyndbg data */ struct _ddebug_info { --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 564B520766F for ; Sat, 25 Jan 2025 06:46:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787608; cv=none; b=FGwFAGywfEM7ffS22SFeG+GXEeDlin/vMRt+RRqwFv/Epy+wRllwel1o6yI5KfQL3oDAa6NT+aWwxs3SSjTeDGQzwkIh/0dfPyytqwgSwz3PtCZwmtVkWF1oZgB5CSZydNSC7nszR51Id1rMS7iPuyUU43JAfIIOH9pnKyIB5XM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787608; c=relaxed/simple; bh=+yNUQPcNx2B0khJfCLCdnontyBw4RL0qgAiYMHJUBHA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hPTt+ecONNCGiRgMBevXGpzKhlgEDvrKxpP0LyfY/vtDxHq5oB2ous4mA+JzNV8tsrm4DGRkmOd1OYIYd4+4vIlLkGo/Fj6/FIdudDRhQ0kxop7RZcFS8ZFiokzpPVI9SXDZSx2IoNeEx8HwMIcelLH1w0IXFXnKElRhWqC/Ubs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DMmwZfui; arc=none smtp.client-ip=209.85.166.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DMmwZfui" Received: by mail-il1-f173.google.com with SMTP id e9e14a558f8ab-3ce6b289e43so25367675ab.3 for ; Fri, 24 Jan 2025 22:46:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787606; x=1738392406; darn=vger.kernel.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=crImgp1y7IRXSUD7oHrqvuelp6vlR0pAkEGBI4jI/u4=; b=DMmwZfuinXpd2HUSWh7D9EI+FH0Omd7Mz9IuAjDlIXcwHs69Y9Z72tOZMtnhsayhrF A5KLE7yT7au7Tbbdy7uNqyAdrhnZf4tOciWVSj9TFCFffS9lk7cHZKtfDjWiBFQheqTY vRi1Gg/XvlfzLYjZqjmEmHpOzsq6DBWYcpIQLc3wMp7tQeg4yYHEWhG80H05FcI8kstE G2pcTdSuK60tGUxJ5Ib5Ujt/VMyAWbhNGZB7wBSLke6k0kvvRhxJBsypB+7r7zSnKmfi BUOn8F3YrfqGV5TtMlIeqC+LKGoBUt8cgiy40faAX/+2KRJTYQmzKSWlnGin/Id+D4kv iZTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787606; x=1738392406; 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=crImgp1y7IRXSUD7oHrqvuelp6vlR0pAkEGBI4jI/u4=; b=k+t9HrVgUUtwMI0Vq9BC5COtOnXRw3OEOHbAKE0ZgmBMgWo0/pPkTYo5jmBzzCofss bHjpSD5GitnTjwnT3li9tC3APGJbT4Hn42u4FI2Kk5KB40H3SolaT5uYmFKPdUZdUBXh oTsZxMG7SGJqBrHgUhAUDf7EXhlBsPLp0QL7hXQD/JLbh4VnXQv35DF9twrQpphNnzMU W4kyfDep/uQ/QIozSkNbwl/OW1FGI+UdhGzLo+hbdxnSunuXaMnXT8tRDFamnMC5Jw++ 8K6jdpS6H8BrxpBBnPt/Wvu3WsoYQt1z5kp7Kk6eRyg6Mr7Qu25n4t29F9v2u9Hyg9L5 t4hA== X-Gm-Message-State: AOJu0Yxa+PlodTDXauHpRfraAqHlF1Z/UQSpC0DhfN4KSw5D8gt/XMV/ wTSU9yzBtpaXm+AAHfNwK/ZgbimNIBx8mvhGWXYzjEmsQ5g8tAintpzeBQ== X-Gm-Gg: ASbGncvkiyNp3SE46QiAEAIP5AlxTdpOVr+/s4TQtXiklNYDu2tV9j1LyJKBp+8Rwoz wK8oWrBuQHLcVuHJwpegcIYyclc2RfJmhO/+HcXWTl1XlHj03CaVRrOHU/i4AaBG+Y4U/g43f3W XknblIrvIH5pg4A15KZpWr4EhbjoTUQM/3ss3vdHghVkLXiAEfrQxRV47zMylWO1OjZw2/jV/Yi BIMMZYI6Vr6GPzQL47E8myzWWyR15sVvWV+3ioNcmd8YAsb4x7MIwEPZyM4Qa+jCr/sYK5o9lUB awkfocz5M4W3tUZCGe7GzrXjWF+yaVHLg+B0PQ== X-Google-Smtp-Source: AGHT+IEjjwWoWaC2eqRVAIRwzEKW3d0rVEFuGJkXw2+P/hMoxb83M7t9s2BDslJJbs0hJxkgZgzZdQ== X-Received: by 2002:a05:6e02:fc5:b0:3cf:c558:3594 with SMTP id e9e14a558f8ab-3cfc558384emr50346105ab.2.1737787606321; Fri, 24 Jan 2025 22:46:46 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:45 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 09/63] dyndbg: reduce verbose/debug clutter Date: Fri, 24 Jan 2025 23:45:23 -0700 Message-ID: <20250125064619.8305-10-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" currently, for verbose=3D3, 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=3D'+' dyndbg: flags=3D0x1 dyndbg: *flagsp=3D0x1 *maskp=3D0xffffffff dyndbg: parsed: func=3D"" file=3D"" module=3D"" format=3D"" lineno=3D0-0 c= lass=3D... dyndbg: no matches for query dyndbg: no-match: func=3D"" file=3D"" module=3D"" format=3D"" lineno=3D0-0= class=3D... 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=3D'+' flags=3D0x1 *flagsp=3D0x1 *maskp=3D0xffffffff dyndbg: no-match: func=3D"" file=3D"" module=3D"" format=3D"" lineno=3D0-0= class=3D... dyndbg: processed 1 queries, with 0 matches, 0 errs no functional change. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- 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 9adcb9fa7110..1b2fb6502e61 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -266,9 +266,6 @@ static int ddebug_change(const struct ddebug_query *que= ry, } mutex_unlock(&ddebug_lock); =20 - if (!nfound && verbose) - pr_info("no matches for query\n"); - return nfound; } =20 @@ -501,7 +498,6 @@ static int ddebug_parse_flags(const char *str, struct f= lag_settings *modifiers) pr_err("bad flag-op %c, at start of %s\n", *str, str); return -EINVAL; } - v3pr_info("op=3D'%c'\n", op); =20 for (; *str ; ++str) { for (i =3D ARRAY_SIZE(opt_array) - 1; i >=3D 0; i--) { @@ -515,7 +511,6 @@ static int ddebug_parse_flags(const char *str, struct f= lag_settings *modifiers) return -EINVAL; } } - v3pr_info("flags=3D0x%x\n", modifiers->flags); =20 /* calculate final flags, mask based upon op */ switch (op) { @@ -531,7 +526,7 @@ static int ddebug_parse_flags(const char *str, struct f= lag_settings *modifiers) modifiers->flags =3D 0; break; } - v3pr_info("*flagsp=3D0x%x *maskp=3D0x%x\n", modifiers->flags, modifiers->= mask); + v3pr_info("op=3D'%c' flags=3D0x%x maskp=3D0x%x\n", op, modifiers->flags, = modifiers->mask); =20 return 0; } @@ -541,7 +536,7 @@ static int ddebug_exec_query(char *query_string, const = char *modname) struct flag_settings modifiers =3D {}; struct ddebug_query query =3D {}; #define MAXWORDS 9 - int nwords, nfound; + int nwords; char *words[MAXWORDS]; =20 nwords =3D 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 =3D ddebug_change(&query, &modifiers); - vpr_info_dq(&query, nfound ? "applied" : "no-match"); - - return nfound; + return ddebug_change(&query, &modifiers); } =20 /* handle multiple queries in query string, continue on error, return --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3534208978 for ; Sat, 25 Jan 2025 06:46:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787610; cv=none; b=G32bgLaHUVkEhOknU+uYrMZSGro/dJRFDLke9rvc0MK973zhjckW7fOClTqC/Ju2iV9My7Rw4tq3oSoQrvA8pNZlimDV4cs6pJhaLskXKiJAkyY4Ng7s77VGptTcsVcw/ZwQhrp/NcVT9lb1z6K/GrKeIDgDwt1t+1xAoQGnUM4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787610; c=relaxed/simple; bh=JVuh/MQ7exuYdVaBwTAPV2KisZ9vIJiAbLH8eePrU0U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X/t+dEIaqRXFQlFCn0halXVIlK2Z/Ivl5jNIl4c0G2X/NGUTVtyi4ppjv94NHplNjBDfZXYleB5tF3VtP3cWMXQgeZP97EY6AEmtMjf5NWu1rVBCfzdYaMcMtWYIVNumBpivk57lQwssHqTPSWi2784E02N8WIovWcqV2/Ms08Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QPAh6wjV; arc=none smtp.client-ip=209.85.166.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QPAh6wjV" Received: by mail-il1-f177.google.com with SMTP id e9e14a558f8ab-3cf82bd380bso23194625ab.0 for ; Fri, 24 Jan 2025 22:46:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787607; x=1738392407; darn=vger.kernel.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=uX3l/iQikxAaQX2/QdRkr7TBe7St6PLnbGyQCN0qCdQ=; b=QPAh6wjVOkpaHEf2muy+ozFCh9QaBOVyIrjyiIADFCB3NeWkEaQXj2g6EXfmwd6Yqt JLohSpimMJSbryDNI1opieZmYu883pE68ftx8LN8boxR6LqoU9M0BtOwhOmogBpcq3fP h7BZWLOVRBaalRRe/nwO2/WdYM8YqU1Ca9pNu1ANO1okqlk7mf+qgKzFDm3pKH/exwLG Ob5b+ZmoMFInU3hKwyjkyxHdejRlWE9Z3EyWNk76t08KY3MVoI43K7mbAidC1zaotR2H nET4ODBxrPqJTRYp4YPDFlLOpGm1qvXpHhL1/5AdLPQsiqwN9i0lxbJh98j1vutNBHbl tv+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787607; x=1738392407; 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=uX3l/iQikxAaQX2/QdRkr7TBe7St6PLnbGyQCN0qCdQ=; b=oP40kn9saO5fXYSxL8LzpJ7tXYqpEP7GmKihLSS0p4xz1ykY+3nOyQ1zeYej16pGBy Z42ICDMUSYqDNgeam5yADvYxb/ePi26uFZGNOEiqROG4IlwegigSJH0Llh5bkjlmW76d Oe7tXHbpmVIZY04UFF9/b8nkPf4TQnDOEnHSlUJNFyM8oYjS5qVTQnBYxzJAtBjunVoS ippbI5l/uA+qFHzUKQ/Kv2pEGDo/7xBv/dKe4gOOThIPddD008qPHRBl+oYfBiIyhcyV gsAPyTo46SWjg/2vUtzDROdFBmUv/7O+Z+nLu6Hh7XX7T4yqkG8jqFJk/fWGErYNDxSv SevQ== X-Gm-Message-State: AOJu0Yyluqc4qBQIFo5l3mYm+8vrLw8hFNqLS/Z4PjlwbA54fPXd1C/n 7WtvqsQQAbZSByaJpHhhU3KZYRb3zr91vdM/XqpHqimLFx4V2arc2I4oMQ== X-Gm-Gg: ASbGnctVYNkiCx8KHfLnzFNkpdNn1JZL/gjKNr9KD1MForlxRow9rYXOVkAmQPysQxR W1dvwrpSnTzctO1qDOWaPTGjZO+hzUQP2bRaSQHvwveGyHnd/uHi4deXB+l6L/fA67kFGzBVmz5 N7IDmlfgimThAJo1TvUYnqC5aV5Qy8Pdd+JDiBiMf/POhddDnoeIV8uftaVRrXz7E0RtzziP2LO d73FqXz9QglvNo0hAp3/kmK5m7foUl7m6iJNVd3phpMu+AmO4LfUlQwPsE7ciqx3fD6WsmdFHrN 1zAGVEea5pRYhiC8dNOfRnOAh4DrYzzaY4bZcg== X-Google-Smtp-Source: AGHT+IERZTxhAZxFSe1csHMGwCl8KwsmPfchqC0NaFpULXt8261DlITQ09T7azGi9+ykPl9fw06Y+w== X-Received: by 2002:a05:6e02:1d9c:b0:3cf:bb11:a3a4 with SMTP id e9e14a558f8ab-3cfbb11a52bmr102830845ab.15.1737787607309; Fri, 24 Jan 2025 22:46:47 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:46 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 10/63] dyndbg: silence debugs with no-change updates Date: Fri, 24 Jan 2025 23:45:24 -0700 Message-ID: <20250125064619.8305-11-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- 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 1b2fb6502e61..c27965180a49 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; } =20 -/* 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 ddebu= g_class_param *dcp, int matches =3D 0; int bi, ct; =20 - v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, *old_bits, - query_modname ?: ""); + if (*new_bits !=3D *old_bits) + v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, + *old_bits, query_modname ?: "'*'"); =20 for (bi =3D 0; bi < map->length; bi++) { if (test_bit(bi, new_bits) =3D=3D test_bit(bi, old_bits)) @@ -622,8 +623,9 @@ static int ddebug_apply_class_bitmap(const struct ddebu= g_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_bit= s, - query_modname ?: ""); + if (*new_bits !=3D *old_bits) + v2pr_info("applied bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, + *old_bits, query_modname ?: "'*'"); =20 return matches; } --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 869CE209667 for ; Sat, 25 Jan 2025 06:46:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787611; cv=none; b=qR9D0YHG8HAmzDybuBMYzVZgq7PDlrTaRnfZpJ73Gb2te+v5qt/T/ZFLflYHLWMC9ttp21NAbyxO2eqtJ9ggky2vWY3z76L0GZ9uTMpLhPAth0eKNHEFpIBb3f59bwlEsiqivCVA2XTtE5J5YXMnk0BHBnz9v6teuAsHCGTCjbE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787611; c=relaxed/simple; bh=SPC/C0ZGhOvR+0tSSLoIWckFkrHYFAY7fgX4tcenGkU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZL5lO2/wTdHewm68ldGi6dwDvCxs/cVCOOCE5aQ5BxnqK9q9ecrJe1rr2LxVqsn4Ujv9vTaSNXwIQ61kROktKM9s3BuVr/NV5EbUSjLeH51gNSbuJxJX2OWfTBI0uwkzXYOkUbES+cLz5bXHVhM8AlVWhkQdtZ/D1GHihSDV1Fc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EdQTc+K1; arc=none smtp.client-ip=209.85.166.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EdQTc+K1" Received: by mail-il1-f182.google.com with SMTP id e9e14a558f8ab-3a9c9f2a569so20550425ab.0 for ; Fri, 24 Jan 2025 22:46:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787608; x=1738392408; darn=vger.kernel.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=aL4TX0n3dq5vrpGI1F4EuJXOXo5OciZqJbKEL8rj1EY=; b=EdQTc+K11zUqW/TUDKc6lz+2chyZveEgQqTusXCswJmHH0YpeTu7B3rLJ0WMMbfzSj TplyLFqkvdtcm2BhrHC3+qA4YgH+sU8TCP/IYOhVdkWYfBJZ+0CeL9ZrrxsssxE+Bshc 79DCHGJcinEfBIgY8zEWXim8EsieOEVvYFRMGyEY/1iR5ypHakAhh8tyNH+LDnss5Qee VHhQ/E730FRW9ZeWCNaEQvtSSG7u/ra8tj0Mp5pWr3IqDqcRNX7W6dsxN0KVZ8NLhpZJ K0rDT545h6ZX++4nG4n7yjDbns8oyd8hk4GRodCaDg3FPE00/YhgeYqxOU4W4eu+3p3h Dj4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787608; x=1738392408; 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=aL4TX0n3dq5vrpGI1F4EuJXOXo5OciZqJbKEL8rj1EY=; b=QAaB4ceDmriDT++og7Iwg6UUxFHMBKXm1yXMac9dysxB3nSK0nABdZW4JmMi7imN3j YPPJJdk8rOh6PFhTDjtZ92UhE2/gYo/5vFD4Z/wTxsLhOr0rAitqvXJXSqMLwTKimvll o5JQsx814h1w/fPei36FzcvdJcbQC7Q0L3rpuK7pS2Ydchi+fW4Wz4Xl7xDUw6x5nBth fZMO2FtlMPrWCB2YirkvQ8N5MMLl+Q+5CIFNIkT44zwonFiz9u7gjueTSiYKJyJ2dc9d y85Uc1Nzn0oKNqHxLEg0Ua5Y8+ZITcVdu8QjIG5fotr0SvgB57YOU6Fk53ubmRftPV41 r3kg== X-Gm-Message-State: AOJu0YxFO0onWkY/uPeOerTvAbWERRVPbyh/pOJDrv/paO1RF/4Nh+sv nXiZSt50QzbJ/MSwBl5fLD3ADH8hgVX9drjK+lXOmDCHN9XzDSIFFCL0UQ== X-Gm-Gg: ASbGncuCNBiGvuURDoyluRsz7MlFcW7ANUkrTTVkK0tJFTpfJd5se/57vvIUDfXcoNN d2SdyNG9atg3KdA7AoXrsPcBjckYs6b5FNy3eBMWYnZaO19pqqmw5tv1I+cV6QwfumO2NjMalSK XDlFG58Ypn9t2aVDzLR8EmYx+RROO83bve+DvdfbAEFs3NZCwMmDfMGIQltQPKK67yWVVUJdP+9 D8Np2oRQL/VLMbTTAsP/ZmZE0CcWE+p/UfOG/T4R6qF+yFZwQCukjWRfMff0o1VG4Qsn9SAFipV IymrvCX9n6ZdTVjoR8LCd9CMDkz1mo3ikuUQFg== X-Google-Smtp-Source: AGHT+IHL/GoA7XbieWLMv6FyLDw1bl4z8/ZDdb9aS4OdzpNSQZXG/htmpeI7MxFcY4/KQhwkkuHohA== X-Received: by 2002:a05:6e02:3f03:b0:3ce:87e3:c26c with SMTP id e9e14a558f8ab-3cf743df88amr329669815ab.5.1737787608464; Fri, 24 Jan 2025 22:46:48 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:48 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 11/63] dyndbg: tighten ddebug_class_name() 1st arg type Date: Fri, 24 Jan 2025 23:45:25 -0700 Message-ID: <20250125064619.8305-12-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- 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 c27965180a49..a3849ac3be23 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1120,12 +1120,12 @@ static void *ddebug_proc_next(struct seq_file *m, v= oid *p, loff_t *pos) #define class_in_range(class_id, map) \ (class_id >=3D map->base && class_id < map->base + map->length) =20 -static const char *ddebug_class_name(struct ddebug_iter *iter, struct _dde= bug *dp) +static const char *ddebug_class_name(struct ddebug_table *dt, struct _ddeb= ug *dp) { - struct ddebug_class_map *map =3D iter->table->classes; - int i, nc =3D iter->table->num_classes; + struct ddebug_class_map *map =3D dt->classes; + int i; =20 - for (i =3D 0; i < nc; i++, map++) + for (i =3D 0; i < dt->num_classes; i++, map++) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; =20 @@ -1159,7 +1159,7 @@ static int ddebug_proc_show(struct seq_file *m, void = *p) seq_putc(m, '"'); =20 if (dp->class_id !=3D _DPRINTK_CLASS_DFLT) { - class =3D ddebug_class_name(iter, dp); + class =3D ddebug_class_name(iter->table, dp); if (class) seq_printf(m, " class:%s", class); else --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f171.google.com (mail-il1-f171.google.com [209.85.166.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4BCE20969A for ; Sat, 25 Jan 2025 06:46:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787612; cv=none; b=rGKaGSZIl0UMwPVZLyqp9rM2RAMaT5wTKpZ7ca4ZlIB1l42mH1YTbAzsqpk4gM+mqlIGTSy2Y5ZtCrCJmMxgNr5VKXKOguF4AXnfS4pVFlkTOFOcshPZeqTimnWmhP023op+N8jvfd6UPWOlHL4gMSmjKMoUQVZ0KyD/cdKSaHs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787612; c=relaxed/simple; bh=H6GcwM+BlpT+OJcceR6aSE9k56//OpwcMqIJNWBK8Uw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FQkeyM0mp4egOE8Zrt24d2+tdwBE8SttuOnJaUZrgWW7mfAri/pvAvw922qeksFTjfHuXV+86HbsT30LgfhfH91VfcteQH2/tr4odUmMmF6f9njxnCSGi0DMOaWyLrYNSjSzriVOW9Em4CsLhaJfZhCC1EgMXGs03A6rJpLzT/g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NVEm+WVJ; arc=none smtp.client-ip=209.85.166.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NVEm+WVJ" Received: by mail-il1-f171.google.com with SMTP id e9e14a558f8ab-3a81324bbdcso21660875ab.1 for ; Fri, 24 Jan 2025 22:46:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787609; x=1738392409; darn=vger.kernel.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=urmnkuLrh5iZivbcnepwjXmHK5mBTPl4o7K5sFAjLFQ=; b=NVEm+WVJlDA3JsA1T5/wGjOkNvr8qM8t09gT75QA7qct3DweqQDWAhPtPxTzYpoDtb kNiRdqNMdjj7srN2nwSWsFAjd9+A5WZ0/zG7e8zcAxRZqtlAsKDDYGjE3SxKKPb7pjfC NF2KL/y2dhkFa0tiXN4ObuX0bVyyqvHJbsN9Ug9zsTBcne6GI/0NNTd7Jf40aVJT1oI6 OifjNoEyZuoxx0gvTkGpmHYfusruTwHJfBfRRram0EKkFdxek43Axk8kBx1c5mVHkUXj 8Bbg4Pf73YCVKGAeJz0+HhDCP3ACvuFQPmDRbF9WOtK66gtB3AKlkYiRuahnNG46Bv15 K23A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787609; x=1738392409; 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=urmnkuLrh5iZivbcnepwjXmHK5mBTPl4o7K5sFAjLFQ=; b=Hz2wIIN+Cki2JNP6UkwX3p8iO4EWNCiQqWdn1TFWUyJv87qVVRG4HUvE69hgqw7JIp YDmkZ7Du/yHHCE+Tm71bWHPe4MWiBnnG3cXrdF+8EXlu1xYfd39KpT269OdW+R7hlBCX ZlnwJuERjBSnieW29qwiYvA+t3GgAsgPfPs9LSCo1JWmWar+PGoevigO/pZgp5xiIHuP PA2LUw1HABvSLJgRFRVLSkMZ5I7dhrJc0Mtq/ivL21O3ZZuz3CCUjQA/wCAZLoKD4RFA Jf+PkgtQJ/xpGusxLMrNjVaG5GUKezgXouaLQA0G+byijYioFqV5vQnAT51bC6H/RZAE uCgg== X-Gm-Message-State: AOJu0YzeCeyCKSBDN3IdCM6Gah7q/kji1Dgo0RBELlfUQAeu0GKgd8O7 oCdsVFEjSjiRSchDb8G/20uv19aQL+m2Q7R1R+jhYb9vOgnGI+75kclncg== X-Gm-Gg: ASbGnctjIMxwNM9SvXzArr46xJf3VdjEUnztfFX4VKYlMDzWFvn4Ddhb27neLtbzQTc AzzeBjPsCV/5SsLjwsvSH25r1QfDM/3lr2G+/rnSHOezm+xIoU9MWMW9cncVrU3YoOkKRyOAjY0 nxtYF8tpLMukN7jAyzwBgEm+2laMxLPP0NXWZVHmMaeNnswOn0/FHTSnD/r4yu1fI3ikuC3EBgv k8XzPOcFl/aSt462FVdZR9IVT7CTKpPDgdaPw7JKxVZKYYgvxi98BdW0/ZfNl1N1Z+4lZ33Oe0r i2G47BPwdtHE0OjwGnZDmedAWT3whDu2DxpfJQ== X-Google-Smtp-Source: AGHT+IEvmisYZlf1TfhlUiVyjFpSDJwdao+1WM75v1n/+Qb4/O1LfWsp2czciBXM069u/2UjUxgPMQ== X-Received: by 2002:a05:6e02:1f84:b0:3cf:b26f:ff7c with SMTP id e9e14a558f8ab-3cfb2700234mr145910675ab.5.1737787609593; Fri, 24 Jan 2025 22:46:49 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:49 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 12/63] dyndbg: tighten fn-sig of ddebug_apply_class_bitmap Date: Fri, 24 Jan 2025 23:45:26 -0700 Message-ID: <20250125064619.8305-13-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- 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 a3849ac3be23..fc9bf5d80aa9 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) =20 /* 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 dde= bug_class_param *dcp, int matches =3D 0; int bi, ct; =20 - if (*new_bits !=3D *old_bits) + if (*new_bits !=3D old_bits) v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, - *old_bits, query_modname ?: "'*'"); + old_bits, query_modname ?: "'*'"); =20 for (bi =3D 0; bi < map->length; bi++) { - if (test_bit(bi, new_bits) =3D=3D test_bit(bi, old_bits)) + if (test_bit(bi, new_bits) =3D=3D test_bit(bi, &old_bits)) continue; =20 snprintf(query, QUERY_SIZE, "class %s %c%s", map->class_names[bi], @@ -623,9 +624,9 @@ static int ddebug_apply_class_bitmap(const struct ddebu= g_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 !=3D *old_bits) + if (*new_bits !=3D old_bits) v2pr_info("applied bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, - *old_bits, query_modname ?: "'*'"); + old_bits, query_modname ?: "'*'"); =20 return matches; } @@ -681,7 +682,7 @@ static int param_set_dyndbg_classnames(const char *inst= r, const struct kernel_pa continue; } curr_bits ^=3D BIT(cls_id); - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits, NULL); + totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, *dcp->bits, NULL); *dcp->bits =3D 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 *inst= r, const struct kernel_pa old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); curr_bits =3D CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); =20 - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits, NULL); + totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, old_bits, NULL); *dcp->lvl =3D (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 &=3D CLASSMAP_BITMASK(map->length); } v2pr_info("bits:0x%lx > %s.%s\n", inrep, modnm ?: "*", KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, modnm); + totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, *dcp->bits, modnm); *dcp->bits =3D inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -758,7 +759,7 @@ static int param_set_dyndbg_module_classes(const char *= instr, old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); new_bits =3D CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, modnm); + totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, old_bits, modnm); *dcp->lvl =3D inrep; break; default: --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E949209F40 for ; Sat, 25 Jan 2025 06:46:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787613; cv=none; b=E2EXZJzk08mNM5Rq2Ze0iUff0wYulLCibIUJPrtbejraSa852Z/FKRcfDO1tnLymVimbV/JQioIg2l0AGlCo8SRBvDPbGPZsAiAbKmvVWO327CyfyGnlO7aV29Vcjx5ZU002q2YUDpVqtIk4zd+qcINVKRaLAEBqQbJJTZE7jxk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787613; c=relaxed/simple; bh=/WMzD4KYl1F87ue0fzvzqOJeiTxxl6T5egYdaDlTGH4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ek/mmccUtUwcCt9Zk30s6D1fp8hQxNUf/rqtOeCTyEsTYt2xi1jV1O+5H0Sp1tTWnkaqaP2Pb24+U8/KIzk60nO0b3h510sG/ugNqifzzhKsVKJKMiOsM8qGj2ryuulGQ7xQcNdqC+zHWWZZz44W8E4HD3Q5ax7EUQbllmTLChg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=N3cxTrpQ; arc=none smtp.client-ip=209.85.166.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="N3cxTrpQ" Received: by mail-il1-f178.google.com with SMTP id e9e14a558f8ab-3cf880d90bdso10174305ab.3 for ; Fri, 24 Jan 2025 22:46:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787610; x=1738392410; darn=vger.kernel.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=JhnbP0DWcHpdehvzPtVKNEphMptFcEvIUAWn1R09L9s=; b=N3cxTrpQWgLIG7GczZrxAmXqbGv463SzWQUj6sBF85TCykRizbdemV5IlHk+rD1pp4 qOlz7Lky/PpoUuqoKw01/0e7rPE1bz4V+47K5kFY7tg9Ajl1WeTrJ0WU7Pc4CW4Q1ypI 5lKt+qY3zVHs5yXVdkfg5dM5/HYzUm6qSA0hB91EJTvrwh3QPKZ7PE0+9/8RhSp7aifP qmoknO82X+Gwl+ys08gZm1wQXu1Rh34WG2TnPECRbK76xEEUswQXFeOZCeUISkUKe0ic 5oZxVOEc27rLEC1aiOtWdm6foURHGCX6Ec9ohQ0zGrEdVPUrmPw56SlpixpQGUNhfgaN 7Kgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787610; x=1738392410; 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=JhnbP0DWcHpdehvzPtVKNEphMptFcEvIUAWn1R09L9s=; b=e1/NHvXBR0u1pMUo4pfKm/lhaubsBwplFg54ZH2t1Y5ircwKLnIU25flLjJt+K/Vct Mwp5p2uQUgAXKP7VlPik5rMWSgSvS51FVv1BZJrE6TClNVyK5zKIUPAYWcK4kL7CVwnU z/kJvbNuD4HjX46HWPlSO6280ORQ/pqHGywK4T1BEYUOBAZwP8R5u2aXgfyDyX23VdGY GD3tjmjDEVdS9dQvEfRzYDEgrQHAv1kpTu48kyBKyDex3Cq0AxmyhKBOIhjBRvn5Tujb tICgafsa203f2eljmEa444OW50XoRIHOk/tqrgUh8lwvS6FVYMn25AImPYeQl+m3I3Tu uLqA== X-Gm-Message-State: AOJu0Yz//QHwKko0yXPMth+Lnf68ETqHMGJxggA2pVe5JU9QEQvwX+ee cLSVVFIR6ipvuckQ95QC9zYbmRaMXW5Jjzo0murA0NF5fTa/+YLOsfaAKg== X-Gm-Gg: ASbGncvtNIRHjj8YBy/wF2kZJcmgnIrmAmpwpeNxdEsaMmAss/xkhWjjGPtXoLM4oiE wf45uNOdmbUHvgIvqiJ9EN6vbia+aK5A9/GXJHp0Ma2Wq+wi2AnCxFTtQDVrxWHxhAltqntiu1e KilfJ82UODvd/JSrZPURlDTXnlNpP+iUrHPLkwTCMBhZMmC05puxO52gDSYtANdb9Ep3iRgzTbC 4BTat6wLSvY6WQEDw4LgM8kZHAcTklW3/zpii138RB7xBpvMlPAxWDZZDkosrlsm9kMXOqHqbMX qe/n4jsNPVbM6fxvJj8LoEgfvFqqi2JHelqwqRHtVaXczp3u X-Google-Smtp-Source: AGHT+IEjwcFP/08iV5u7smlEOAHtcy4vLQNSUwAcIBZCKkDwG3GOx0o4FLASRAUuvVLtd3Cgpon0RA== X-Received: by 2002:a05:6e02:170e:b0:3cf:bbd4:8aef with SMTP id e9e14a558f8ab-3cfbbd48bc6mr91708935ab.19.1737787610590; Fri, 24 Jan 2025 22:46:50 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:50 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 13/63] dyndbg: reduce verbose=3 messages in ddebug_add_module Date: Fri, 24 Jan 2025 23:45:27 -0700 Message-ID: <20250125064619.8305-14-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- 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 fc9bf5d80aa9..6bac5703dd41 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1245,11 +1245,10 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) { struct ddebug_table *dt; =20 - 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); =20 dt =3D kzalloc(sizeof(*dt), GFP_KERNEL); if (dt =3D=3D NULL) { --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E07A9207A2D for ; Sat, 25 Jan 2025 06:46:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787614; cv=none; b=s9vdj1bjwczh7USVYchYkY9onozVv2HjX9BjzhuGJG1TGL9T5V5/voovyDSxQJCVjWzdMAD/5XuZ9YI4f53yCbF2VtCM64cK9GG+wFJdBwmsIFOkZCoovke5ofFTf4MRKNUuDGapxR7AjH3Gj2366Zo14ZHWO1w4D1haWpefrM0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787614; c=relaxed/simple; bh=Hs05tlZFDz3RwVjLK4rXF41JCQsUCgy/RvhgLU2aRTI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uc9OVjYaT3TyeEV4pXHXeABMcajGL+mNj/S8pjIZUfix14PW+2fyJiAY7QLIkZ0ttcYdARw9Th9v+Wu1ya+MsRiAzKtBIzkNt+IZqvepgcASe1HcK4fHnJE/qwvvGjIlDo6hSAXsdNCmNOW5zJayRJ3IoQC0IjjVxGRfpuWDRuk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Uvi4oEi+; arc=none smtp.client-ip=209.85.166.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Uvi4oEi+" Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-844e7bc6d84so90830239f.0 for ; Fri, 24 Jan 2025 22:46:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787612; x=1738392412; darn=vger.kernel.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=grXz5NZcQHVvB030YeciAJG8O6y80X3jGiy6VqsSfuM=; b=Uvi4oEi+nejL69CM9X7tQWMR3whpB20UR0AjXH5ShPrJiQ1kuzxJUTaqrlfja6ZiDe HHn32KA/5x3wsYAspd1BntnnV8hmBCaCh4MPDRTJWUpkm4641ZWmuIFVP1y95drSHO4l 4rZoV0hJL/Fi65Ojjl+JZR3A3QHvt0NlP+FWMVfgKVfkqbw1a4H3ytzqrmpe/lM1QY9N /bDDJBYFNGOGoLS5fVnd3cHbwSfO1TK9evUyGJAoGzjBcohSVpYStckXg3FB3iMuOFTr aZkrGV7fE6ABbkJiqb+/6MJhltTWjhos2tvXOxu0MDHBxc5dQDZoZXsjseOElqECfQxD 3ghw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787612; x=1738392412; 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=grXz5NZcQHVvB030YeciAJG8O6y80X3jGiy6VqsSfuM=; b=UAArNe3ZcTQ+81pO8L8ketNT7tNh06SWeJ6Fas2ri6bPI6G5eBrD9e0MSCLhOgsb3F L5t/rrVxUXw9VWPGeTPEahpZNe0jyhEpE2G/HJhG+2ZPBnmR/qOf/IkQnN8qfAqm4x4o teRxTBWRdMd/TauoOK7+ITk4zLImFbAM4IY5I2OXffy2LipvVB1Nakjk6b/S3aEjhkL/ 2CUnzZnmdJxHdir8Sn+sgrf8QXSmzb2WVHd2RIVS2cU8HtMKSlOQ7LbP2VhyINv9WuXb 4jl26Mx6ux5U5bqH75gp95CRrAk+dSVhPJYwYMZIi1xeMHqLwu+bAjpLCNH9Vvf6ZJxY VFIQ== X-Gm-Message-State: AOJu0YzyJxmM2dQcWwDJ5HqxahSCqmjdixzXixs9N0coFtJWdZy8ZKbt jNojsJhxQtQzf7RuavbgXmboDbVjO5Y3IKF0col/KPVdNV8rYO9rmKSMPg== X-Gm-Gg: ASbGnct41IokQQt22i1i8YKDMCc75bUkJCKsFjOpD05CE6f723BBB4xE5TSz0tKm6Le k0lFeyeMrEv/ZX6kKuGmQ6HN3q3shDdAvjD2sO0K4DaXwwqIP4xvZ5OFPZqJeoIs0tDzvmjIWCn 3Y8gLfhGtNWLrURTFjwArqRHrXCexPRQS7WwNSF7bq4jcE3uh61s4cSDhWk5uBR4uZv/PE8Infd ZKEKIGwDynfyxQiLV2+CnbC0TBj0oEevTpD3T+2aj1S3djPEtMwu+GFug0NsnC226yt/jEG3InF yMsQ75Hj+p4w/uRiiTvr33s5ly+44cmghnzAKg== X-Google-Smtp-Source: AGHT+IHFKYpqpQScIfW1Vc6Xu+w+0UcU53IhYifAXcbuX7RiM3pounMCu0UgOTi+gUbfB47ggO3bJw== X-Received: by 2002:a5e:d804:0:b0:82c:ec0f:a081 with SMTP id ca18e2360f4ac-8521e32b142mr475785839f.4.1737787611732; Fri, 24 Jan 2025 22:46:51 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:51 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 14/63] dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code Date: Fri, 24 Jan 2025 23:45:28 -0700 Message-ID: <20250125064619.8305-15-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Tested-by: Louis Chauvet --- 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 e458d4b838ac..c8102e89beb2 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -58,27 +58,16 @@ struct _ddebug { #endif } __attribute__((aligned(8))); =20 -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=3D0 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 */ }; =20 @@ -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; }; =20 /** diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 6bac5703dd41..094d6e62a9d1 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -636,76 +636,6 @@ static int ddebug_apply_class_bitmap(const struct ddeb= ug_class_param *dcp, =20 #define CLASSMAP_BITMASK(width) ((1UL << (width)) - 1) =20 -/* accept comma-separated-list of [+-] classnames */ -static int param_set_dyndbg_classnames(const char *instr, const struct ker= nel_param *kp) -{ - const struct ddebug_class_param *dcp =3D kp->arg; - const struct ddebug_class_map *map =3D dcp->map; - unsigned long curr_bits, old_bits; - char *cl_str, *p, *tmp; - int cls_id, totct =3D 0; - bool wanted; - - cl_str =3D tmp =3D kstrdup_and_replace(instr, '\n', '\0', GFP_KERNEL); - if (!tmp) - return -ENOMEM; - - /* start with previously set state-bits, then modify */ - curr_bits =3D old_bits =3D *dcp->bits; - vpr_info("\"%s\" > %s:0x%lx\n", cl_str, KP_NAME(kp), curr_bits); - - for (; cl_str; cl_str =3D p) { - p =3D strchr(cl_str, ','); - if (p) - *p++ =3D '\0'; - - if (*cl_str =3D=3D '-') { - wanted =3D false; - cl_str++; - } else { - wanted =3D true; - if (*cl_str =3D=3D '+') - cl_str++; - } - cls_id =3D 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) =3D=3D wanted) { - v3pr_info("no change on %s\n", cl_str); - continue; - } - curr_bits ^=3D BIT(cls_id); - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, *dcp->bits, NULL); - *dcp->bits =3D 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 =3D N in 0..max. wanted +/- determines N or N-1 */ - old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); - curr_bits =3D CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); - - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, old_bits, NULL); - *dcp->lvl =3D (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 =3D dcp->map; unsigned long inrep, new_bits, old_bits; int rc, totct =3D 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 =3D 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 =3D kstrtoul(instr, 0, &inrep); + if (rc) { + nl =3D strchr(instr, '\n'); + if (nl) + *nl =3D '\0'; + pr_err("expecting numeric input, not: %s > %s\n", instr, KP_NAME(kp)); return -EINVAL; } =20 - /* 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 struc= t kernel_param *kp) const struct ddebug_class_map *map =3D dcp->map; =20 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 396144cf351b..74d183ebf3e0 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); =20 -/* symbolic input, independent bits */ -enum cat_disjoint_names { LOW =3D 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 =3D 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_LEV= EL_NUM, 14, DD_SYS_WRAP(level_num, p); DD_SYS_WRAP(level_num, T); =20 -/* symbolic verbosity */ -enum cat_level_names { L0 =3D 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") =20 @@ -102,10 +88,6 @@ static void do_cats(void) { pr_debug("doing categories\n"); =20 - 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); } =20 static void do_prints(void) --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D428020A5DA for ; Sat, 25 Jan 2025 06:46:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787615; cv=none; b=l7gLGTGkXbllfBfsyh86RDfh5Mc2aWoPxzDMfaEI1coLG4gPC4szuzkJ+EyqZLL642ITzJR5+wqA7SyySqGMRdMInt74QD9zRE5LiAX1xxTfOJpCaVRNqPsrwSB4LQ21HQt42KaBk/jOerU9oe4rrw9xnk78mvQbYfzeU1QrsSk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787615; c=relaxed/simple; bh=C3HmG21GypE+daUY5fhRF+7cyuAkmskBTWa7p7NRMc4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=he+aCm+aEl5xVPCkWNgCn9Da1BLk71QsuftVGeT15hgQRJmne4Le8vsuW6t/BpZrTTNW9n9Mzf60Y0V9oVWNe+7GM3h3zYs9kvQD3lzhvi0R0FviYIFO5juOJ1dPu7ydxwMzXeNtvFsn/0B4wCIkdb/tMTxZJS5KXTDNlQdaIaU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=B/BXhn3o; arc=none smtp.client-ip=209.85.166.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B/BXhn3o" Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-844dfe4b136so71322139f.3 for ; Fri, 24 Jan 2025 22:46:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787613; x=1738392413; darn=vger.kernel.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=NIDfNAZd/Jw4pBIb/8+H7rZ6KNLM9vcRA8qjI/u0xH0=; b=B/BXhn3oTGp/FJatXj8sozlEc2xpQF3OyuZQqnywca8evW6YcEhbpcw7bPrZZvFMO0 EE50MoghUBn5MHe2Zsa3J0q14QUeb69Ft9JKTfx/+0ObW6WFHQJlfzGrDJn50c3hpZHR SdsvtiOJ5/pdsw7Wlw8wlJ2N05LJrAQd2VQGn8CTzqesBNcGpjRSS5NMBlw4e3JPepHv xsBwi4mhLMml2/po6fUjDD5r/oDIJs2PDexHriyhZedvVTUqsRaRV5o0ZjXUgikUt/9W xaZoAYbxDP+F6BhlHIjIKlhFf2H83luGLpFMwNBATILVO8BLAvBJjGvBeopX4sgVTZEm mr2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787613; x=1738392413; 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=NIDfNAZd/Jw4pBIb/8+H7rZ6KNLM9vcRA8qjI/u0xH0=; b=dIS5FWztMzI6Ljxf+zEXuI3bG+qDMtZQmsQvk7gO0+renytSOV/d6RopEZ2NrONBSi mbLayRpipjbhjLcfF9XjgyS4bXoOhc4Ypaxs2SaoulkIbuxSDNJ38QPC0RYLBtttYYFc QQX0AghAQuf6M4id5tipwKmx1Q+DD5HyU2pTb/Ly4PTN3Fu0Livx/eIiVR8U3HruzJQt H7Wm+X5IzFfxlDdLnCCGOXOnonNPVhcd6KDxPGJgi2e/z0zg22mOHTf5T8RZGrWZTiOG SeiDk0TSQ7caA1xSmiLFF0Xovhn7eNROQrWQ7GgiZAJBH1Hj4s8CEOXf89Qa+HIGG+6H KOAQ== X-Gm-Message-State: AOJu0YxTedHQbJoFb2AM86tWpH1zLbCzNNJf4+ewtiduFctW0quKf4KV Jr1BvJ5kCIxqcmRF6HliPJNbC+PYwkrXYiDd+tCxTJTgxM9HP7lhEPZmgw== X-Gm-Gg: ASbGncukr1YB1OkZea4FsqBpIqdvW2BtgbJmnevQiIReLie4dOW7nW8idBSvBVgwOaf dCy1awPVdT2qYN04FV2/G07wsudvjc13SUvMEsng4hlmkk2at9qA4vR1lWNelMOh7b0hZFMMen3 jGfy8vXSo4sTC/Vd1dHUesMtNJaQLk2H159e7JdK7EM+jFngExkpoNze/QA8Gpgj5qTBFwcNfBH /tzqFdgMdy9wpAtCftGFhVAYbMrFsGLxoWpKyE8QOPzayayztRqq9dnR70qVWpkGA9wdXEhgoMN DzpohSltWJuu4cWYB6yPuDL+61T8gES+mbRseA== X-Google-Smtp-Source: AGHT+IFnBc5L69q2w2UCaGc8rKGCQ73xwiQltSLOxSH0uqSvy0LUY+8SurgBk2ydmGJTEx6YzSwjXA== X-Received: by 2002:a05:6602:2b8a:b0:844:bd90:d45c with SMTP id ca18e2360f4ac-851b65227a0mr2635707139f.13.1737787612867; Fri, 24 Jan 2025 22:46:52 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:52 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn Subject: [PATCH 15/63] checkpatch: add an exception to the do-while wrapper advice Date: Fri, 24 Jan 2025 23:45:29 -0700 Message-ID: <20250125064619.8305-16-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Several new DYNDBG_CLASSMAP_* macros (added in following commits) expand to multi-statement declarations, like module_param_named does. They are invoked in file-scope, not in function scope, and cannot be wrapped by a do-while, so add an exception by name for them. cc: Andy Whitcroft cc: Joe Perches cc: Dwaipayan Ray cc: Lukas Bulwahn Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- scripts/checkpatch.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 9eed3683ad76..4a93b2ede8cd 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5963,6 +5963,7 @@ sub process { MODULE_PARM_DESC| DECLARE_PER_CPU| DEFINE_PER_CPU| + DYNDBG_CLASSMAP| __typeof__\(| union| struct| --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C941D20ADCE for ; Sat, 25 Jan 2025 06:46:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787618; cv=none; b=ufQJvQwxCd8BlJUqOiPfuRxCou8W4pHWPkOFyrs5NrGvabQ8K6Ps+1MeCcFS+9/ztYR021bb/Mcapewte0BQY5bO5KXcpkqnw6GNX3O9FRtop2ggA3JVi3rjFeXIem0WNwoxRBsrX64kgHaP76mLymihkdb4Hhb4vWLe4hhGzVQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787618; c=relaxed/simple; bh=CGUqAPDXoLXDFpLztgwD0iVv9f/HV9brm4Ayupr8v/g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JFHd/m23EcEujbMsuMCMTHxbuqAGMp5vD0ZxmtVrpsnQnEzwjLOImob/xrDbQ8jiUQjWTT1AtZMdRfV0IiOzpy/sCgeiMCa/yLCTrWri/AZ1/SxoTA3BAwxm9JWAMBLYMNrvJXo9lLs2kwSFEizWDmxdCZgAKE60Tgt4Us6RLm0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MxuuRYGq; arc=none smtp.client-ip=209.85.166.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MxuuRYGq" Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-844ce6d0716so215093839f.1 for ; Fri, 24 Jan 2025 22:46:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787615; x=1738392415; darn=vger.kernel.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=VkCP7DhbXFSZduxXgYbh8U8lijC3RzU1c78g2O1IWuU=; b=MxuuRYGqdrvj7tiqntRbSuSxXXMaXHwxtVhc25FWPZYiiCoTGfoZ+q+hvbvPpEeKin uYxNwPaAoW/uc/X5aPd38jWJBncooKqLe3DITZQQBtkkMzokWn6qZXFkxlgZM+T+F3oG AVHO/ZF1d27hCFHtmZhR0sntLZ/T3WwjRxu8KpkZTxJus8LY/OSxCgPXXjKtVjdZGDbx YywH+/Qo2+E2KPz9qcYJStDQXliKXzS49l9vHel+d6t/kKvB9bbKq2fUFzQZuVYOqa59 Wz2m9pp5HWLZy8HI9B0gIraB81IysqI/KsjZZ/dyZK1yL/UCd7RCL6negJf5rK3l8spM ur5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787615; x=1738392415; 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=VkCP7DhbXFSZduxXgYbh8U8lijC3RzU1c78g2O1IWuU=; b=dUXKa+WzWZxzEVorQtUKYIxP/rDPT0Lczl9V26RXkM71+k3F1FIQ1ON+NQmpQczQ8Q moHLOShRA/DbYIUROX2PHI9+D8O93AqPZMOIxiYiQzG7Bl1KJ4WzfnPw7kxJOI/u27MH gRWd0jwuha64LWMlMeIMdWVKhcWSa5jWoxnCH0Pp5vTZGJrcuL9pd5TS0C8oHmKChQ/y +GePni8fn6CchW2RzyKwfilyNyvcr9oEJBVOjYXzA22II0MFg5x+qv6ub4KsACAy3wto 4Iix0u++yvSzRj+WB//MIISfLG1TWOHvlmgVRWC7AsuQkZ4tOBex+7fAmZrrO9pwp6E2 Ik5Q== X-Gm-Message-State: AOJu0YyFr8uuzBU3SE+9aE4zNYY92fWqPM01YmVoTcyUh7oD2OB3nIBS Kz+sk9eaOhP8p2VQduitHEsodjJCnNTqHTuEBoZb2yG2J5ri9FwZJc8XrA== X-Gm-Gg: ASbGncvc5UK4cmru4QHQz9br6LD3f25oJO2oVlX+4mhXYfEhq/BiLgmMTEf81XP0H7m 7MIXRQiQzpD2X7lrmvL3i+DxMevHUxu6Z1m04P5eOhppnlPZ7jNz0vZTC0qSO/cxIFm87pecNzD aWDB1HjQkFk4aU4k0qeGJknebMAkFB3geHlueXbShCmNw5yAZqCFf9b8abm9JH0Lj/ldakATqxI 44pwM2MzE91qLY9qCmNNIidXwmGGsTr6NzyF+jitwdgeNzaJVq4v9HwMeUN8nNshFwoTDwxxxE5 P+YazOTNHa9Cy4Fh2BOUimR6jmg3xtZ1gKKVXY0WfR74pbQD X-Google-Smtp-Source: AGHT+IFEAbKqJslLISqOJfXxgdDRd6CG6f7hCTvFXUPh0fPe+eEs+KYVInCmMitq6lb5zwaZFQusPA== X-Received: by 2002:a05:6602:6b12:b0:849:d268:d75 with SMTP id ca18e2360f4ac-851b627f520mr2536660839f.9.1737787614361; Fri, 24 Jan 2025 22:46:54 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:53 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 16/63] dyndbg-API: replace DECLARE_DYNDBG_CLASSMAP Date: Fri, 24 Jan 2025 23:45:30 -0700 Message-ID: <20250125064619.8305-17-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. Further, its culpable in the CONFIG_DRM_USE_DYNAMIC_DEBUG=3DY regression; its use in both core & drivers obfuscates the 2 roles. So 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 just modifies DECLARE_DYNDBG_CLASSMAP, dropping drop 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" declarations fixes 2nd-defn problem creates a ddebug_class_user record in new __dyndbg_class_users section this allows ddebug_add_module(etal) to handle users differently. 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, and remove the BROKEN marking. 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 is 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 new fields for the new sections: 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 any 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=3Dy 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. NB: this patch ignores a checkpatch do-while warning which is fixed by a preceding commit, which would be wrong for declarative macros like module_param_named() etc. Fixes: aad0214f3026 ("dyndbg: add DECLARE_DYNDBG_CLASSMAP macro") Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- v9 - commit-msg tweaks DRM:CHECK warnings on macros: add parens extern DEFINEd _var, static classnames change ddebug_class_user.user_mod_name to .mod_name simplify ddebug_find_valid_class improve vpr_cm_info msg format wrap (base) in macro body move __DYNDBG_CLASSMAP_CHECK above kdoc for DYNDBG_CLASSMAP_DEFINE 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 dyndbg: This fn formerly returned the map which contained the class (thus validating it), and as a side-effect set the class-id in an outvar. But the caller didn't use the map (after checking its not null), only the valid class-id. So simplify the fn to return the class-id of the validated classname, or -ENOENT when the queried classname is not found. Convey more useful info in the debug-msg: print class-names[0,last], and [base,+len] instead of the class-type printout, which is currently always "type:DISJOINT_BITS". And drop ddebug_classmap_typenames, which is now unused. [root@v6 b0-dd]# modprobe test_dynamic_debug_submod [ 18.864962] dyndbg: loaded classmap: test_dynamic_debug [16..24] V0..V7 [ 18.865046] dyndbg: found kp:p_level_num =3D0x0 [ 18.865048] dyndbg: mapped to: test_dynamic_debug [16..24] V0..V7 [ 18.865164] dyndbg: p_level_num: lvl:0 bits:0x0 [ 18.865217] dyndbg: loaded classmap: test_dynamic_debug [0..10] D2_CORE.= .D2_DRMRES [ 18.865297] dyndbg: found kp:p_disjoint_bits =3D0x0 [ 18.865298] dyndbg: mapped to: test_dynamic_debug [0..10] D2_CORE..D2_= DRMRES [ 18.865424] dyndbg: p_disjoint_bits: classbits: 0x0 [ 18.865472] dyndbg: module:test_dynamic_debug attached 2 classmaps [ 18.865533] dyndbg: 23 debug prints in module test_dynamic_debug [ 18.866558] dyndbg: loaded classmap: test_dynamic_debug_submod [16..24] = V0..V7 [ 18.866698] dyndbg: found kp:p_level_num =3D0x0 [ 18.866699] dyndbg: mapped to: test_dynamic_debug_submod [16..24] V0..= V7 [ 18.866865] dyndbg: p_level_num: lvl:0 bits:0x0 [ 18.866926] dyndbg: loaded classmap: test_dynamic_debug_submod [0..10] D= 2_CORE..D2_DRMRES [ 18.867026] dyndbg: found kp:p_disjoint_bits =3D0x0 [ 18.867027] dyndbg: mapped to: test_dynamic_debug_submod [0..10] D2_CO= RE..D2_DRMRES [ 18.867193] dyndbg: p_disjoint_bits: classbits: 0x0 [ 18.867255] dyndbg: module:test_dynamic_debug_submod attached 2 classmap= uses [ 18.867351] dyndbg: 23 debug prints in module test_dynamic_debug_submod --- MAINTAINERS | 2 +- include/asm-generic/vmlinux.lds.h | 1 + include/linux/dynamic_debug.h | 83 ++++++++++-- kernel/module/main.c | 3 + lib/Kconfig.debug | 24 +++- lib/Makefile | 3 + lib/dynamic_debug.c | 203 ++++++++++++++++++++++++------ lib/test_dynamic_debug.c | 111 +++++++++++----- lib/test_dynamic_debug_submod.c | 10 ++ 9 files changed, 355 insertions(+), 85 deletions(-) create mode 100644 lib/test_dynamic_debug_submod.c diff --git a/MAINTAINERS b/MAINTAINERS index 0fa7c5728f1e..38afccb3b71e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8041,7 +8041,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 =20 DYNAMIC INTERRUPT MODERATION M: Tal Gilboa diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index 54504013c749..eb93fd09832b 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -366,6 +366,7 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELL= ER_CLANG) /* implement dynamic printk debug */ \ . =3D ALIGN(8); \ BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) \ + BOUNDED_SECTION_BY(__dyndbg_class_users, ___dyndbg_class_users) \ BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \ CODETAG_SECTIONS() \ LIKELY_PROFILE() \ diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index c8102e89beb2..dc610a12b91c 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -71,9 +71,28 @@ enum ddebug_class_map_type { */ }; =20 +/* + * dyndbg-classmaps are devised to support DRM.debug directly: + * 10 enum-vals: DRM_UT_* define the categories + * ~23 categorized *_dbg() macros, each passing a DRM_UT_* val as 1st arg + * 2 macros below them: drm_dev_dbg, __drm_dbg + * ~5000 calls to the categorized macros, across all of drivers/gpu/drm/ + * + * When CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy, the 2 low macros are redefined + * to invoke _dynamic_func_call_cls(). This compiles the category + * into each callsite's class_id field, where dyndbg can select on it + * and alter a callsite's patch-state, avoiding repeated __drm_debug + * checks. + * + * To make the callsites manageable from the >control file, authors + * provide a "classmap" of names to class_ids in use by the module(s), + * usually by stringifying the enum-vals. Modules with multiple + * classmaps must arrange to share the 0..62 class_id space. + */ + 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 +100,34 @@ struct ddebug_class_map { }; =20 /** - * 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 debug classes used by a module. + * @_var: name of the classmap, exported for other modules coordinated u= se. + * @_mapty: enum ddebug_class_map_type: 0:DISJOINT - independent, 1:LEVEL = - v2>v1 + * @_base: reserve N classids starting at _base, to split 0..62 classid s= pace + * @classes: names of the N classes. + * + * This tells dyndbg what class_ids the module is using: _base..+N, by + * mapping names onto them. This qualifies "class NAME" >controls on + * the defining module, ignoring unknown names. + */ +#define DYNDBG_CLASSMAP_DEFINE(_var, _mapty, _base, ...) \ + static const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ + extern struct ddebug_class_map _var; \ + struct ddebug_class_map __aligned(8) __used \ + __section("__dyndbg_classes") _var =3D { \ + .mod =3D THIS_MODULE, \ + .mod_name =3D KBUILD_MODNAME, \ + .base =3D (_base), \ + .map_type =3D (_mapty), \ + .length =3D ARRAY_SIZE(_var##_classnames), \ + .class_names =3D _var##_classnames, \ + }; \ + EXPORT_SYMBOL(_var) + +/* + * XXX: keep this until DRM adapts to use the DEFINE/USE api, it + * differs from DYNDBG_CLASSMAP_DEFINE by the static replacing the + * extern/EXPORT on the struct init. */ #define DECLARE_DYNDBG_CLASSMAP(_var, _maptype, _base, ...) \ static const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ @@ -99,12 +141,37 @@ struct ddebug_class_map { .class_names =3D _var##_classnames, \ } =20 +struct ddebug_class_user { + char *mod_name; + struct ddebug_class_map *map; +}; + +/** + * DYNDBG_CLASSMAP_USE - refer to a classmap, DEFINEd elsewhere. + * @_var: name of the exported classmap var + * + * This tells dyndbg that the module has prdbgs with classids defined + * in the named classmap. This qualifies "class NAME" >controls on + * the user module, ignoring unknown names. + */ +#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 =3D { \ + .mod_name =3D KBUILD_MODNAME, \ + .map =3D &(_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; }; =20 struct ddebug_class_param { @@ -205,7 +272,7 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, * (|_no_desc): former gets callsite descriptor as 1st arg (for prdbgs) */ #define __dynamic_func_call_cls(id, cls, fmt, func, ...) do { \ - DEFINE_DYNAMIC_DEBUG_METADATA_CLS(id, cls, fmt); \ + DEFINE_DYNAMIC_DEBUG_METADATA_CLS((id), cls, fmt); \ if (DYNAMIC_DEBUG_BRANCH(id)) \ func(&id, ##__VA_ARGS__); \ } while (0) diff --git a/kernel/module/main.c b/kernel/module/main.c index 5399c182b3cb..c394a0c6e8c6 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2546,6 +2546,9 @@ static int find_module_sections(struct module *mod, s= truct load_info *info) mod->dyndbg_info.classes =3D section_objs(info, "__dyndbg_classes", sizeof(*mod->dyndbg_info.classes), &mod->dyndbg_info.num_classes); + mod->dyndbg_info.class_users =3D section_objs(info, "__dyndbg_class_users= ", + sizeof(*mod->dyndbg_info.class_users), + &mod->dyndbg_info.num_class_users); #endif =20 return 0; diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index f3d723705879..933f69ef87f8 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -2884,12 +2884,26 @@ config TEST_STATIC_KEYS If unsure, say N. =20 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=3Dy/m submod=3Dy/m. =20 If unsure, say N. =20 diff --git a/lib/Makefile b/lib/Makefile index a8155c972f02..7f66fc1c163d 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -84,6 +84,7 @@ obj-$(CONFIG_TEST_SORT) +=3D test_sort.o obj-$(CONFIG_TEST_STATIC_KEYS) +=3D test_static_keys.o obj-$(CONFIG_TEST_STATIC_KEYS) +=3D test_static_key_base.o obj-$(CONFIG_TEST_DYNAMIC_DEBUG) +=3D test_dynamic_debug.o +obj-$(CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD) +=3D test_dynamic_debug_submod.o obj-$(CONFIG_TEST_PRINTF) +=3D test_printf.o obj-$(CONFIG_TEST_SCANF) +=3D test_scanf.o =20 @@ -228,6 +229,8 @@ obj-$(CONFIG_ARCH_NEED_CMPXCHG_1_EMU) +=3D cmpxchg-emu.o obj-$(CONFIG_DYNAMIC_DEBUG_CORE) +=3D dynamic_debug.o #ensure exported functions have prototypes CFLAGS_dynamic_debug.o :=3D -DDYNAMIC_DEBUG_MODULE +CFLAGS_test_dynamic_debug.o :=3D -DDYNAMIC_DEBUG_MODULE +CFLAGS_test_dynamic_debug_submod.o :=3D -DDYNAMIC_DEBUG_MODULE =20 obj-$(CONFIG_SYMBOLIC_ERRNAME) +=3D errname.o =20 diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 094d6e62a9d1..6bca0c6727d4 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[]; =20 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; }; =20 struct ddebug_query { @@ -148,23 +151,35 @@ static void vpr_info_dq(const struct ddebug_query *qu= ery, const char *msg) query->first_lineno, query->last_lineno, query->class_string); } =20 -#define __outvar /* filled by callee */ -static struct ddebug_class_map *ddebug_find_valid_class(struct ddebug_tabl= e const *dt, - const char *class_string, - __outvar int *class_id) +#define vpr_dt_info(dt_p, msg_p, ...) ({ \ + struct ddebug_table const *_dt =3D 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); \ + }) + +static int ddebug_find_valid_class(struct ddebug_table const *dt, const ch= ar *class_string) { struct ddebug_class_map *map; + struct ddebug_class_user *cli; int i, idx; =20 - for (map =3D dt->classes, i =3D 0; i < dt->num_classes; i++, map++) { + for (i =3D 0, map =3D dt->classes; i < dt->num_classes; i++, map++) { idx =3D match_string(map->class_names, map->length, class_string); if (idx >=3D 0) { - *class_id =3D idx + map->base; - return map; + vpr_dt_info(dt, "good-class: %s.%s ", map->mod_name, class_string); + return idx + map->base; } } - *class_id =3D -ENOENT; - return NULL; + for (i =3D 0, cli =3D dt->class_users; i < dt->num_class_users; i++, cli+= +) { + idx =3D match_string(cli->map->class_names, cli->map->length, class_stri= ng); + if (idx >=3D 0) { + vpr_dt_info(dt, "class-ref: %s -> %s.%s ", + cli->mod_name, cli->map->mod_name, class_string); + return idx + cli->map->base; + } + } + return -ENOENT; } =20 /* @@ -173,16 +188,14 @@ static struct ddebug_class_map *ddebug_find_valid_cla= ss(struct ddebug_table cons * callsites, normally the same as number of changes. If verbose, * logs the changes. Takes ddebug_lock. */ -static int ddebug_change(const struct ddebug_query *query, - struct flag_settings *modifiers) +static int ddebug_change(const struct ddebug_query *query, struct flag_set= tings *modifiers) { int i; struct ddebug_table *dt; unsigned int newflags; unsigned int nfound =3D 0; struct flagsbuf fbuf, nbuf; - struct ddebug_class_map *map =3D NULL; - int __outvar valid_class; + int valid_class; =20 /* search for matching ddebugs */ mutex_lock(&ddebug_lock); @@ -194,8 +207,8 @@ static int ddebug_change(const struct ddebug_query *que= ry, continue; =20 if (query->class_string) { - map =3D ddebug_find_valid_class(dt, query->class_string, &valid_class); - if (!map) + valid_class =3D ddebug_find_valid_class(dt, query->class_string); + if (valid_class < 0) continue; } else { /* constrain query, do not touch class'd callsites */ @@ -559,7 +572,7 @@ static int ddebug_exec_query(char *query_string, const = char *modname) =20 /* 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 +701,12 @@ static int param_set_dyndbg_module_classes(const char= *instr, } =20 /** - * 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 +1051,17 @@ static void *ddebug_proc_next(struct seq_file *m, v= oid *p, loff_t *pos) static const char *ddebug_class_name(struct ddebug_table *dt, struct _ddeb= ug *dp) { struct ddebug_class_map *map =3D dt->classes; + struct ddebug_class_user *cli =3D dt->class_users; int i; =20 for (i =3D 0; i < dt->num_classes; i++, map++) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; =20 + for (i =3D 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; } =20 @@ -1124,31 +1142,129 @@ static const struct proc_ops proc_fops =3D { .proc_write =3D ddebug_proc_write }; =20 -static void ddebug_attach_module_classes(struct ddebug_table *dt, struct _= ddebug_info *di) +#define vpr_cm_info(cm_p, msg_fmt, ...) ({ \ + struct ddebug_class_map const *_cm =3D cm_p; \ + v2pr_info(msg_fmt " %s [%d..%d] %s..%s\n", ##__VA_ARGS__, \ + _cm->mod_name, _cm->base, _cm->base + _cm->length, \ + _cm->class_names[0], _cm->class_names[_cm->length - 1]); \ + }) + +static void ddebug_sync_classbits(const struct kernel_param *kp, const cha= r *modname) +{ + const struct ddebug_class_param *dcp =3D kp->arg; + + /* clamp initial bitvec, mask off hi-bits */ + if (*dcp->bits & ~CLASSMAP_BITMASK(dcp->map->length)) { + *dcp->bits &=3D 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 !=3D ¶m_ops_dyndbg_classes) + return; + + dcp =3D (struct ddebug_class_param *)kp->arg; + + if (map =3D=3D dcp->map) { + v2pr_info(" kp:%s.%s =3D0x%lx", modnm, kp->name, *dcp->bits); + vpr_cm_info(map, " %s mapped to: ", modnm); + ddebug_sync_classbits(kp, modnm); + } +} + +static void ddebug_apply_params(const struct ddebug_class_map *cm, const c= har *modnm) +{ + const struct kernel_param *kp; +#if IS_ENABLED(CONFIG_MODULES) + int i; + + if (cm->mod) { + vpr_cm_info(cm, "loaded classmap: %s", modnm); + /* ifdef protects the cm->mod->kp deref */ + for (i =3D 0, kp =3D 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 classmap: %s", modnm); + for (kp =3D __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, + const struct _ddebug_info *di) { struct ddebug_class_map *cm; int i, nc =3D 0; =20 - /* - * 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 =3D di->classes, i =3D 0; i < di->num_classes; i++, cm++) { - + for (i =3D 0, cm =3D 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 =3D cm; - } - nc++; } } - if (nc) { - dt->num_classes =3D 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 =3D nc; + + for (i =3D 0, cm =3D 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 =3D 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 =3D 0, cli =3D di->class_users; i < di->num_class_users; i++, cli+= +) { + if (WARN_ON_ONCE(!cli || !cli->map || !cli->mod_name)) + continue; + if (!strcmp(cli->mod_name, dt->mod_name)) { + vpr_cm_info(cli->map, "class_ref[%d] %s -> %s", i, + cli->mod_name, cli->map->mod_name); + if (!nc++) + dt->class_users =3D cli; + } } + if (!nc) + return; + + dt->num_class_users =3D nc; + + /* now iterate dt */ + for (i =3D 0, cli =3D dt->class_users; i < dt->num_class_users; i++, cli+= +) + ddebug_apply_params(cli->map, cli->mod_name); + + vpr_dt_info(dt, "attach-client-module: "); } =20 /* @@ -1158,6 +1274,8 @@ static void ddebug_attach_module_classes(struct ddebu= g_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 =3D 0; =20 if (!di->num_descs) return 0; @@ -1181,13 +1299,20 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) =20 INIT_LIST_HEAD(&dt->link); =20 - if (di->classes && di->num_classes) + for (i =3D 0, iter =3D di->descs; i < di->num_descs; i++, iter++) + if (iter->class_id !=3D _DPRINTK_CLASS_DFLT) + class_ct++; + + if (class_ct && di->num_classes) ddebug_attach_module_classes(dt, di); =20 mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); =20 + 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 +1462,10 @@ static int __init dynamic_debug_init(void) struct _ddebug_info di =3D { .descs =3D __start___dyndbg, .classes =3D __start___dyndbg_classes, + .class_users =3D __start___dyndbg_class_users, .num_descs =3D __stop___dyndbg - __start___dyndbg, .num_classes =3D __stop___dyndbg_classes - __start___dyndbg_classes, + .num_class_users =3D __stop___dyndbg_class_users - __start___dyndbg_clas= s_users, }; =20 #ifdef CONFIG_MODULES diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 74d183ebf3e0..1838f62738c4 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -6,11 +6,15 @@ * Jim Cromie */ =20 -#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 =20 #include =20 -/* run tests by reading or writing sysfs node: do_prints */ +/* re-gen output by reading or writing sysfs node: do_prints */ =20 static void do_prints(void); /* device under test */ static int param_set_do_prints(const char *instr, const struct kernel_para= m *kp) @@ -29,24 +33,39 @@ static const struct kernel_param_ops param_ops_do_print= s =3D { }; module_param_cb(do_prints, ¶m_ops_do_prints, NULL, 0600); =20 -/* - * 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 =3D { \ +#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 =3D _init; \ + static struct ddebug_class_param _flags##_##_model =3D { \ .bits =3D &bits_##_model, \ .flags =3D #_flags, \ .map =3D &map_##_model, \ }; \ - module_param_cb(_flags##_##_model, ¶m_ops_dyndbg_classes, &_flags##_m= odel, 0600) + module_param_cb(_flags##_##_model, ¶m_ops_dyndbg_classes, \ + &_flags##_##_model, 0600) +#ifdef DEBUG +#define DYNDBG_CLASSMAP_PARAM(_model, _flags) DYNDBG_CLASSMAP_PARAM_(_mod= el, _flags, ~0) +#else +#define DYNDBG_CLASSMAP_PARAM(_model, _flags) DYNDBG_CLASSMAP_PARAM_(_mod= el, _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 =3D X inits. + * + * Declare all 4 enums now, for different types + */ =20 /* 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); =20 /* numeric verbosity, V2 > V1 related */ enum cat_level_num { V0 =3D 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 =20 /* 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) =20 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_submo= d.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" --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7877F20ADE1 for ; Sat, 25 Jan 2025 06:46:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787618; cv=none; b=Fyswnu++jR8IaG2G0MXgJKgz3MWIWVjbJ9KPaKb8E9/hxAbs7q1AqKaMt0DXXpSpzcnO5o/UhiHT4KaYe2o8Dy0lJdrXGG+7Qp2JJVYpcJ5wP9EzcCtV611Ie4Ob9NRtlctiooZeePAzTBQmwmv/ziDIgYJw/klxrOsg/ds5tPg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787618; c=relaxed/simple; bh=L3jWxSPNw0/I321jOnJSmC2MhE7xQB3BsJab6rVtRNo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JATPCPXonH0NOEUtDiWBydYSnmLnmXrPJP5Dut/oqya2nL+ihUTfCC/1fXA9dTPUvUMycdHFMjPAXk+2Y5QfSjSgobWzKL2to1IUf8Oo8M3v8fBDCLODSxEF4QpmNYOkILsOA02YtiTCUVInw/4hX5yySbQ2R4v+7YzzU4HRfRY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DXOplTOn; arc=none smtp.client-ip=209.85.166.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DXOplTOn" Received: by mail-il1-f169.google.com with SMTP id e9e14a558f8ab-3cf82bd380bso23195215ab.0 for ; Fri, 24 Jan 2025 22:46:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787615; x=1738392415; darn=vger.kernel.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=Xde8rOoc7ub5IEPiyVqYWw11iutjj4hEBt+3xz2QfjM=; b=DXOplTOnnCDwBRiVxXyjmowv+sWqEhoWc0JFikK+69xXdukamhJokY0B4AxQb1F4ZI O+2ouepc96icPus/ygjsQfP3TG8IdQBCh484gJJQGEYaIim7R5EHtjxfaIAPB3RflVwN XEiwC/fk0/bGuWgR9NtbPLj+n+iQCTLSgLCCI9R7Sb/caw7CWQTv2rN5txZXY7N7DvvC M8tZmEoZy465SGHGgH4f2kdKNiFYWAaqcTLXGY2ekVlLRBc6BSCxyR1CEe7BBK+UU3Hy rGjeAVm5P0dDDWSAbsSZvd+LD4vEbSsUXLWUXGXi4+ZqQB0oCdDRAyndyU8pCsvNRNJv nZrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787615; x=1738392415; 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=Xde8rOoc7ub5IEPiyVqYWw11iutjj4hEBt+3xz2QfjM=; b=Jg9gGiJG0svXYlquYI7zjuOeqah8bPFIrfpFIuuCggWSdjjH+UvCVl4VyULXmFPOhe PHm7OmE5KR6k16i3chvxu8Ym4+C6lkx3T1KBNHiyFuRfpBCva4WFpCd3SMn1WUJiGaFp MhwFKggEMGihjDIlJMNO2foA0DZbs9E/eyLQgBnSxepbGZ3LktfFverkzDFPuKbZY1HZ TpkNqMX4Fy+GJurtqeF51Y08VcRvwSKjnjqov13qiOsyDbO8upz9UnHQ1G1j/XU7gpZr LjmsSBFonYhKLEoYDrmysh7Em1oMjvDtJIF1wkJ4lMgzPK9fLrQZkvKc6/2fiUEAcrSK codw== X-Gm-Message-State: AOJu0YxYbtijRGk3URzJiFqe/a19fc7qdSTsZVofgegh2ijHKEn5LBw7 H3Ja96Sgm6ot839sXU/YsWqVKYPhwb3Gkt5nQXycMOzmXmC2FHm4yNPgUA== X-Gm-Gg: ASbGnctVfsRGocdyNvFYBlOm8pGP7pEzNhU06eFtu4G7skERUFxvgZlWaxPCxNdfYNq OC6U0+SaYD3a2F1WuC9a8qWYQMo6k6ZMCbK0VpDmTY9TcNbKGzETtgX5W4/3Bl6GR/kYva+1FjD oWNWDXjpkZ9rRyvk3gYxjQW0nLO0kB4Q/psF+H592+5JPeFjJdC4omYdg4F15i7EholrnLox+5r JyexQ04Nwh1kDaMszKbc7z8/cFyUate+5LZxPb2JQRdUQBkNq5hvcwqyjKRNpI64WT8hOPBqBK1 44UYlq5hxB0rN40bgG7iAV8pUxRg1ZPhu6CZ3A== X-Google-Smtp-Source: AGHT+IG0fqXZTCvCCnwL9vi7cYB4QP6opHHV2Qe7YcKfvhFM9yUxKYXJHOh6jRvUhuTThLQuLUmipg== X-Received: by 2002:a05:6e02:174a:b0:3cf:ce7c:b8b1 with SMTP id e9e14a558f8ab-3cfce7cb91cmr43838095ab.18.1737787615489; Fri, 24 Jan 2025 22:46:55 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:55 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 17/63] dyndbg: check DYNDBG_CLASSMAP_DEFINE args at compile-time Date: Fri, 24 Jan 2025 23:45:31 -0700 Message-ID: <20250125064619.8305-18-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add __DYNDBG_CLASSMAP_CHECK to implement these arg-checks at compile: 0 <=3D _base < 63 class_names is not empty class_names[0] is a string (class_names.length + _base) < 63 These compile-time checks will prevent several misuses; 4 such examples are added to test_dynamic_debug_submod.ko, and will fail compilation if -DDD_MACRO_ARGCHECK is added to cflags. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- - split static-asserts to __DYNDBG_CLASSMAP_CHECK - move __DYNDBG_CLASSMAP_CHECK above kdoc for DYNDBG_CLASSMAP_DEFINE silences kernel-doc warnings --- include/linux/dynamic_debug.h | 9 +++++++++ lib/test_dynamic_debug.c | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index dc610a12b91c..2b0c943af330 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -99,6 +99,14 @@ struct ddebug_class_map { enum ddebug_class_map_type map_type; }; =20 +#define __DYNDBG_CLASSMAP_CHECK(_clnames, _base) \ + static_assert(((_base) >=3D 0 && (_base) < _DPRINTK_CLASS_DFLT), \ + "_base must be in 0..62"); \ + static_assert(ARRAY_SIZE(_clnames) > 0, \ + "classnames array size must be > 0"); \ + static_assert((ARRAY_SIZE(_clnames) + (_base)) < _DPRINTK_CLASS_DFLT, \ + "_base + classnames.length exceeds range") + /** * DYNDBG_CLASSMAP_DEFINE - define debug classes used by a module. * @_var: name of the classmap, exported for other modules coordinated u= se. @@ -112,6 +120,7 @@ struct ddebug_class_map { */ #define DYNDBG_CLASSMAP_DEFINE(_var, _mapty, _base, ...) \ static const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ + __DYNDBG_CLASSMAP_CHECK(_var##_classnames, (_base)); \ extern struct ddebug_class_map _var; \ struct ddebug_class_map __aligned(8) __used \ __section("__dyndbg_classes") _var =3D { \ diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 1838f62738c4..b1555b0a2bb1 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -123,8 +123,19 @@ DYNDBG_CLASSMAP_PARAM(level_num, p); DYNDBG_CLASSMAP_USE(map_disjoint_bits); DYNDBG_CLASSMAP_USE(map_level_num); =20 +#if defined(DD_MACRO_ARGCHECK) +/* + * Exersize compile-time arg-checks in DYNDBG_CLASSMAP_DEFINE. + * These will break compilation. + */ +DYNDBG_CLASSMAP_DEFINE(fail_base_neg, 0, -1, "NEGATIVE_BASE_ARG"); +DYNDBG_CLASSMAP_DEFINE(fail_base_big, 0, 100, "TOOBIG_BASE_ARG"); +DYNDBG_CLASSMAP_DEFINE(fail_str_type, 0, 0, 1 /* not a string */); +DYNDBG_CLASSMAP_DEFINE(fail_emptyclass, 0, 0 /* ,empty */); #endif =20 +#endif /* TEST_DYNAMIC_DEBUG_SUBMOD */ + /* stand-in for all pr_debug etc */ #define prdbg(SYM) __pr_debug_cls(SYM, #SYM " msg\n") =20 --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99F3B20ADF1 for ; Sat, 25 Jan 2025 06:46:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787619; cv=none; b=S/VpbU0DauRzVn/9uT2sBGkPTObPmz6GafsMGDOpaQzu0QJqAYN9o2rN9O2QYExeEG8x9wx6wqVxTRy0AxEnHpuSGRBMSXvX7mK/L+XVrdu4jNrneaFBeJTfqq7suApIAc6P5415MKUI3/f2dbxrXMr4joz2/XSrssXcbQ8kSQg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787619; c=relaxed/simple; bh=/mjj5vb73h1xa52yXHBUdaYr2Mt3vtwDdccGK4k6mus=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CQnz//iUyG7ZyHkOwnHnZ5XW5sb79kBHGuzHnMFmy03s4aUD6LdDc0nJyMxZmeQEC54oSqrWTMrX7NTJM38HlA8t7+7x7FS7zb6gIGbSPqkhB/1E6OhuztMiKTKZvprypTo7dpdjI016JYB1GGv6eaoyJyTvuzKx5qCMoDPLiEI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JTRPC7Ho; arc=none smtp.client-ip=209.85.166.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JTRPC7Ho" Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-84cdacbc3dbso225267039f.2 for ; Fri, 24 Jan 2025 22:46:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787616; x=1738392416; darn=vger.kernel.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=4426qb3gIsTZka2SxcS2AqXLzVLPKaaERHnBDYOLWSA=; b=JTRPC7HodwZSpJ6D86nTlzNHk0lxF2Pv+JLxSJqIR9htMXWely2sL6TO8lvdSL+cqR dwOXmEiY+nn2yoCssDK+/+hb0TuAsNOiDEvR8Qw7U8ISYpf4+kc/rasEFXUmHMmfJOC8 iHSEE55yftkV0KmfMXLbr0ykxvLSvfOq/hg+GZZFHoW6B8RYheHONzwE4vFIgiuaJQwK QIUPiF3UHCZvHQgN6EMIWYWvCOmsqi8wHrn831wAm1wvsAGLzcriWmA7szXR/xyXMb2z VWOxYAE98HyhHoR6jd2KXAb/NfoLIKA8NECtfGxVXgDqkJXTC/nOJItjPq5kKFtOhBqR iLOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787616; x=1738392416; 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=4426qb3gIsTZka2SxcS2AqXLzVLPKaaERHnBDYOLWSA=; b=waXCvnGKNeT3/GfQR8eGf0Wleznaz/7lSjS6+A+dmX3wYy8XPW36XxL7xpc+nlsxaW yfDzGbr/l3r3pB9HWRUHzqI2G6y/GYuhsWRD3ZlPv7KOzRGCVVWnu0kICTMgAUiIK7O6 xFPyvpSYCzGd/XN9UVJaH194WzQWVI1Ls7zN709dabJ7wuaVEBgya4WKq1N143H7QGx4 y1R9ZzR0iPN6Cl8s/QZR4NmPpL4IHCT3B/+xTvVb5cZGVNDFgpN6dwFJ6qORBtytgMzY tMZoMXZLpDOXoE0fe+c9hkvB3Nw6HEWG+I5SU7Vh+JENQRmjfb4Mg2kE67l1TIvIbCuk Nh/g== X-Gm-Message-State: AOJu0YzEDK9FVfANSRVJg3ejQnwagURTHidcp4jk34coY9hhmsebR2ei wvKCfe0Tk7hSdHtr0eojUJDU0k20Xh8IKukB7DrKCjvn5o+oq724C6L0BQ== X-Gm-Gg: ASbGncv8y0bpWpw957ouss9qnpEx9AW+ZWw5re9YJ9Vat2NMw5e/hOT9x1fVHUp9WrJ OCGxeWSHzmTzd6L4E3c2nWHMpgqNFf5Y1roPZQRxH0K/D+OX71C0lHQqNFrsXBqgriRfLYfvqSj hPc0UlXDaxycWTTXRwTTbiB4z/J20iPnIChztmsDuTcOrA/Mvym1G+rKiMPVhdMzkyKDBzkS+5t WVtei72VQ1Ui9t8SK5U7Im4pNbhmSfapy3334ivbD8dBKYsIq5mh252vnEbYIv+G9gKi1a9TuZO NLDlYZMn99JmkFFxlV8/lo8b6lb3GnsdFDJIKj5Lh2L6RLpw X-Google-Smtp-Source: AGHT+IHPcwCIcEeaDfvcsC8Y0hmazgAlIp69PtLu+D2gBA3Q65N9zrEn328wJ16fD3PoHPmaHxXlww== X-Received: by 2002:a05:6602:2d91:b0:835:4cb5:4fa7 with SMTP id ca18e2360f4ac-851b62b1c79mr3161173639f.12.1737787616655; Fri, 24 Jan 2025 22:46:56 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:56 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 18/63] dyndbg: add/use for_subvec() to reduce boilerplate Date: Fri, 24 Jan 2025 23:45:32 -0700 Message-ID: <20250125064619.8305-19-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" add for_subvec() macro to encapsulate a for-loop pattern thats used repeatedly to iterate over a boxed.vector of N elements. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- lib/dynamic_debug.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 6bca0c6727d4..08b6e4e7489f 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -158,20 +158,34 @@ static void vpr_info_dq(const struct ddebug_query *qu= ery, const char *msg) _dt->num_class_users); \ }) =20 +/* + * simplify a repeated for-loop pattern walking N steps in a T _vec + * member inside a struct _box. It expects int i and T *_sp to be + * declared in the caller. + * @_i: caller provided counter. + * @_sp: cursor into _vec, to examine each item. + * @_box: ptr to a struct containing @_vec member + * @_vec: name of a sub-struct member in _box, with array-ref and length + */ +#define for_subvec(_i, _sp, _box, _vec) \ + for ((_i) =3D 0, (_sp) =3D (_box)->_vec; \ + (_i) < (_box)->num_##_vec; \ + (_i)++, (_sp)++) + static int ddebug_find_valid_class(struct ddebug_table const *dt, const ch= ar *class_string) { struct ddebug_class_map *map; struct ddebug_class_user *cli; int i, idx; =20 - for (i =3D 0, map =3D dt->classes; i < dt->num_classes; i++, map++) { + for_subvec(i, map, dt, classes) { idx =3D match_string(map->class_names, map->length, class_string); if (idx >=3D 0) { vpr_dt_info(dt, "good-class: %s.%s ", map->mod_name, class_string); return idx + map->base; } } - for (i =3D 0, cli =3D dt->class_users; i < dt->num_class_users; i++, cli+= +) { + for_subvec(i, cli, dt, class_users) { idx =3D match_string(cli->map->class_names, cli->map->length, class_stri= ng); if (idx >=3D 0) { vpr_dt_info(dt, "class-ref: %s -> %s.%s ", @@ -1190,7 +1204,7 @@ static void ddebug_apply_params(const struct ddebug_c= lass_map *cm, const char *m if (cm->mod) { vpr_cm_info(cm, "loaded classmap: %s", modnm); /* ifdef protects the cm->mod->kp deref */ - for (i =3D 0, kp =3D cm->mod->kp; i < cm->mod->num_kp; i++, kp++) + for_subvec(i, kp, cm->mod, kp) ddebug_match_apply_kparam(kp, cm, modnm); } #endif @@ -1212,7 +1226,7 @@ static void ddebug_attach_module_classes(struct ddebu= g_table *dt, struct ddebug_class_map *cm; int i, nc =3D 0; =20 - for (i =3D 0, cm =3D di->classes; i < di->num_classes; i++, cm++) { + for_subvec(i, cm, di, classes) { if (!strcmp(cm->mod_name, dt->mod_name)) { vpr_cm_info(cm, "classes[%d]:", i); if (!nc++) @@ -1225,7 +1239,7 @@ static void ddebug_attach_module_classes(struct ddebu= g_table *dt, vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); dt->num_classes =3D nc; =20 - for (i =3D 0, cm =3D dt->classes; i < dt->num_classes; i++, cm++) + for_subvec(i, cm, dt, classes) ddebug_apply_params(cm, cm->mod_name); } =20 @@ -1245,7 +1259,7 @@ static void ddebug_attach_user_module_classes(struct = ddebug_table *dt, * module's refs, save to dt. For loadables, this is the * whole array. */ - for (i =3D 0, cli =3D di->class_users; i < di->num_class_users; i++, cli+= +) { + for_subvec(i, cli, di, class_users) { if (WARN_ON_ONCE(!cli || !cli->map || !cli->mod_name)) continue; if (!strcmp(cli->mod_name, dt->mod_name)) { @@ -1261,7 +1275,7 @@ static void ddebug_attach_user_module_classes(struct = ddebug_table *dt, dt->num_class_users =3D nc; =20 /* now iterate dt */ - for (i =3D 0, cli =3D dt->class_users; i < dt->num_class_users; i++, cli+= +) + for_subvec(i, cli, di, class_users) ddebug_apply_params(cli->map, cli->mod_name); =20 vpr_dt_info(dt, "attach-client-module: "); @@ -1299,7 +1313,7 @@ static int ddebug_add_module(struct _ddebug_info *di,= const char *modname) =20 INIT_LIST_HEAD(&dt->link); =20 - for (i =3D 0, iter =3D di->descs; i < di->num_descs; i++, iter++) + for_subvec(i, iter, di, descs) if (iter->class_id !=3D _DPRINTK_CLASS_DFLT) class_ct++; =20 --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E13CE20AF65 for ; Sat, 25 Jan 2025 06:46:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787621; cv=none; b=jNu/f3PKNMJe8+8DWCXtKacTNlSDSZHJgBnO9Dr+e3OMaDmpSK+yHXAM317adgLcFsElFd7dLpA9mivoVGTMj6a7igaEIybCTQoN8xKwqDoIGI45xCUghOCll2eJDJrdwn6ABPew5d3WCrAgqwqo/SOHohdPIWwdAKNhhwUmPBc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787621; c=relaxed/simple; bh=SDsGGfmEEMuK9V5p7hXimvADd6Y+kWBlK/bP/YeHymA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dDZIZAsnbfQjosLMJjTY2Fmi80Z/mRppcuqkR2J7NZvAsl8HJx2Jx+bx+FV5a1xhXb2ETuCM/MvvtyAqzvbvQ636w5sb4JHAHg1NJ6NmWhR64YtzYz9w7nJW7u8Do/qhxhSxQ6QwPkHEbQ8sOWnVxTpxswyYwQo5GsrgVuye448= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SL0VVZlX; arc=none smtp.client-ip=209.85.166.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SL0VVZlX" Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-844ee43460aso183955639f.1 for ; Fri, 24 Jan 2025 22:46:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787618; x=1738392418; darn=vger.kernel.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=WlrfrIzuFMjHOeBtjpo3TAdP2V/LwFa19R3qLyIAfcI=; b=SL0VVZlXg4bD4u5MDm30ARsXWVBsdAzYIMAvdUbTXBbs5t+K0j7MS+Tzz1yRl2yhxs 3HU7gW60ssyi6DMYAYQx5u3SxVvoLPYwZZP+k9JCD1p8dv1Fr8ywbYQwIjl6Aa3/t2/e L+Fj4pN5Ey68meq1Rk878e7lWVCMEqpefgBXSWUPFJ+aCTkmgTV+dh0YDyZFO/wIlb5C ASdOKAFyvwfbNmfjDEiigy0oF9RzedDYPSAtPh0xDjvYVP5e9kXd+d1j1nHRii5EuvKM McYDCK7/27wQuzSDSxIn5razfohOxMrYIAdaSh+QfF8sM9dvQyPZMxcaUw7Z7hpTVr/E Fzww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787618; x=1738392418; 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=WlrfrIzuFMjHOeBtjpo3TAdP2V/LwFa19R3qLyIAfcI=; b=gFUueErmYGLKp2vpOcyYSWWenKp+eGZDvP+FkLDdtprkuRLUTa0qZRFoFAzV0wdAwa /HrLFBzxNF5HicigljM1x+zViw/m3iuPJI+U5aeciE4y9ohyZKnth0bbCoSrI9bFwi+S icPwkSrvkm96quvpDKQpVxk6KakGyZts/oJNkpKdZRdpVqficd6JpJecQHphewCnF10U 8lU6dOycHrPbYaeDc3lKT1plgpybJOtehHgf1TokKTsv0uroC7CZQJxbpQIQWjN4j4lt daFtM+5D0B+KNpsGfDuT1H6EUG9JujYbpYKOzEmqONaPtSbYD48OpCe1PtsPkvq8/wSS KdOA== X-Gm-Message-State: AOJu0YxzehSN0gnD8IwC78INKAxkqSqQk71Drv/bj3xfTWnCv/GlrBoJ wl5YzyD0TSil74jZf1ZXHmnIrylaGjpuAHkRkCwm3o/LxVtpsBaTL+QA2w== X-Gm-Gg: ASbGncuXXGD7S3SnE98y+thz3F8gt15JsYkui+llAkzolvKwWb+5y7dVOJ62Pb3+yFU 8UXOTbObehcaAKZ8poV1XTcU7UFQNnbU7tRYLCxQvv+dknY3Dz5FwAao4hzq77IYe+s+bbv6Ot3 FKzlOvf0ODm3e02QZJKOjzFHp6qJyBBl/dw4n3jJANHBoeXrofKh9w1iN0vDdqf8u5gk1e8wfpn Z8/Ii9U0kHjXI3Y3TV14wxmhOGk0YtQcHvisP5y1uXF7WBZczWGQ0YDwJJbm+EyDXyBamsb3D1f ZWAqM6mNZKPiDymD5W7rVGpQsJ264oB2RNkt8w== X-Google-Smtp-Source: AGHT+IEZzUFlXgE/K28EhfX+3mIxjRYezlqmvV/Lq2x4g8vF/n8f6qQbTSewsmeaqub1hN0g7Uxs5g== X-Received: by 2002:a05:6602:4899:b0:84f:2929:5ee0 with SMTP id ca18e2360f4ac-851b64f4bd9mr2993832239f.10.1737787617718; Fri, 24 Jan 2025 22:46:57 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:57 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 19/63] dyndbg: make proper substructs in _ddebug_info Date: Fri, 24 Jan 2025 23:45:33 -0700 Message-ID: <20250125064619.8305-20-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" struct _ddebug_info's jobs is to enapsulate the __sections of dyndbg data from the linker. The data started as a single pair of fields: descs - ref'g an array of descriptors & num_descs - counting the "pertinent" descriptors. Then classes & num_classes were added, and _ddebug_info was invented to contain the 4 fields. When class_users & num_class_users were added (earlier in this series), the easy path was to replicate functions and adapt them to work on ddebug_class_users, instead of class_maps. This worked, but made repetitive boilerplate code, leading to (other commits with) macros walking num_##{classes,class_users} to capture the repetition. To fix it better, create structs to contain start,len for vectors of all 3 objects: classmaps, class_users, and pr_debug descriptors, and adjust field-refs accordingly. Also recompose struct ddebug_table to contain a _ddebug_info (rather than repeat the contents, as before), and adjust all array-walks to use the newly contained info. This allows ridding the class* macros of the num## paste-up, and should enable further cleanups. NB: The __packed attribute on _ddebug_info and the 3 contained structs closes the holes otherwise created by the structification (which was the excuse for not doing it originally). TBD: see if this can precede other patches, to reduce churn Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- include/linux/dynamic_debug.h | 29 ++++++++--- kernel/module/main.c | 18 +++---- lib/dynamic_debug.c | 93 +++++++++++++++++------------------ 3 files changed, 74 insertions(+), 66 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 2b0c943af330..48d76a273f68 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -173,15 +173,28 @@ struct ddebug_class_user { .map =3D &(_var), \ } =20 -/* encapsulate linker provided built-in (or module) dyndbg data */ +/* + * @_ddebug_info: gathers module/builtin dyndbg_* __sections together. + * For builtins, it is used as a cursor, with the inner structs + * marking sub-vectors of the builtin __sections in DATA. + */ +struct _ddebug_descs { + struct _ddebug *start; + int len; +} __packed; +struct dd_class_maps { + struct ddebug_class_map *start; + int len; +} __packed; +struct dd_class_users { + struct ddebug_class_user *start; + int len; +} __packed; 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_descs descs; + struct dd_class_maps maps; + struct dd_class_users users; +} __packed; =20 struct ddebug_class_param { union { diff --git a/kernel/module/main.c b/kernel/module/main.c index c394a0c6e8c6..858882a1eacd 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2540,15 +2540,15 @@ static int find_module_sections(struct module *mod,= struct load_info *info) pr_warn("%s: Ignoring obsolete parameters\n", mod->name); =20 #ifdef CONFIG_DYNAMIC_DEBUG_CORE - mod->dyndbg_info.descs =3D section_objs(info, "__dyndbg", - sizeof(*mod->dyndbg_info.descs), - &mod->dyndbg_info.num_descs); - mod->dyndbg_info.classes =3D section_objs(info, "__dyndbg_classes", - sizeof(*mod->dyndbg_info.classes), - &mod->dyndbg_info.num_classes); - mod->dyndbg_info.class_users =3D section_objs(info, "__dyndbg_class_users= ", - sizeof(*mod->dyndbg_info.class_users), - &mod->dyndbg_info.num_class_users); + mod->dyndbg_info.descs.start =3D section_objs(info, "__dyndbg", + sizeof(*mod->dyndbg_info.descs.start), + &mod->dyndbg_info.descs.len); + mod->dyndbg_info.maps.start =3D section_objs(info, "__dyndbg_classes", + sizeof(*mod->dyndbg_info.maps.start), + &mod->dyndbg_info.maps.len); + mod->dyndbg_info.users.start =3D section_objs(info, "__dyndbg_class_users= ", + sizeof(*mod->dyndbg_info.users.start), + &mod->dyndbg_info.users.len); #endif =20 return 0; diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 08b6e4e7489f..067db504dd1d 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -49,10 +49,7 @@ extern struct ddebug_class_user __stop___dyndbg_class_us= ers[]; struct ddebug_table { struct list_head link; const char *mod_name; - struct _ddebug *ddebugs; - struct ddebug_class_map *classes; - struct ddebug_class_user *class_users; - unsigned int num_ddebugs, num_classes, num_class_users; + struct _ddebug_info info; }; =20 struct ddebug_query { @@ -154,8 +151,8 @@ static void vpr_info_dq(const struct ddebug_query *quer= y, const char *msg) #define vpr_dt_info(dt_p, msg_p, ...) ({ \ struct ddebug_table const *_dt =3D 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); \ + _dt->mod_name, _dt->info.descs.len, _dt->info.maps.len, \ + _dt->info.users.len); \ }) =20 /* @@ -168,8 +165,8 @@ static void vpr_info_dq(const struct ddebug_query *quer= y, const char *msg) * @_vec: name of a sub-struct member in _box, with array-ref and length */ #define for_subvec(_i, _sp, _box, _vec) \ - for ((_i) =3D 0, (_sp) =3D (_box)->_vec; \ - (_i) < (_box)->num_##_vec; \ + for ((_i) =3D 0, (_sp) =3D (_box)->_vec.start; \ + (_i) < (_box)->_vec.len; \ (_i)++, (_sp)++) =20 static int ddebug_find_valid_class(struct ddebug_table const *dt, const ch= ar *class_string) @@ -178,14 +175,14 @@ static int ddebug_find_valid_class(struct ddebug_tabl= e const *dt, const char *cl struct ddebug_class_user *cli; int i, idx; =20 - for_subvec(i, map, dt, classes) { + for_subvec(i, map, &dt->info, maps) { idx =3D match_string(map->class_names, map->length, class_string); if (idx >=3D 0) { vpr_dt_info(dt, "good-class: %s.%s ", map->mod_name, class_string); return idx + map->base; } } - for_subvec(i, cli, dt, class_users) { + for_subvec(i, cli, &dt->info, users) { idx =3D match_string(cli->map->class_names, cli->map->length, class_stri= ng); if (idx >=3D 0) { vpr_dt_info(dt, "class-ref: %s -> %s.%s ", @@ -229,8 +226,8 @@ static int ddebug_change(const struct ddebug_query *que= ry, struct flag_settings valid_class =3D _DPRINTK_CLASS_DFLT; } =20 - for (i =3D 0; i < dt->num_ddebugs; i++) { - struct _ddebug *dp =3D &dt->ddebugs[i]; + for (i =3D 0; i < dt->info.descs.len; i++) { + struct _ddebug *dp =3D &dt->info.descs.start[i]; =20 /* match site against query-class */ if (dp->class_id !=3D valid_class) @@ -990,8 +987,8 @@ static struct _ddebug *ddebug_iter_first(struct ddebug_= iter *iter) } iter->table =3D list_entry(ddebug_tables.next, struct ddebug_table, link); - iter->idx =3D iter->table->num_ddebugs; - return &iter->table->ddebugs[--iter->idx]; + iter->idx =3D iter->table->info.descs.len; + return &iter->table->info.descs.start[--iter->idx]; } =20 /* @@ -1012,10 +1009,10 @@ static struct _ddebug *ddebug_iter_next(struct ddeb= ug_iter *iter) } iter->table =3D list_entry(iter->table->link.next, struct ddebug_table, link); - iter->idx =3D iter->table->num_ddebugs; + iter->idx =3D iter->table->info.descs.len; --iter->idx; } - return &iter->table->ddebugs[iter->idx]; + return &iter->table->info.descs.start[iter->idx]; } =20 /* @@ -1064,15 +1061,15 @@ static void *ddebug_proc_next(struct seq_file *m, v= oid *p, loff_t *pos) =20 static const char *ddebug_class_name(struct ddebug_table *dt, struct _ddeb= ug *dp) { - struct ddebug_class_map *map =3D dt->classes; - struct ddebug_class_user *cli =3D dt->class_users; + struct ddebug_class_map *map; + struct ddebug_class_user *cli; int i; =20 - for (i =3D 0; i < dt->num_classes; i++, map++) + for_subvec(i, map, &dt->info, maps) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; =20 - for (i =3D 0; i < dt->num_class_users; i++, cli++) + for_subvec(i, cli, &dt->info, users) if (class_in_range(dp->class_id, cli->map)) return cli->map->class_names[dp->class_id - cli->map->base]; =20 @@ -1203,8 +1200,7 @@ static void ddebug_apply_params(const struct ddebug_c= lass_map *cm, const char *m =20 if (cm->mod) { vpr_cm_info(cm, "loaded classmap: %s", modnm); - /* ifdef protects the cm->mod->kp deref */ - for_subvec(i, kp, cm->mod, kp) + for (i =3D 0, kp =3D cm->mod->kp; i < cm->mod->num_kp; i++, kp++) ddebug_match_apply_kparam(kp, cm, modnm); } #endif @@ -1226,20 +1222,20 @@ static void ddebug_attach_module_classes(struct dde= bug_table *dt, struct ddebug_class_map *cm; int i, nc =3D 0; =20 - for_subvec(i, cm, di, classes) { + for_subvec(i, cm, di, maps) { if (!strcmp(cm->mod_name, dt->mod_name)) { vpr_cm_info(cm, "classes[%d]:", i); if (!nc++) - dt->classes =3D cm; + dt->info.maps.start =3D cm; } } if (!nc) return; =20 vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); - dt->num_classes =3D nc; + dt->info.maps.len =3D nc; =20 - for_subvec(i, cm, dt, classes) + for_subvec(i, cm, &dt->info, maps) ddebug_apply_params(cm, cm->mod_name); } =20 @@ -1259,23 +1255,23 @@ static void ddebug_attach_user_module_classes(struc= t ddebug_table *dt, * module's refs, save to dt. For loadables, this is the * whole array. */ - for_subvec(i, cli, di, class_users) { + for_subvec(i, cli, di, users) { if (WARN_ON_ONCE(!cli || !cli->map || !cli->mod_name)) continue; if (!strcmp(cli->mod_name, dt->mod_name)) { vpr_cm_info(cli->map, "class_ref[%d] %s -> %s", i, cli->mod_name, cli->map->mod_name); if (!nc++) - dt->class_users =3D cli; + dt->info.users.start =3D cli; } } if (!nc) return; =20 - dt->num_class_users =3D nc; + dt->info.users.len =3D nc; =20 /* now iterate dt */ - for_subvec(i, cli, di, class_users) + for_subvec(i, cli, di, users) ddebug_apply_params(cli->map, cli->mod_name); =20 vpr_dt_info(dt, "attach-client-module: "); @@ -1291,10 +1287,10 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) struct _ddebug *iter; int i, class_ct =3D 0; =20 - if (!di->num_descs) + if (!di->descs.len) return 0; =20 - v3pr_info("add-module: %s %d sites\n", modname, di->num_descs); + v3pr_info("add-module: %s %d sites\n", modname, di->descs.len); =20 dt =3D kzalloc(sizeof(*dt), GFP_KERNEL); if (dt =3D=3D NULL) { @@ -1308,8 +1304,7 @@ static int ddebug_add_module(struct _ddebug_info *di,= const char *modname) * this struct ddebug_table. */ dt->mod_name =3D modname; - dt->ddebugs =3D di->descs; - dt->num_ddebugs =3D di->num_descs; + dt->info.descs =3D di->descs; =20 INIT_LIST_HEAD(&dt->link); =20 @@ -1317,17 +1312,17 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) if (iter->class_id !=3D _DPRINTK_CLASS_DFLT) class_ct++; =20 - if (class_ct && di->num_classes) + if (class_ct && di->maps.len) ddebug_attach_module_classes(dt, di); =20 mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); =20 - if (class_ct && di->num_class_users) + if (class_ct && di->users.len) ddebug_attach_user_module_classes(dt, di); =20 - vpr_info("%3u debug prints in module %s\n", di->num_descs, modname); + vpr_info("%3u debug prints in module %s\n", di->descs.len, modname); return 0; } =20 @@ -1474,12 +1469,12 @@ static int __init dynamic_debug_init(void) char *cmdline; =20 struct _ddebug_info di =3D { - .descs =3D __start___dyndbg, - .classes =3D __start___dyndbg_classes, - .class_users =3D __start___dyndbg_class_users, - .num_descs =3D __stop___dyndbg - __start___dyndbg, - .num_classes =3D __stop___dyndbg_classes - __start___dyndbg_classes, - .num_class_users =3D __stop___dyndbg_class_users - __start___dyndbg_clas= s_users, + .descs.start =3D __start___dyndbg, + .maps.start =3D __start___dyndbg_classes, + .users.start =3D __start___dyndbg_class_users, + .descs.len =3D __stop___dyndbg - __start___dyndbg, + .maps.len =3D __stop___dyndbg_classes - __start___dyndbg_classes, + .users.len =3D __stop___dyndbg_class_users - __start___dyndbg_class_user= s, }; =20 #ifdef CONFIG_MODULES @@ -1508,8 +1503,8 @@ static int __init dynamic_debug_init(void) =20 if (strcmp(modname, iter->modname)) { mod_ct++; - di.num_descs =3D mod_sites; - di.descs =3D iter_mod_start; + di.descs.len =3D mod_sites; + di.descs.start =3D iter_mod_start; ret =3D ddebug_add_module(&di, modname); if (ret) goto out_err; @@ -1519,8 +1514,8 @@ static int __init dynamic_debug_init(void) iter_mod_start =3D iter; } } - di.num_descs =3D mod_sites; - di.descs =3D iter_mod_start; + di.descs.len =3D mod_sites; + di.descs.start =3D iter_mod_start; ret =3D ddebug_add_module(&di, modname); if (ret) goto out_err; @@ -1530,8 +1525,8 @@ static int __init dynamic_debug_init(void) i, mod_ct, (int)((mod_ct * sizeof(struct ddebug_table)) >> 10), (int)((i * sizeof(struct _ddebug)) >> 10)); =20 - if (di.num_classes) - v2pr_info(" %d builtin ddebug class-maps\n", di.num_classes); + if (di.maps.len) + v2pr_info(" %d builtin ddebug class-maps\n", di.maps.len); =20 /* now that ddebug tables are loaded, process all boot args * again to find and activate queries given in dyndbg params. --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E94E0207DEA for ; Sat, 25 Jan 2025 06:46:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787621; cv=none; b=ZKYq/ia7lPcsTYxhTWriY/juuMsuXT7n8WHiAydiS0kx4o1bmejBow60lEtJs2z1+ZWx+BtFU/K7+G7pC9ucvxgK+On2S8DX2r1lX/HCDAAHaWEM5lrSraS6EEiCnFj+S4ADZQ3craMvQdRlrFH+rrtzin7gucJ9LtwwNzusmUo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787621; c=relaxed/simple; bh=29B4VO048y6EFRoFiAtHkZj4lK5/0PhDBhKsvpFRSiU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PGPLS5izcJpDAB0aYi80rgNJO/t8gPTaEMR+uDmUN6Hk2eq4Lb3cPhTr6a9IP0kvc4DhK6BLZlMesesl/5QtD23e6+r8rHBUik3nJjs/b3xA+jKcaRIiKOqxjHZBI1tdL+zocTHqkLZ8I8K+8uZ49QQLbwpUWE7apVH4VaXfGPs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=F9MZipVp; arc=none smtp.client-ip=209.85.166.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F9MZipVp" Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-3cf8c7b2dd5so8338915ab.0 for ; Fri, 24 Jan 2025 22:46:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787619; x=1738392419; darn=vger.kernel.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=AnDsc2vkEgs5Pp7pnDF60W8zrCwME0cZq6yzmPBvEV8=; b=F9MZipVpv5Y+BrpRPE9Cs6Ww7acGg7f0YSkjkBlztaMFR3RqxV6fpVCOcJVvw1qngJ wgNIuCLtlA8DabqtAMHhcXQU4lS9uyNZo5/g4EPpGcfGkihkxbgCoknRdL6Wjc+qlrpv OEZ23dMgkKu50RzH71iAwdmlkFJ9I2eDM+cg2as7GVcfN4bKCJrFfCWleymcaRZHHAPG KA+1iCtCHq2E70R9k0xPqT5lxbbjZI/NhE9GsR8UK8cR1OBuHgjytHa8YYRmUpghfLY1 c1bHZOfSkeSzxPj8ZJs6o25zcxG51ONaRWGP1CryaL7GF3a8kC18/KnU+TWMSfJsraBp 9Eiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787619; x=1738392419; 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=AnDsc2vkEgs5Pp7pnDF60W8zrCwME0cZq6yzmPBvEV8=; b=o9Pw0AMJYlalpLx3Ieh0okCs6dxUF1RNwSSkSV2T4mIPMOvT0EYfDk5EM2d12q5OHj YUQkbOyqpj5vAHKr3c2ACrrTdybOao8C+OYu+8ps08xLzO/1otya+VZ/GtJkeEXFknCs m+HsCOCIN+dTb99+C3q1wMxwSw4hT+Annw3dzZzeNnYs1lk0IxgMWMSyrTZOJ+Kompt3 r6wKos1+mGWlzQ6IqmcugX9WGr8egXMDmy26Tc6ugcmK7uPJ0zs3sSEdE0wnfxZdWRbt KInjtBveC4ZJqO8oFqcXSvKOBj/Y/twErax12dD2Ec2B3VZKdtA1XAQ9qKL2t6pf5ykr +KMQ== X-Gm-Message-State: AOJu0YxUMROWDnNA/jYZVSU76io/3+BsttML6GtTXlBwiQZT0rTIGtzm XiMkkEjncNfNvfdOngLoqosSBbDdyOYVAQdkunH87Re1kVuNmG40ug2eyQ== X-Gm-Gg: ASbGncufX2LV341pRhI0l+FcmP3q2b+hN4T9mU15/0BgPt/Wh6dZw2ynHyNdPwc3DLR 4UCIG7QZYvK2TxxJ2EMcnT9hUX78n8YL3MYlSUudHhgNbv20IzJtJ0o6MHQ8FyvGNEi+wTF5v5R urzBQTljglZLcJlpgHPUeNcV1zR+sCUQ8bdDRLNrH1f1hA6K9tohKKZgqO6rXxsNBYTXRxOdbNk 79xk5sPYLx4jaqfC6hR2OAgAaVbTcPDEkdnmCexeso4Z44hGDuYH5404F3XSq2c9Np4kixMYkbB K3Yk0xvdePKoskGyezObpUnQKxS9nJVnaH1lcl1veU4tk+fC X-Google-Smtp-Source: AGHT+IFuXVplZTOidf6+FbrRWr0dJRuZPWucGNDLvhwgjrSV8lGvzy/PXtUkpXLhq4PmLDOpeMhA0A== X-Received: by 2002:a05:6602:3c3:b0:84a:78ff:1247 with SMTP id ca18e2360f4ac-851b6286c35mr3044417339f.9.1737787618790; Fri, 24 Jan 2025 22:46:58 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:58 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 20/63] dyndbg: drop premature optimization in ddebug_add_module Date: Fri, 24 Jan 2025 23:45:34 -0700 Message-ID: <20250125064619.8305-21-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The class_ct var was added to avoid 2 function calls, but to do this it loops over all the module's debug callsites to determine the count. But it doesn't really help, so remove it. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- lib/dynamic_debug.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 067db504dd1d..16c9b752822b 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1284,8 +1284,6 @@ static void ddebug_attach_user_module_classes(struct = ddebug_table *dt, static int ddebug_add_module(struct _ddebug_info *di, const char *modname) { struct ddebug_table *dt; - struct _ddebug *iter; - int i, class_ct =3D 0; =20 if (!di->descs.len) return 0; @@ -1308,18 +1306,14 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) =20 INIT_LIST_HEAD(&dt->link); =20 - for_subvec(i, iter, di, descs) - if (iter->class_id !=3D _DPRINTK_CLASS_DFLT) - class_ct++; - - if (class_ct && di->maps.len) + if (di->maps.len) ddebug_attach_module_classes(dt, di); =20 mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); =20 - if (class_ct && di->users.len) + if (di->users.len) ddebug_attach_user_module_classes(dt, di); =20 vpr_info("%3u debug prints in module %s\n", di->descs.len, modname); --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2891120AF81 for ; Sat, 25 Jan 2025 06:47:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787623; cv=none; b=nRuPGw1RE5j7UEqq7D7wBiJEKnWf8PgpIoOYqSfE60hDpMAoDKIkB5cTQDkBInsllgzn0cHcKsVqJcai+ws+yU0bTSWQMIq63E8++IdQKbDcyHlGKhvntxR2Gn8OqpIFRJoY0fukwZ1igySpO2PB0mKfe41ouzb4w5Y005R8Alg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787623; c=relaxed/simple; bh=FMlJ+JzPn9xGOeHyTNTElXiVZaT9icUROFFv+NpRJlo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fGqCphMDfBs6X9+WWhqPasgKCW90NhixUX9DwQ8vnKiaOn13NKpkakxvxxPzgsyQp0lBRBEW/33Cg799lykICc94DHoQ0VXLMwr+/XAN5uV9AicDHkG9o9Hhovp9+odDbHLcNdRPyQXnE6gNgPCdWB5gBffX4D8KnAqdapkOeiE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Euttt2Cq; arc=none smtp.client-ip=209.85.166.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Euttt2Cq" Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-844de072603so202523739f.0 for ; Fri, 24 Jan 2025 22:47:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787620; x=1738392420; darn=vger.kernel.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=Ytfh/zV61l1ce+ov8of55te3rHqgM7GRb4D7c2dE0nI=; b=Euttt2CqoLWbewiYeWgjIaxt7owHf6vph+D6IYDzahJKCPY87LWw9smW/JAt6FdiO7 ZAcK9mSynNFn5EN4tYAxhNOvIy/xjdTWnhZ7Cj5JmREiBPuVJD1jzX9H5FmM4mI58pFM dKX5z/WmHqXsxDRgBuD+86c4CgUTPrpd3kx5E5/WA3ZVAW3/2+kapCPUt0VC9gManYtf J3TjtDMc2rcoaeosxjzT4W5t/AuD+8MMsIgzkfKud56jyxQ62HMJ1miaps/Q8v8kB19Q 6sr8xMMakhb847gg27PYWdxsywWtCKn3PwMTRt6g4kMR0x/4MXA2gxaWKJkLUmbFvO+W Jdgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787620; x=1738392420; 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=Ytfh/zV61l1ce+ov8of55te3rHqgM7GRb4D7c2dE0nI=; b=j+bMDYSd+0LrjQgLWWk5H6Y2SfgDbzfBC3lkMpoAjZsdYsnDdr/IQJK8OWe1ennMkh EYOVRL0nWqOnkQOL0uyqD+vJ+nwiGmuzGKmwJ55dOxRu6Z6EOlvakLkFud84O7wQv8nj Ur7VbVzfL3bMy1X+tv73EDoPaExPuc9aSN895DC/kth6ONnr2Wp7jAD5aaVhEkm1l7rx Y6wB91Ky83ng6OuSpGkDS1bTHJp+oHUsBgWG6DA3NlmtD4nnbkl0I6nKuqDMbODHg06n coCGkjSrlQFvJxkcH1KP6qL6AaajHbUNZxf8umcCVaahFPhHEN655NwHA3zejHtmLv5v 0vPA== X-Gm-Message-State: AOJu0Yx9suU9W893yE6YHL/QIwJU5NbdJHkxVzlEXM68S6KdfYF4awTg YSZ1SQ/0Ypi5plOyGnCOupjezahMiO5Fnw1iv99cLyFP51RB7lN+sfQZog== X-Gm-Gg: ASbGncvFO6QyYmrOmN6TbnAXjTrIkjMlf51luSnrcxNfl7JAQ0bCg1buqTOK+aHb7/H eqgTIuUwsMjjojCFdW4RapA6OBbOhyLePi+i2yjkJNW+MUXfbmnQi2PJYA1pfPbacjYPPSUw0Vh 8sRBGL1oRq+lBL7sxDrAFLpYkvQ4DqkjiXv3ikJDhVJtuNrXoVsFwr+jFlgkEUTwvq2outHP2iK pvEKuJYn1dquFcSF1j7hKGNIfOedm5IOPoyMPqQq0WxqiFQLfsLXdhRahpo7b7b+NzzvQXvGkjp 7Q0Zmw5/wE+O07RqzvnnO0dw9ZvWGnF+7jglPw== X-Google-Smtp-Source: AGHT+IHZ0rdC7Vd9cUI1tPpIx5JlT8FFJWJY2x9dHWb5lEPIqHartZYwqQohH5tAwYTKxuzcgozcpw== X-Received: by 2002:a05:6602:26c5:b0:83b:5221:2a87 with SMTP id ca18e2360f4ac-851b616986dmr3118385239f.3.1737787619986; Fri, 24 Jan 2025 22:46:59 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:59 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 21/63] dyndbg: allow ddebug_add_module to fail Date: Fri, 24 Jan 2025 23:45:35 -0700 Message-ID: <20250125064619.8305-22-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" To prep for failing modprobe on classid conflicts, upgrade the call-chain around ddebug_add_module(), in 2 ways: 1. in ddebug_add_module() add local reserved_ids to accumulate reservations, pass it by ref to ddebug_attach_{,user_}module_classes() so they can examine the reservations as they work. 2. return int from both ddebug_attach_{,user_}module_classes(), up to ddebug_add_module(), then to ddebug_module_notify(). No conflicts are currently detected or returned. TBD: This is updated further by hoisting the reservation-check, which obsoletes part of 2, creating churn, maybe squash it away. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- lib/dynamic_debug.c | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 16c9b752822b..0ef243e30663 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1216,8 +1216,9 @@ static void ddebug_apply_params(const struct ddebug_c= lass_map *cm, const char *m * 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, - const struct _ddebug_info *di) +static int ddebug_attach_module_classes(struct ddebug_table *dt, + const struct _ddebug_info *di, + u64 *reserved_ids) { struct ddebug_class_map *cm; int i, nc =3D 0; @@ -1230,13 +1231,14 @@ static void ddebug_attach_module_classes(struct dde= bug_table *dt, } } if (!nc) - return; + return 0; =20 vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); dt->info.maps.len =3D nc; =20 for_subvec(i, cm, &dt->info, maps) ddebug_apply_params(cm, cm->mod_name); + return 0; } =20 /* @@ -1244,8 +1246,9 @@ static void ddebug_attach_module_classes(struct ddebu= g_table *dt, * 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) +static int ddebug_attach_user_module_classes(struct ddebug_table *dt, + const struct _ddebug_info *di, + u64 *reserved_ids) { struct ddebug_class_user *cli; int i, nc =3D 0; @@ -1266,7 +1269,7 @@ static void ddebug_attach_user_module_classes(struct = ddebug_table *dt, } } if (!nc) - return; + return 0; =20 dt->info.users.len =3D nc; =20 @@ -1275,6 +1278,7 @@ static void ddebug_attach_user_module_classes(struct = ddebug_table *dt, ddebug_apply_params(cli->map, cli->mod_name); =20 vpr_dt_info(dt, "attach-client-module: "); + return 0; } =20 /* @@ -1284,6 +1288,8 @@ static void ddebug_attach_user_module_classes(struct = ddebug_table *dt, static int ddebug_add_module(struct _ddebug_info *di, const char *modname) { struct ddebug_table *dt; + u64 reserved_ids =3D 0; + int rc; =20 if (!di->descs.len) return 0; @@ -1306,16 +1312,23 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) =20 INIT_LIST_HEAD(&dt->link); =20 - if (di->maps.len) - ddebug_attach_module_classes(dt, di); - + if (di->maps.len) { + rc =3D ddebug_attach_module_classes(dt, di, &reserved_ids); + if (rc) { + kfree(dt); + return rc; + } + } mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); =20 - if (di->users.len) - ddebug_attach_user_module_classes(dt, di); =20 + if (di->users.len) { + rc =3D ddebug_attach_user_module_classes(dt, di, &reserved_ids); + if (rc) + return rc; + } vpr_info("%3u debug prints in module %s\n", di->descs.len, modname); return 0; } @@ -1400,6 +1413,11 @@ static int ddebug_module_notify(struct notifier_bloc= k *self, unsigned long val, switch (val) { case MODULE_STATE_COMING: ret =3D ddebug_add_module(&mod->dyndbg_info, mod->name); + if (ret =3D=3D -EINVAL) { + pr_err("conflicting dyndbg-classmap reservations\n"); + ddebug_remove_module(mod->name); + break; + } if (ret) WARN(1, "Failed to allocate memory: dyndbg may not work properly.\n"); break; --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E2E120AF8F for ; Sat, 25 Jan 2025 06:47:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787623; cv=none; b=jhB4OYhYoHH64a5WNaqC3JzYeV1Ga74naFHU0VF3kgrkS56YA1UUafdF2e7PaBCXL3xz0AV2jJvehh/NJjKzYF184AN/pFnIrhpIWPNqUJ4hpopBEA6YuyqGFckFlbmUOw30JzgBE6qZXK0rfkpnpcgntI0OwUsXSyAZLsSIIwo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787623; c=relaxed/simple; bh=igIOyXsIVjERhgcOda2PMIdzCblmuTSjD0tS0IWV7mg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Epmn7jUiB5nYlI+qFSXDYspKthHLFGEdlmzwGTPn5lWL3DPTQi/PBcmOniqF0uCwCNz8OH63XiHNj0RIKN0jd/CKoXA9i4K8SzDMQKrAt4/tpxzRyWG/1theX4SdBbOQJTty8EtXgBAZSiyMcakr4BY5CMCyERqfsco0cihodKg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=X9EFJIPd; arc=none smtp.client-ip=209.85.166.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X9EFJIPd" Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-844eb33827eso78307839f.2 for ; Fri, 24 Jan 2025 22:47:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787621; x=1738392421; darn=vger.kernel.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=Ke4SvBesy7HOPaleQwpGGG+LJLBeY9FJV6nhVnr7e/A=; b=X9EFJIPd2yiYOJ+vHgnzfu4C+X4DD3l1Kpj45LLfzdRbxbbd6UJPfowHmqSHvZVNze OGyKqFK6j1MgEfd8TVcWGEBGW5v15Slqv2uPTFNzIl9dUmh2I/EEAOEeayXiBy5i+ozb mpTka8hdI9QO2dUMzswKhTn3+9KItWu06alF4y8s23++x/IRXgrvUcRjVQ4kyVWtvOMK oEh5WrffOwGuNEZ8+bIqJOds+/m7coBwT2mQaLuEItlK2kCeT55OJIrr24V9WR9qEYk8 bzbAw4AqK1hQ7gFKUKDwwwzf4p3qqMznp1qnQ0JHTfsitLWMlYHkdOg1zWumhU4o267w E00w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787621; x=1738392421; 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=Ke4SvBesy7HOPaleQwpGGG+LJLBeY9FJV6nhVnr7e/A=; b=pZHRCKFL0h4vwl7n4ZY4QHcOB04v2tTuan7ZfN76ExkT/SP2WfxLAsnk9XEK7LgYlp G/hxuLin/KheRThpNbzmw7h9OcptZL7m+DWQ5nuEBQpVB95vLlqoPAi1BryhG7Ho6M1+ lpQKDL46mYG22axd6MDIHdXYPawrl9p3Ienq2f+1vRsQbKnmX6GIu613qhnBSLmZKr50 XAWMsGpE37WM7ieYyb25Xnz/NuGzj/hECdeuuXrIwcyrXLasnR1Y6TWkK6HNAMtu2Nvc 7KPPFH0cBIB9awmrMu/NjIIKFe9QQ8DuBxWupCQoHFo+PByOdVk2/Rraa4RqQi6U+87P qmIg== X-Gm-Message-State: AOJu0YzK5+/i0GEOf63Ld6JyduIW5qzRPGG3NJ/SMET01DbVn1skeczK nt2fmL3DaNljVFiX12+Amq9AKuFr7x3APWY9fjQ/GWKzZrgoXqyFtpszug== X-Gm-Gg: ASbGnctizsKnxAkbb3u2/fKofLaiD5EGPfCkckmULMCbVsXc1BPG4GaHOOsFFk/Lyjv 2XqYa77GKEFsDJ0cb5e8+AkO++PTgLq65B3ClfWqVDR7WDse2SBsK4tZQTw4R5yekMGca+672pT 3VmXamWa+ihxcXUkiPSoj3JDWos+IbigztOk4WWC1rX5UL4YDKjpY0PWzErlWSrCFkb/S+Ga4fM SMacN8XeU4hH8KCI7GKSnBjl2Nia7x/YsbUEHr1o4XeTfhDql27y7N1aleXPjIU+fXCjmXoMnFh PIciV8axbC1Jmf6Po0d7B8B/wzpHnrWVTAaJuQ== X-Google-Smtp-Source: AGHT+IHEFU3echceWmiA4eLPNghqGqyfiHEPHKsu8QESTZXaHS27iWJhMF9tECXmhlWc+hFhQTlaGQ== X-Received: by 2002:a05:6602:3a8b:b0:84a:51e2:9f93 with SMTP id ca18e2360f4ac-851b6285d20mr2848702339f.9.1737787620929; Fri, 24 Jan 2025 22:47:00 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:00 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 22/63] dyndbg: rework ddebug_attach_*module_classes() Date: Fri, 24 Jan 2025 23:45:36 -0700 Message-ID: <20250125064619.8305-23-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" These 2 fns both start with a codeblock which cleans up the classmaps arrays, finding the few that pertain to the module being added. Reduce this repetition to a macro: dd_mark_vector_subrange() and call it 2x. This macro finds the matching-on-modname subrange of a linker ordered array of builtin classmaps/users, and saves the subrange into the dt/debug-table's ddebug-info record. Then hoist those calls from ddebug_attach*() up to ddebug_add_module(). This puts the "cleanup" of class* arrays into ddebug_add_module(), not cluttering the original purpose of the 2 routines. And with ddebug_add_module() now updating dt with the classmaps for the module, the di arg to ddebug_attach_{,user}module_classes() is no longer needed, so drop it. Finally, rename the 2 functions, from *attach* (describing the dt update in the macro) to module_apply_class_{maps,users} to reflect the tighter focus. NB: The macro's main purpose is to handle multiple builtin classmaps or users, which is the only circumstance where less than the full array of classmaps is pertinent. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- --- lib/dynamic_debug.c | 104 ++++++++++++++++++++------------------------ 1 file changed, 48 insertions(+), 56 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 0ef243e30663..8afcd4111531 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1212,72 +1212,54 @@ static void ddebug_apply_params(const struct ddebug= _class_map *cm, const char *m } =20 /* - * 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. + * scan the named array: @_vec, ref'd from inside @_box, for the + * start,len of the sub-array of elements matching on ->mod_name; + * remember them in _dst. Macro depends upon the fields being in both + * _box and _dst. + * @_i: caller provided counter var. + * @_sp: cursor into @_vec. + * @_box: ptr to a struct with @_vec, num__##@_vec, mod_name fields. + * @_vec: name of ref into array[T] of builtin/modular __section data. + * @_dst: ptr to struct with @_vec and num__##@_vec fields, both updated. */ -static int ddebug_attach_module_classes(struct ddebug_table *dt, - const struct _ddebug_info *di, - u64 *reserved_ids) +#define dd_mark_vector_subrange(_i, _dst, _sp, _box, _vec) ({ \ + int nc =3D 0; \ + for_subvec(_i, _sp, _box, _vec) { \ + if (!strcmp((_sp)->mod_name, (_dst)->mod_name)) { \ + if (!nc++) \ + (_dst)->info._vec.start =3D (_sp); \ + } else { \ + if (nc) \ + break; /* end of consecutive matches */ \ + } \ + } \ + (_dst)->info._vec.len =3D nc; \ +}) + +static int ddebug_module_apply_class_maps(struct ddebug_table *dt, + u64 *reserved_ids) { struct ddebug_class_map *cm; - int i, nc =3D 0; - - for_subvec(i, cm, di, maps) { - if (!strcmp(cm->mod_name, dt->mod_name)) { - vpr_cm_info(cm, "classes[%d]:", i); - if (!nc++) - dt->info.maps.start =3D cm; - } - } - if (!nc) - return 0; - - vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); - dt->info.maps.len =3D nc; + int i; =20 for_subvec(i, cm, &dt->info, maps) ddebug_apply_params(cm, cm->mod_name); + + vpr_info("module:%s attached %d classmaps\n", dt->mod_name, dt->info.maps= .len); return 0; } =20 -/* - * 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 int ddebug_attach_user_module_classes(struct ddebug_table *dt, - const struct _ddebug_info *di, - u64 *reserved_ids) +static int ddebug_module_apply_class_users(struct ddebug_table *dt, + u64 *reserved_ids) { struct ddebug_class_user *cli; - int i, nc =3D 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_subvec(i, cli, di, users) { - if (WARN_ON_ONCE(!cli || !cli->map || !cli->mod_name)) - continue; - if (!strcmp(cli->mod_name, dt->mod_name)) { - vpr_cm_info(cli->map, "class_ref[%d] %s -> %s", i, - cli->mod_name, cli->map->mod_name); - if (!nc++) - dt->info.users.start =3D cli; - } - } - if (!nc) - return 0; - - dt->info.users.len =3D nc; + int i; =20 /* now iterate dt */ - for_subvec(i, cli, di, users) + for_subvec(i, cli, &dt->info, users) ddebug_apply_params(cli->map, cli->mod_name); =20 - vpr_dt_info(dt, "attach-client-module: "); + vpr_info("module:%s attached %d classmap uses\n", dt->mod_name, dt->info.= users.len); return 0; } =20 @@ -1288,8 +1270,10 @@ static int ddebug_attach_user_module_classes(struct = ddebug_table *dt, static int ddebug_add_module(struct _ddebug_info *di, const char *modname) { struct ddebug_table *dt; + struct ddebug_class_map *cm; + struct ddebug_class_user *cli; u64 reserved_ids =3D 0; - int rc; + int rc, i; =20 if (!di->descs.len) return 0; @@ -1311,9 +1295,17 @@ static int ddebug_add_module(struct _ddebug_info *di= , const char *modname) dt->info.descs =3D di->descs; =20 INIT_LIST_HEAD(&dt->link); + /* + * for builtin modules, ddebug_init() insures that the di + * cursor marks just the module's descriptors, but it doesn't + * do so for the builtin class _maps & _users. find the + * start,len of the vectors by mod_name, save to dt. + */ + dd_mark_vector_subrange(i, dt, cm, di, maps); + dd_mark_vector_subrange(i, dt, cli, di, users); =20 - if (di->maps.len) { - rc =3D ddebug_attach_module_classes(dt, di, &reserved_ids); + if (dt->info.maps.len) { + rc =3D ddebug_module_apply_class_maps(dt, &reserved_ids); if (rc) { kfree(dt); return rc; @@ -1324,8 +1316,8 @@ static int ddebug_add_module(struct _ddebug_info *di,= const char *modname) mutex_unlock(&ddebug_lock); =20 =20 - if (di->users.len) { - rc =3D ddebug_attach_user_module_classes(dt, di, &reserved_ids); + if (dt->info.users.len) { + rc =3D ddebug_module_apply_class_users(dt, &reserved_ids); if (rc) return rc; } --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 494EE20B1E7 for ; Sat, 25 Jan 2025 06:47:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787625; cv=none; b=dediC5oE7MqjAOwEpkg+zIRVB0aHFdCeFu/pKArOp+bt+e0j6cdMKWVNg2WBPcMOqliaO4pCV5HFKPUSPSeZ55qvY6yA5ErX9NbDlv801l9LnbTktHQtHIx8ObpQGxc5CPrt6TvWhDM1kXR3xtu7u/3tU2FeEhKoy+1fGy9UtBo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787625; c=relaxed/simple; bh=KWKuzEh31Lr9/5aB+dwEOd1fkt1V3QipxzGymfsqWTg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GsAraZ08GhBy3bwOavqfAJHPNBrI7meIaL74jLVWM2MwNHlBge57rx83Hy45QryI9EFQoTmFdZL/6IYPnsj9f3GyYRPJQ2DStB0hTFTtC53/g2p5l7eAGXRzqPZ0ANH3PqY/Ls4SCWDNlVx4XYwuSvA51aaawaXsBCC3IzWvtFA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ROzJwxtN; arc=none smtp.client-ip=209.85.166.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ROzJwxtN" Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-844de072603so202525339f.0 for ; Fri, 24 Jan 2025 22:47:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787622; x=1738392422; darn=vger.kernel.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=Ay4skInVUyOhJHhfCYrUYPj/jftvwF5qPOXpqm+4U44=; b=ROzJwxtNE7b/eRs2EM1CaczP/umplqrPswFDoh5ONhci2Obd6xzGqTOUvh+6F4e3Su DVCijp0iaBGm2s80hqIX+3Oj8F/xXP3KT3KuGDCkZX0QyeD2tO7xJo/g33HQCfjVMgES ZmOifV1ls9xqb6+HIzYIZICLpaFUPJtnONLfITYrieRQWhSVHEL4DP7eVZ3jz/lqunD4 0bxIGXc2ofYVccj5LYH+0K+K6JWVOjwcGG83oBctijRgEbuPRVHewj4hUGDkjImjJApW tldKvwxvWMy6d1izoFLoGP/9IEWoTy7SBqA4otB4jb23EVH2j1Tx51i43afvaK+xNBsB Om9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787622; x=1738392422; 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=Ay4skInVUyOhJHhfCYrUYPj/jftvwF5qPOXpqm+4U44=; b=OiKN60lysfVGHv5yOo4mfNMSX+3ddKFUvIWFmuJjy8RGUW//TIra5rbcL4axgCcKYH H0DBEfUDyHc0LXQuV1S0akqpshktJjhtFJT8E+RwqjINIoYpekkCLmwi+NM8p8/nDCrN 3v3qAftAGy6epL4iPXr6BddxgxWzNDXND4/SLsWJwVliyynKSMqUIWvOE+6L9rpLU/95 bKIfDC+kroLZ56c6nxYa+p6tDgsRsgmoSGsYN5JWar48O/YdhG0wxMZOgkp3f4/J7G6V hLedOQeu0C/+7Ecoa0NQf9QTWiaVIsLMmk4Rle+IBFMlnvhCcbyWeDnguEpyn0YV+cnC IfGw== X-Gm-Message-State: AOJu0YwyajenHOgKsrgfXjbHyX6vX0/AqftRk7Unmol0SwNh9XODdflF 0UWTdcgDOE6Kz04GMXnBz4ub5a082ykpVTuCZspSKTIDwbe+/I0sFxuxLQ== X-Gm-Gg: ASbGncu4F07lxEiPT+zKcDnwToiErvVv8prDmz6DO6KI8MmpnxxyV6TnATpyc/nzDLI JqGlsCzbMT4oR4P0m9BzRgC+eMukZQoIi9WCGGIl8ERwKD2djbgzKvQ9BMunYaZZ1KW4dxQcp+8 /sL45W+Y7gCmj4ZtUfS3yO1l7x8kn8NQl6+IenNXfDPk632PJYsRkiSEZ8nUUT+b2U+wdGkM5iX +hv+j5kpi62UanGjmz00oUGAkO0YTNyFH7AZ6+xZKS27eyzfZPi9DT9Vp9eamXWTyhcgrJbvXWx QtTflE/S1imLelwTbXQUgQJpLJxiD2w95kd6CA== X-Google-Smtp-Source: AGHT+IHwnJ59B7v8sJsE0jjHjZyiOHK16NDE06hCK0yvg1ng9VyLIvAL9ptQW3TlC08SLLFiwpxM3g== X-Received: by 2002:a05:6602:36cc:b0:844:c76a:354d with SMTP id ca18e2360f4ac-851b6162856mr2762621339f.2.1737787622215; Fri, 24 Jan 2025 22:47:02 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:01 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 23/63] dyndbg: fail modprobe on ddebug_class_range_overlap() Date: Fri, 24 Jan 2025 23:45:37 -0700 Message-ID: <20250125064619.8305-24-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 1. All classes used by a module (declared DYNDBG_CLASSMAP_{DEFINE,USE} by module code) must share 0..62 class-id space; ie their respective base,+length reservations shouldn't overlap. Overlaps would lead to unintended changes in ddebug enablements. Detecting these class-id range overlaps at compile-time would be ideal but is not obvious how; failing at modprobe at least insures that the developer sees and fixes the conflict. ddebug_class_range_overlap() implements the range check, accumulating the reserved-ids as it examines each class. It probably should use bitmaps. A previous commit reworked the modprobe callchain to allow failure, now call ddebug_class_range_overlap() to check when classid conflicts happen, and signal that failure. NB: this can only happen when a module defines+uses several classmaps, TBD: failing modprobe is kinda harsh, maybe warn and proceed ? test_dynamic_debug*.ko: If built with -DFORCE_CLASSID_CONFLICT_MODPROBE, the modules get 2 bad DYNDBG_CLASS_DEFINE declarations, into parent and the _submod. These conflict with one of the good ones in the parent (D2_CORE..etc), causing the modprobe(s) to fail. TODO: do in submod only, since fail of parent prevents submod from ever trying. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- --- lib/dynamic_debug.c | 30 ++++++++++++++++++++++++------ lib/test_dynamic_debug.c | 11 ++++++++++- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 8afcd4111531..8e1e087e07c3 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1211,6 +1211,21 @@ static void ddebug_apply_params(const struct ddebug_= class_map *cm, const char *m } } =20 +static int ddebug_class_range_overlap(struct ddebug_class_map *cm, + u64 *reserved_ids) +{ + u64 range =3D (((1ULL << cm->length) - 1) << cm->base); + + if (range & *reserved_ids) { + pr_err("[%d..%d] on %s conflicts with %llx\n", cm->base, + cm->base + cm->length - 1, cm->class_names[0], + *reserved_ids); + return -EINVAL; + } + *reserved_ids |=3D range; + return 0; +} + /* * scan the named array: @_vec, ref'd from inside @_box, for the * start,len of the sub-array of elements matching on ->mod_name; @@ -1242,9 +1257,11 @@ static int ddebug_module_apply_class_maps(struct dde= bug_table *dt, struct ddebug_class_map *cm; int i; =20 - for_subvec(i, cm, &dt->info, maps) + for_subvec(i, cm, &dt->info, maps) { + if (ddebug_class_range_overlap(cm, reserved_ids)) + return -EINVAL; ddebug_apply_params(cm, cm->mod_name); - + } vpr_info("module:%s attached %d classmaps\n", dt->mod_name, dt->info.maps= .len); return 0; } @@ -1255,10 +1272,11 @@ static int ddebug_module_apply_class_users(struct d= debug_table *dt, struct ddebug_class_user *cli; int i; =20 - /* now iterate dt */ - for_subvec(i, cli, &dt->info, users) + for_subvec(i, cli, &dt->info, users) { + if (ddebug_class_range_overlap(cli->map, reserved_ids)) + return -EINVAL; ddebug_apply_params(cli->map, cli->mod_name); - + } vpr_info("module:%s attached %d classmap uses\n", dt->mod_name, dt->info.= users.len); return 0; } @@ -1311,11 +1329,11 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) return rc; } } + mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); =20 - if (dt->info.users.len) { rc =3D ddebug_module_apply_class_users(dt, &reserved_ids); if (rc) diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index b1555b0a2bb1..74b98adc4ed0 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -81,7 +81,7 @@ enum cat_disjoint_bits { D2_DRMRES }; =20 /* numeric verbosity, V2 > V1 related */ -enum cat_level_num { V0 =3D 14, V1, V2, V3, V4, V5, V6, V7 }; +enum cat_level_num { V0 =3D 16, V1, V2, V3, V4, V5, V6, V7 }; =20 /* recapitulate DRM's parent(drm.ko) <-- _submod(drivers,helpers) */ #if !defined(TEST_DYNAMIC_DEBUG_SUBMOD) @@ -90,6 +90,7 @@ enum cat_level_num { V0 =3D 14, V1, V2, V3, V4, V5, V6, V= 7 }; * 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", @@ -113,6 +114,14 @@ DYNDBG_CLASSMAP_DEFINE(map_level_num, DD_CLASS_TYPE_LE= VEL_NUM, DYNDBG_CLASSMAP_PARAM(disjoint_bits, p); DYNDBG_CLASSMAP_PARAM(level_num, p); =20 +#ifdef FORCE_CLASSID_CONFLICT_MODPROBE +/* + * Enable with -Dflag on compile to test overlapping class-id range + * detection. This should break on modprobe. + */ +DYNDBG_CLASSMAP_DEFINE(classid_range_conflict, 0, D2_CORE + 1, "D3_CORE"); +#endif + #else /* TEST_DYNAMIC_DEBUG_SUBMOD */ =20 /* --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E7E120B1FB for ; Sat, 25 Jan 2025 06:47:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787625; cv=none; b=Tb4C5eL5tEa0QNikqX5xn54AcGI8ce2Qr5vn4yIVdIYe1KKwGNf33ZhbMwLajsMGqLL3eLjIg0BQ1H87Qh50/WDbLg5NN9i8Fxg3FKsuki/JWfLTkJnPgTLvdLLgZNYC48mUgqFiQOae8+vYgjdLTmCZOw8cA+WJVpx7gc/9KGI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787625; c=relaxed/simple; bh=NxfSJjjJ23lXPS6gLCCPFKsu1Gj1wtTyjN68aeks3sk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bi1sHA2PRGjfQtDpRvf9apVfzpRDHiFTFOJEyJ3YKscuN0O+vU1aPL9xEUaeX3dH+t7gWZXQYQS5TtWO0Xkp4fZyNJ6I8iJouAJ6xtrJlWOkg7Jz0BCn8gd1ydsvpEOgna0iP0EkTnj9tJwh089NbsLesP+xCfp2QNab97B2Lsw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=X2FIvsCk; arc=none smtp.client-ip=209.85.166.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X2FIvsCk" Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-844e7bc6d84so90831739f.0 for ; Fri, 24 Jan 2025 22:47:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787623; x=1738392423; darn=vger.kernel.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=93jbq4Mgsj9Dng6wtNKkyeLZVZqBaH1mnVoaGdt6ywk=; b=X2FIvsCkdf5c5+BBPYjUVokMje4SpZYCuWELRVemmn9WzCPU5O608nFO5/t4Jbah89 o6qECrHMS0JnrjEABjU5ueaqN1Hm0oororMCQvVpmutuToB4gUeEFPsnkLnq4Bv1D+nN XuAJXyvPPLS5g9F0KAoQMi6vWt4h5CgC2PAM/23vyUU77+8JYwWQ7PcV80rby+GVZfgF SJg6GDGIxxVuNAu58RbDgtx4tMrhmDkpeirMhlvTCDoX14kYNXLFPk3dDUntOsb660Yj ckskPdTY/Rn+98tTTVefuteLqgoa2eu47cfgiC6Cq9fz4FpHcbJh8DbLgBru1/mLJ/sc EGdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787623; x=1738392423; 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=93jbq4Mgsj9Dng6wtNKkyeLZVZqBaH1mnVoaGdt6ywk=; b=ZUONdgIPaWKJ4ifmMCEjX4lsnpUeMZOCbaVGEMr26BX1lbGldnhBREscgtS5+itxi8 sIF1VtCi8jR3jvwShl5Vco3I4iSZMOZsHCyQBeR7ZA14xQ/mQ4uZIAQAklsBE0S2ImHV VGz3BLOHfztTAz8BJN8iX1oqtRdJPZKceUO4O5lR7jCQyvZsJN+4gTRCiyJbPZ1OAEB2 bM2w/dgfYxEnAxVpMa90+FHFwAmOhm9B8xWGIyAuaqxfjYiSgxVr3l06dDcoXAPN4qEk znGEjiQ6sIbSFUjEnnA9c2Oy6fFwpy6N1RufwN9jCH6d3Aby87jxEwAc4VIb0b65WQfp Cv5Q== X-Gm-Message-State: AOJu0YxIuQ7SAI0EuPle/J/zbuhuvONZR5T2nfThOKHXHOuC0+gBR4Sj 3jAPiQCvXjo7P+jmmr5mPjkiEImlh7UJnnKVSgOgL5p4p/HdEDnUzQ7K9A== X-Gm-Gg: ASbGncvQDF/t1EBHn84LnyMEuQdKwB6k+N8UZoH/Ozpz+9jnQPVNmJATeWUVqOy/43n s7HPx93q/EbB0xyRlT6uv9ZC3c23DnX4oTw1l4aQMpJrAJfecMf11s15jPuCR/vMGAQADMJrhHb tY9S0z3xIKiSywhrmiko6B0Vnt7kyCG3MU0DbVPt5CKOg0a2W7kvo9kpqbLtxvqNe0WE+cN8pTU CUuNdVodODEhmqQ0TXhV7KoqNeAlQqw5EUTemajS9nAcxyYwUKXXUv1SjSHgLEMOvjxaqqtHqwR Iszp5IG7ijfiqkVQ1jq8BytskP+9Uwc7LcrtMA== X-Google-Smtp-Source: AGHT+IEzK3tgR4ZqscbrvwKIW94h8D8rsgISbYsYpT/OLj+GuVfcmbYBQtPSq2z1B//b7y/JBkE8aQ== X-Received: by 2002:a5e:d804:0:b0:82c:ec0f:a081 with SMTP id ca18e2360f4ac-8521e32b142mr475805639f.4.1737787623209; Fri, 24 Jan 2025 22:47:03 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:02 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 24/63] dyndbg: hoist the range-overlap checks Date: Fri, 24 Jan 2025 23:45:38 -0700 Message-ID: <20250125064619.8305-25-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" hoist the classmaps range-check up to ddebug_add_module() from ddebug_module_apply_class*(). THis puts both copies of the task together, with the other semi-init work. this allows ddebug_module_apply_class*() to revert back to void return, but doesn't do that yet. this is a candidate for squashing back. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- lib/dynamic_debug.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 8e1e087e07c3..e57c05c9fb0a 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1257,11 +1257,9 @@ static int ddebug_module_apply_class_maps(struct dde= bug_table *dt, struct ddebug_class_map *cm; int i; =20 - for_subvec(i, cm, &dt->info, maps) { - if (ddebug_class_range_overlap(cm, reserved_ids)) - return -EINVAL; + for_subvec(i, cm, &dt->info, maps) ddebug_apply_params(cm, cm->mod_name); - } + vpr_info("module:%s attached %d classmaps\n", dt->mod_name, dt->info.maps= .len); return 0; } @@ -1272,11 +1270,9 @@ static int ddebug_module_apply_class_users(struct dd= ebug_table *dt, struct ddebug_class_user *cli; int i; =20 - for_subvec(i, cli, &dt->info, users) { - if (ddebug_class_range_overlap(cli->map, reserved_ids)) - return -EINVAL; + for_subvec(i, cli, &dt->info, users) ddebug_apply_params(cli->map, cli->mod_name); - } + vpr_info("module:%s attached %d classmap uses\n", dt->mod_name, dt->info.= users.len); return 0; } @@ -1322,6 +1318,13 @@ static int ddebug_add_module(struct _ddebug_info *di= , const char *modname) dd_mark_vector_subrange(i, dt, cm, di, maps); dd_mark_vector_subrange(i, dt, cli, di, users); =20 + for_subvec(i, cm, &dt->info, maps) + if (ddebug_class_range_overlap(cm, &reserved_ids)) + return -EINVAL; + for_subvec(i, cli, &dt->info, users) + if (ddebug_class_range_overlap(cli->map, &reserved_ids)) + return -EINVAL; + if (dt->info.maps.len) { rc =3D ddebug_module_apply_class_maps(dt, &reserved_ids); if (rc) { --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F37CF20CCD7 for ; Sat, 25 Jan 2025 06:47:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787628; cv=none; b=JiuWQsDxcU7Dvv6+HuikBamjtthmSKCWkAQv5i18ynRnMMyLjvF3Ua2KS3bHIvUdRPTwpbvKhk3jrp1cXRJk4FrmQspXO+9AKuRBbYuzzCy70r+ksC6SNm9EEl9f5NC8ZOLrH5QPjYYx5+Nhoc3FtHXAyeqBmlwZXjKvHiRy0z8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787628; c=relaxed/simple; bh=G7hVGXinvTc923v5wyzdYt49ISwWgSCyH6IiGqz6K6M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X3ERy8KlgnfnVfYOf2OJfaqjR4g52WmR2yadiR8fMCMsAxGmSJsdYnIOI14z2XwfemvtFfsMs+7o23uy9+CgPGk+6d0KyiFAVt6i8gyRlQNRj3id0LZTNiBDKmhdtTzGwfS/2W8u9O6IbCvYMZpsGstGUpmCU7BUGX75NcIezKs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bQG5O78E; arc=none smtp.client-ip=209.85.166.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bQG5O78E" Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-844e9b83aaaso218499339f.3 for ; Fri, 24 Jan 2025 22:47:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787626; x=1738392426; darn=vger.kernel.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=z5ZcPXriLvyDxGd2w3FWLCNh742QlHcigDxyaXJyQ/k=; b=bQG5O78EgSPBNcm8fLtyvKvP0/4FxN7ADhLqm6D9UAc4jUWLPUTtRLeE8m1oBjGGt+ ofuXZgHO991wCLuQLj0IeQBfDcAz2k6HuM3qqAxxwlI9ar5oQpwb4viWGknFBNuS8xgJ pQELhaqT1ZVQCeFp3gqCIO/H2BgioI1swxk4a9fLQZXTLYQkRF7OpzCdpc7QgLNyVuvw sEU1dIv33wf73X7MFboOreB0XdIVP82ghAzs2182xS4U6AFsNiy/fdODUW4F5beUYIB8 g3Oh7KGH5R0zY7XnE/bdn1aTeSK3n/Z870IYyTP4UXsC+qg+d4MbqwcGLjmF6OSZqnlx TfRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787626; x=1738392426; 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=z5ZcPXriLvyDxGd2w3FWLCNh742QlHcigDxyaXJyQ/k=; b=vBxft3pF5dqS59zg+gWjkQDchykIuidji2R4yGk3iq0/6QRmjZKXpmL6lbORuOX+kB GTB9OrVoas550LSfJWj7izj4vgxCzHUk0kj0X8G3Mxp0xu75aq237/up0m6jdvmHvgQR plmKGFVZAY4cU1Jet6lMzifZnvOigGHU1T8U8/n+Q+DNq3pOzMfsuedVA/9EWD+7sOqt lA5VkyVGoiXmkFzV8kVn3aCN1vIcCesDDPjE9E0Op1IPfjHNIfcoacPtGhw8UEemfoyE yvDT294K5bQ8OFXHwRTQNe1+M+I84GJFd1+LA08l2R8Dya/quWe9B0Wu5B+Cs6DWHtGZ e1jA== X-Gm-Message-State: AOJu0Yze1CQ9RQzo/IdQSJKeDEocK7DHiKfxCIhP0ouXNF1CqXjr2wwV eU0VXHgi6yWGSNhPGMFmFG3YbHEM8DInHzP44Y364UIht4CQU3cE+uRTLQ== X-Gm-Gg: ASbGncvHKx26DX5CInzs7TUXmWd9RvEYqI688jVU+ZcEwwlH/qJVaBROJIdaFbABd+R pQ2IO5XEIJCWUPn7wkZWJGMVSCeOT/GBmYqKF2W8MqUDVv1+YqSZ/EewWXnXsk2M0tbn/1CBudI fkGBWWaPNxk6V5M2hn729HK0mDeFmaE++iPcrvrKWAho8pGcwOU05UrYRZYvKg2AtRkEIbeEEiC w7DTDs8x2cQuQ98jynpQ+XMH/IpkNg+yh7+6f87eWXkExTcmrEVUworx5kHqihuZau8RETebD4F 7/eVGm0V9cWutEreugzFVYQdftYOVsQidsqe8w== X-Google-Smtp-Source: AGHT+IH7EX0Zd8kOjmd85jq7cPnyZB2Gxoa5M/XhjJ0tRWUuoKl8IDet9J12UuSAPni2ukC5wYaBbw== X-Received: by 2002:a05:6602:418a:b0:84a:7906:21e3 with SMTP id ca18e2360f4ac-851b623c48bmr2846147139f.7.1737787624348; Fri, 24 Jan 2025 22:47:04 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:03 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 25/63] ddebug: cleanup-range-overlap fails Date: Fri, 24 Jan 2025 23:45:39 -0700 Message-ID: <20250125064619.8305-26-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" add cleanup block, to handle kfree before dt is added to list. Once dt is on-list, do ddebug_remove_module to cleanup. tbd. review some more. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- lib/dynamic_debug.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index e57c05c9fb0a..781781835094 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1277,6 +1277,7 @@ static int ddebug_module_apply_class_users(struct dde= bug_table *dt, return 0; } =20 +static int ddebug_remove_module(const char *mod_name); /* * Allocate a new ddebug_table for the given module * and add it to the global list. @@ -1318,32 +1319,37 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) dd_mark_vector_subrange(i, dt, cm, di, maps); dd_mark_vector_subrange(i, dt, cli, di, users); =20 - for_subvec(i, cm, &dt->info, maps) - if (ddebug_class_range_overlap(cm, &reserved_ids)) - return -EINVAL; - for_subvec(i, cli, &dt->info, users) - if (ddebug_class_range_overlap(cli->map, &reserved_ids)) - return -EINVAL; + for_subvec(i, cm, &dt->info, maps) { + rc =3D ddebug_class_range_overlap(cm, &reserved_ids); + if (rc) + goto cleanup; + } + for_subvec(i, cli, &dt->info, users) { + rc =3D ddebug_class_range_overlap(cli->map, &reserved_ids); + if (rc) + goto cleanup; + } =20 if (dt->info.maps.len) { rc =3D ddebug_module_apply_class_maps(dt, &reserved_ids); - if (rc) { - kfree(dt); - return rc; - } + if (rc) + goto cleanup; } - mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); =20 if (dt->info.users.len) { + /* this needs to find the ref'd class on the ddebug-tables list */ rc =3D ddebug_module_apply_class_users(dt, &reserved_ids); if (rc) - return rc; + return ddebug_remove_module(dt->mod_name); } vpr_info("%3u debug prints in module %s\n", di->descs.len, modname); return 0; +cleanup: + kfree(dt); + return rc; /* tbd might conflict w notify chain */ } =20 /* helper for ddebug_dyndbg_(boot|module)_param_cb */ --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F133B20D517 for ; Sat, 25 Jan 2025 06:47:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787629; cv=none; b=NvbJwymdb1M1j7cjbMa0pAVpFMM/QKAOD30/nlgQE3LNCxCBQPtCd+++/uCESTvTD8fSAU6ZHF8R8CQS3bvhqo9onaam3mguFAHXa3Lkh+pO+UDoZn6utFg1WZd//iWCCZkvFI/1S44IZL73AgWv9xnxJKdn0Z19jpHNzE4HKl4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787629; c=relaxed/simple; bh=pr0VmzINNattEI60wJ1RFGDsny7cikuvn+AUSLWTQCg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SMsReo26GA2XNO5t72sVPRlgZR+4NDi9E3QCjzh9ZBQ9zm9mqmWtWrRejvbVXIUqXs7fBf7+D9N1oHc/s7Dj9serunwkxPsP1S2T2HDHWRvudlWX52qt4esYFp9O/0MQEpodOeswCwnlxr6ThFKDighyqR8hDy/0aVwHi2cFoYM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=R8MQsysA; arc=none smtp.client-ip=209.85.166.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="R8MQsysA" Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-3ce868498d3so8477475ab.3 for ; Fri, 24 Jan 2025 22:47:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787627; x=1738392427; darn=vger.kernel.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=K2adNnpQ1ndgxlrGpzojCmuFvxvCimDSyhOgF+7GluQ=; b=R8MQsysAi/AXupDtIPeuohJf/wAR18Ay1KnWQquxEB7b1kqzDqkqdzRZnfwVeZbraT QYajoP8fm+bgahv4XJx32j58EcyNloCoJgd/78cmH/ruQACEAcrl1u9HNu3Q0g/ztGb4 JQFK2uHYm45rxCo+1+Z8YNGCjqLzgBeDfRfFJUeS1JtnavDfyLSZBckC924pwAAhkhMi cdYUD4UsHzDYzi2eJTkzMoUqGqlVULs1fnGgtjHXj+St1/m2XjLHG1ktCpFScS1GJQSA i6K2HqwdcmuL7rFNu0uEwTmiVM6X7ptCBIJgm2BbKqse8L9lLtfzRQ8QsziJQX53D1Ss wzSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787627; x=1738392427; 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=K2adNnpQ1ndgxlrGpzojCmuFvxvCimDSyhOgF+7GluQ=; b=OacCiiXUtpw94uAfD+EWNU9i6Idxwwpoc+Up1d5uMprf89z/pwU6gzvNkXUH1Q/fTa S8pPjJnzBEF7SqiTKLaUyiPAeivuOO7vpUiRXviHdxJg9g3xqaGSll45RNR9660J+KpV Ia2Zml/l1PLksMB+PkfMzqmVsrfn7xK/lEZ5ROoXQqJoCgHf5RfFKK55sJ3CMZ438OLl ST5S6zUxW0wkYoKLucaz7tLRSzAHIuS/kWIa1et5jMJ7xfif7XJLsufuL4Pu+EJW852L +49v1uifizxNIlLs0YBy92EIcbzGqXeSWJm07y8SlumKS6a/RHUQjW9oiByvGcSjnwd6 5GMg== X-Gm-Message-State: AOJu0Yx+6UlCgCUrs5GxGOT0lukDjAyz6X/HelhJGOJLo6bkIjTRADKU v+7EWPdL8m3yOwS0D3qEoTeg9bnccDd5RlGXxVcRVa2Y1QXuVd+ri3QvTQ== X-Gm-Gg: ASbGnctFB4uCLa6b891B5b0CWrFYyrhHWShu+03qEAK2C39RYrG5OfjMm0IChzdFhky B2YVxIf1wO1OjpUpvDnBsj6ftxU1PEi9lo+u6wp/gztBrQW+HAuttZXinp3pnj1l8PJh85e03qa tztv4Fh9uK/Q1NAtx1nGSdyaDf1yjq6zjpc79/9Ok/MFmm/t6qZQLIUvpGKIzIt69n/H1vVmE76 7xo8R/vNbLGJV4VB1XQ7ZheWRBxWs1DwABHlKENwQh07eheS942KTQqDn79AgVmdTOrulu3j1bg yfTJQ1JGXqsztqQJXn0nxWiCQ0XR4RkQboRPQw== X-Google-Smtp-Source: AGHT+IFvfnXx3vIA0IygucIVFMzusww6a1v559qwPHqvKV9Wy0ZpTiWPO7TpRRif5ApEBz6kamOW3Q== X-Received: by 2002:a05:6e02:3cc2:b0:3ce:791d:7f6 with SMTP id e9e14a558f8ab-3cf74487b41mr262768565ab.16.1737787625414; Fri, 24 Jan 2025 22:47:05 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:05 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 26/63] dyndbg-test: change do_prints testpoint to accept a loopct Date: Fri, 24 Jan 2025 23:45:40 -0700 Message-ID: <20250125064619.8305-27-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" echo 1000 > /sys/module/test_dynamic_debug/parameters/do_prints This allows its use as a scriptable load generator, to generate dynamic-prefix-emits for flag combinations vs undecorated printks. This will make it easy to assess the cost of the prefixing. NB: the count is an unsigned int, and is *not* clamped currently, but probably should be. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- lib/test_dynamic_debug.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 74b98adc4ed0..5cfc156ca4bb 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -16,16 +16,24 @@ =20 /* re-gen output by reading or writing sysfs node: do_prints */ =20 -static void do_prints(void); /* device under test */ +static void do_prints(unsigned int); /* device under test */ static int param_set_do_prints(const char *instr, const struct kernel_para= m *kp) { - do_prints(); + int rc; + unsigned int ct; + + rc =3D kstrtouint(instr, 0, &ct); + if (rc) { + pr_err("expecting numeric input, using 1 instead\n"); + ct =3D 1; + } + do_prints(ct); return 0; } static int param_get_do_prints(char *buffer, const struct kernel_param *kp) { - do_prints(); - return scnprintf(buffer, PAGE_SIZE, "did do_prints\n"); + do_prints(1); + return scnprintf(buffer, PAGE_SIZE, "did 1 do_prints\n"); } static const struct kernel_param_ops param_ops_do_prints =3D { .set =3D param_set_do_prints, @@ -177,17 +185,20 @@ static void do_levels(void) prdbg(V7); } =20 -static void do_prints(void) +static void do_prints(unsigned int ct) { - pr_debug("do_prints:\n"); - do_cats(); - do_levels(); + /* maybe clamp this */ + pr_debug("do-prints %d times:\n", ct); + for (; ct; ct--) { + do_cats(); + do_levels(); + } } =20 static int __init test_dynamic_debug_init(void) { pr_debug("init start\n"); - do_prints(); + do_prints(1); pr_debug("init done\n"); return 0; } --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2284207DF8 for ; Sat, 25 Jan 2025 06:47:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787630; cv=none; b=gF3qZNv2VKAdNyVNAsmkDRl+5+B8wnzvp1hukNUEsctwX3znVwgozJpJqg2ObfkEtkBY7ZYJrNlhyNB29fuluFlVgsWxdrt+voLfmVUX5bI3+avDAu2nufdCggoGAhUE8F1SkMRbLma1fTBm4kC69RVS3kRFDUCmCMGabeF6KXk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787630; c=relaxed/simple; bh=1Mu03+G4QV4YtVZXqfKsBaytHxI7rfu2N7PmXDbqbUs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=npvZN/QCCmdLHi8anih+9hgSwEp2+4zOw2R4b7UYPTxnL3eh1VpMOgo5ykV2cRPESV17ewYbNouaEVRggrNL7nAapyC9KRrkw3dvgOehf+oRFg0r76v5ST6qf0K8IGO1NnUY9dGqI8jvuWW3lW5l6MIfdUXCc7iM0S+UeRtUd6k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kJ5LrUkk; arc=none smtp.client-ip=209.85.166.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kJ5LrUkk" Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-851c4ee2a37so198190839f.3 for ; Fri, 24 Jan 2025 22:47:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787627; x=1738392427; darn=vger.kernel.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=ZUFY1/p4cwMapYCElPuw4n+JFAz595e4pdu5x+kllYo=; b=kJ5LrUkkKWjWhRhOIZLtTiiwYuz70ok+Xe7gurOLBF00mequ0eX02ZdRSYTKrLzfxo Iu2sH29gqK39IpJ2VsAzdg2h5nQSaqe7DSfjMahH7RWq3OLs80MMDe71lqU3tFIL0Sng b6rK2uBJ0e2oE3EKwyDrGS6lI02xo/nT0qJVd4eF/u1skpkfc3W71CNx4wpra+LAbn/8 RWoqcNlNOyI7A57U2m9xVjzdPXP0yOh+Gs4PoCbProrHjOyxKrUsLSSSzsk7wh4IxREZ zDG+TrCnAFZB/xxmiS2H+z6baSjY2IO95rCV6ThwpJhdZK6sf/s1qhURvu92IFbEy3Rg /mSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787627; x=1738392427; 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=ZUFY1/p4cwMapYCElPuw4n+JFAz595e4pdu5x+kllYo=; b=NwhFCBlLZ8sv+Btjy1JaWALAdG1Rb96gBpTXXPQq4k3N6QF4GF8sffvQBC9obFAJZB tcbrDez6OQqkKfp8ydQsoQAcCoILFi/NLLu4hUH3m36TWq0wykLFv8Wew8dLNb7Z2eE5 Md05PDQ+9bcRsEhIVewE1oPITQAxW6EKkd8A537NaB99E6xD9ofYCF7mdrSFENjjOwFs zj4zHcVYvgcTR5iDvdgW52glnPp/q9AZc5uozOQ99OuVwFQF5JD6dB55rK9mk/6paaO/ em88upppNMqoefpjWq5gyXdTU2Kc8hT8A78X9TuiqY0R6fRmf+D2QDCkz+tdcUxme6w+ iKaw== X-Gm-Message-State: AOJu0YwZoAA7cKXNEJFtJAMwkyg9kU+DpB3hhIMMMaPhQDFYoSb78MBz pBqzvsn/hSpbT72LOHdFK4IgS6O+UxmG6v65akuxELrzprjqpPeh7EVnww== X-Gm-Gg: ASbGncsGxXIz9iQxek9xcCINgLNhZsTdDq6dlbva1RdxSox4JoEdnLbJquctTsHaxTb JwkbQDsBq5zof84hW8oCOz7fe+Qlu/+uk9u4VhqYqO2MeJB9etOEv0mggVzLAbweXuRkB1SrQxp WR7acArcLGXZg/yVEo/RbcptkX4g+FcBykUS0rv+9ol4Xn1K2cOlCIFC16wnTXDJiqnyMHtYf5Y lZZpa6MJSFD2NSqsVUjOoCwquY9Dxb+h54FhmGvopjJ4ACnAyWPVBE2ucTmY/IyouyW904uem+Q 7KeTO+rtPudn8I+9yB93gYE5bj4vuUI1tnrZEw== X-Google-Smtp-Source: AGHT+IFNi6k74yWo8JFoUX0FA2mOzPOZaMw9sxfyiZBj57HkmJfOHCUtm05G1Ba+XY1KZ2w6PJRKAA== X-Received: by 2002:a05:6602:26c5:b0:83b:5221:2a87 with SMTP id ca18e2360f4ac-851b616986dmr3118410539f.3.1737787626594; Fri, 24 Jan 2025 22:47:06 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:06 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 27/63] selftests-dyndbg: add tools/testing/selftests/dynamic_debug/* Date: Fri, 24 Jan 2025 23:45:41 -0700 Message-ID: <20250125064619.8305-28-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Add a selftest script for dynamic-debug. The config requires CONFIG_TEST_DYNAMIC_DEBUG=3Dm (and CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=3Dm), which tacitly requires either CONFIG_DYNAMIC_DEBUG=3Dy or CONFIG_DYNAMIC_DEBUG_CORE=3Dy ATM this has just basic_tests(), which modifies pr_debug flags in module params, which to handle boot args/options, must be a builtin. 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 V=3D1 -- ./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 ... [ 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=3Ddynamic_debug run_tests make[1]: ... TAP version 13 1..1 [ 35.552922] dyndbg: read 3 bytes from userspace [ 35.553099] dyndbg: query 0: "=3D_" mod:* [ 35.553544] dyndbg: processed 1 queries, with 1778 matches, 0 errs ... Signed-off-by: Jim Cromie Co-developed-by: =C5=81ukasz Bartosik Signed-off-by: =C5=81ukasz Bartosik Tested-by: Louis Chauvet --- - check KCONFIG_CONFIG to avoid silly fails 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=3Dy: 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=3Dy 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=3Dm 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=3Dm && CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=3Dm test_mod_submod() recaps the bug found in DRM-CI where drivers werent enabled by drm.debug=3D. 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=3Dy 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. --- 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 | 256 ++++++++++++++++++ 5 files changed, 269 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 38afccb3b71e..b707421229e3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8042,6 +8042,7 @@ S: Maintained F: include/linux/dynamic_debug.h F: lib/dynamic_debug.c F: lib/test_dynamic_debug*.c +F: tools/testing/selftests/dynamic_debug/* =20 DYNAMIC INTERRUPT MODERATION M: Tal Gilboa diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Mak= efile index 2401e973c359..e632f3fc97ac 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -25,6 +25,7 @@ TARGETS +=3D drivers/net/team TARGETS +=3D drivers/net/virtio_net TARGETS +=3D drivers/platform/x86/intel/ifs TARGETS +=3D dt +TARGETS +=3D dynamic_debug TARGETS +=3D efivarfs TARGETS +=3D exec TARGETS +=3D 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 :=3D dyndbg_selftest.sh + +include ../lib.mk diff --git a/tools/testing/selftests/dynamic_debug/config b/tools/testing/s= elftests/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=3Dm +CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=3Dm diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh new file mode 100755 index 000000000000..68a9046405f2 --- /dev/null +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -0,0 +1,256 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0-only + +V=3D${V:=3D0} # invoke as V=3D1 $0 for global verbose +RED=3D"\033[0;31m" +GREEN=3D"\033[0;32m" +YELLOW=3D"\033[0;33m" +BLUE=3D"\033[0;34m" +MAGENTA=3D"\033[0;35m" +CYAN=3D"\033[0;36m" +NC=3D"\033[0;0m" +error_msg=3D"" + +[ -e /proc/dynamic_debug/control ] || { + echo -e "${RED}: this test requires CONFIG_DYNAMIC_DEBUG=3Dy ${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=3D".config" +if [ -f "$KCONFIG_CONFIG" ]; then + echo "# consulting KCONFIG_CONFIG: $KCONFIG_CONFIG" + grep -q "CONFIG_DYNAMIC_DEBUG=3Dy" $KCONFIG_CONFIG ; LACK_DD_BUILTIN= =3D$? + grep -q "CONFIG_TEST_DYNAMIC_DEBUG=3Dm" $KCONFIG_CONFIG ; LACK_TMOD=3D= $? + grep -q "CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=3Dm" $KCONFIG_CONFIG ; LACK_= TMOD_SUBMOD=3D$? + 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=3D0 + LACK_TMOD=3D0 + LACK_TMOD_SUBMOD=3D0 +fi + +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=3D0 + num_args=3D$# + if [ "${@:$#}" =3D "pass" ]; then + num_args=3D$#-1 + elif [ "${@:$#}" =3D "fail" ]; then + num_args=3D$#-1 + exp_exit_code=3D1 + fi + args=3D${@:1:$num_args} + output=3D$((echo "$args" > /proc/dynamic_debug/control) 2>&1) + exit_code=3D$? + error_msg=3D$(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=3D0 + [ $# =3D=3D 4 ] && exp_exit_code=3D$4 + if [ $3 -ne $exp_exit_code ]; then + echo -e "${RED}: $BASH_SOURCE:$1 $2() expected to exit with code $= exp_exit_code" + [ $3 =3D=3D 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=3D"\s$1\s" + exp_cnt=3D0 + + [ "$3" =3D=3D "-r" ] && pattern=3D"$1" + let cnt=3D$(ddgrep "$pattern" | wc -l) + if [ $V -eq 1 ] || [ "$3" =3D=3D "-v" ] || [ "$4" =3D=3D "-v" ]; then + echo -ne "${BLUE}" && ddgrep $pattern && echo -ne "${NC}" + fi + [ $# -gt 1 ] && exp_cnt=3D$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 <=3D 0 then otherwise +# $3 - "-v" for verbose +function check_trace_instance_dir { + if [ -e /sys/kernel/tracing/instances/$1 ]; then + if [ "$3" =3D=3D "-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 instanc= e \ + '/sys/kernel/tracing/instances/$1' does exist" + exit + fi + else + if [ $2 -gt 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO error trace instanc= e \ + '/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=3D$(tail -n9 /proc/dynamic_debug/control | grep ": Opened trace= instances" \ + | xargs -n1 | grep $1) + if [ "$output" !=3D $1 ] && [ $3 -gt 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$2 trace instance $1 is not opened" + exit + fi + if [ "$output" =3D=3D $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 <= =3D 0 then otherwise +function del_trace_instance_dir() { + exp_exit_code=3D1 + [ $2 -gt 0 ] && exp_exit_code=3D0 + output=3D$((rmdir /sys/kernel/debug/tracing/instances/$1) 2>&1) + exit_code=3D$? + error_msg=3D$(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 && 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" =3D "0" ]; then + buf=3D$(cat /sys/kernel/debug/tracing/trace) + line=3D$(tail -$2 /sys/kernel/debug/tracing/trace | head -1 | sed -e = 's/^[[:space:]]*//') + else + buf=3D$(cat /sys/kernel/debug/tracing/instances/$1/trace) + line=3D$(tail -$2 /sys/kernel/debug/tracing/instances/$1/trace | head= -1 | \ + sed -e 's/^[[:space:]]*//') + fi + if [ $2 =3D 0 ]; then + # whole-buf check + output=3D$(echo $buf | grep "$3") + else + output=3D$(echo $line | grep "$3") + fi + if [ "$output" =3D "" ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO search for '$3' fai= led \ + in line '$line' or '$buf'" + exit + fi + if [ $V =3D 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" !=3D "$1" ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO error message '$error_m= sg' \ + does not match with '$1'" + exit + fi +} + +function basic_tests { + echo -e "${GREEN}# BASIC_TESTS ${NC}" + if [ $LACK_DD_BUILTIN -eq 1 ]; then + echo "SKIP" + return + fi + ddcmd =3D_ # zero everything + check_match_ct =3Dp 0 + + # module params are builtin to handle boot args + check_match_ct '\[params\]' 4 -r + ddcmd module params +mpf + check_match_ct =3Dpmf 4 + + # multi-cmd input, newline separated, with embedded comments + cat <<"EOF" > /proc/dynamic_debug/control + module params =3D_ # clear params + module params +mf # set flags + module params func parse_args +sl # other flags +EOF + check_match_ct =3Dmf 3 + check_match_ct =3Dmfsl 1 + ddcmd =3D_ +} + +tests_list=3D( + 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 --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E664820E01D for ; Sat, 25 Jan 2025 06:47:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787631; cv=none; b=e06HdmuAOjrmU3Kvl7yRT70TGLidmDR8ksr8nQMVw3FjvNv82JO1JBNpk8maJ+1mPXbNFH6wfjRcxnSHr1dPNs7JVEX27X9wnhcBPC16BAE1YEv0+ZqAsIo3qpBpCkX3ThdF9/Vgtqh7Ad8BGwa3bO6xHJfwNcCi6mq8/5/sLz4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787631; c=relaxed/simple; bh=lJcEwRBNkUP57QCi/6h0TEzKahOsLQGAqRQ9BClpTKo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TE4BwAv/twc76mxcRp8kgu/IugU+f0eVdP3vGxNuVMcxNwKOOmniXuC7JtlI2ak5nwXAWRk+RykBi+YKLcaC68GnhnHmCPmEoi6bVoISQ4ymZeNMaV8tORVCEg6YBHee/qw4yIO3iVUKFdI6AuPdOjJR4VnY1sKa3ObWFjMK01U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TPjbtfUS; arc=none smtp.client-ip=209.85.166.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TPjbtfUS" Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-844d7f81dd1so84124039f.2 for ; Fri, 24 Jan 2025 22:47:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787628; x=1738392428; darn=vger.kernel.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=bawAVjsssmFzYPdPxQZ92OM/AJ4JZgRmMv83weXIFxo=; b=TPjbtfUSUJ3/vjBEvCvkiS+6+Oz/xJQIj0K/C1oQSE1tAInX6TkY+PN6Bv/ayXGrcp SGaOdavZW/cgziRmfcJOLvxa2mjAvNbvI6+vSIA1MadXCk0SP45aYJ+gDIr4fCiz9SV4 98506/AJZFLOdyZru3YuGrFD4y2XJfxirP2yhv0Mnuei7QV5X5dsHag75gyD5cjDNl4U IPJ0lVpq9qUJn83sl78G55sSzQ5Tupy9C5fRXglg+WTfUFHGf3GrdfjP9ZVtV9Rr+bLM jpbY0PTD4WmOp4AWJuleNNWYiQvTbOzDmcfDFW1l8KboSb/GawmxjVsR+d27mzmFZB5E yeaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787628; x=1738392428; 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=bawAVjsssmFzYPdPxQZ92OM/AJ4JZgRmMv83weXIFxo=; b=f9c3ZY0KjxbhXKxLJur4wLTDm5cnGWwJ4/cf4umLeI7r/EitnkOyUO/TGp0E6KJMjc fJtqX9zmYAw3qW6CvPMbFJHKlKA57CWqMpfu0reRRZgPRc35bGjOTQqm39PleAw+FiQ4 b1aFw90/8BhXcb5zstR16W9DeAdAcEZ8ps7SRvoPWVwCF6PqHni1cFovS4zq58R3HjTG iVzyp+Ymih3f5yot6SLMKti8ISQcvg9zULPHXeQg8Wo0eHn6GE+5OyolZEZ9T5/KUm8m ct/tdWp3Wu88psjm3Bpznm75v1NhWHKeJt80osIA0zJznhKOVwfVEZ/LGlpbvv2Yf3Q1 f3lQ== X-Gm-Message-State: AOJu0YwHmwMQzdUCoe+7nxQ12sg3h1RQWEmBhxZhiLM2Wk4bxnNK9xh1 r+G29Qgal+SLu+NZVipJWkvgmCTwPnKIW0jCQme3dM6P0LaWk38CO4pHhg== X-Gm-Gg: ASbGncvCi5m8PpRNAC3NhBNw32VAFqjfqHRq1m0Chwi9V5CxvOEkYemPvai0P5G/GGY Pj7FWfc97fDSIBXtUrAevScFqGWXePmFmQPE+fpPMEXB9Dhi2JIZxcrjsgNQlykvqAWWpZDmV7A RWHmMd1YUj9BZmUZGmG4s1U8x02fj26SdaNrbi9zS8KuywaD3mFe3EzTj0TPyvGnhXk/Nvd9HGp D23hqzjMuM/z1l4DqQP54fr2+PF4qn+wOPYamUeDA/JbzhLLNotEVgHzLNuRYk0avpwDYXs6lo/ gjI0nkeMghReVVb0GoXXBEwXyRc0zBVMNVkFgA== X-Google-Smtp-Source: AGHT+IFTZA0vUP8lMnChoH2isprbJzAhqKXjoh/0GJGG53PQuggPKp+V3sgxX0Xc1O6ANPmO29WrWw== X-Received: by 2002:a05:6e02:18cf:b0:3cf:ba5:1ea3 with SMTP id e9e14a558f8ab-3cf743e59a7mr243410115ab.7.1737787627869; Fri, 24 Jan 2025 22:47:07 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:07 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 28/63] dyndbg-API: promote DYNDBG_CLASSMAP_PARAM to API Date: Fri, 24 Jan 2025 23:45:42 -0700 Message-ID: <20250125064619.8305-29-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. Modify ddebug_sync_classbits() argtype deref inside the fn, to give access to all kp members. Also clean up and improve comments in test-code, and add MODULE_DESCRIPTIONs. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- -v9 - 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 | 38 +++++++++++++++++++++ lib/dynamic_debug.c | 60 ++++++++++++++++++++++----------- lib/test_dynamic_debug.c | 59 +++++++++++++------------------- lib/test_dynamic_debug_submod.c | 9 ++++- 4 files changed, 111 insertions(+), 55 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 48d76a273f68..b47d1088b7ad 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -205,6 +205,44 @@ struct ddebug_class_param { const struct ddebug_class_map *map; }; =20 +/** + * DYNDBG_CLASSMAP_PARAM - control a ddebug-classmap from a sys-param + * @_name: sysfs node name + * @_var: name of the classmap var defining the controlled classes/bits + * @_flags: flags to be toggled, typically just 'p' + * + * Creates a sysfs-param to control the classes defined by the + * exported classmap, with bits 0..N-1 mapped to the classes named. + * This version keeps class-state in a private long int. + */ +#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 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 (exported) classmap var defining the classes/bits + * @_flags: flags to be toggled, typically just 'p' + * + * Creates a sysfs-param to control the classes defined by the + * exported clasmap, with bits 0..N-1 mapped to the classes named. + * This version keeps class-state in user @_bits. This lets drm check + * __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 =3D { \ + .bits =3D &(_bits), \ + .flags =3D #_flags, \ + .map =3D &(_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 781781835094..9283f2866415 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -660,6 +660,30 @@ static int ddebug_apply_class_bitmap(const struct ddeb= ug_class_param *dcp, =20 #define CLASSMAP_BITMASK(width) ((1UL << (width)) - 1) =20 +static void ddebug_class_param_clamp_input(unsigned long *inrep, const str= uct kernel_param *kp) +{ + const struct ddebug_class_param *dcp =3D kp->arg; + const struct ddebug_class_map *map =3D 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 &=3D 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 =3D map->length; + } + break; + } +} static int param_set_dyndbg_module_classes(const char *instr, const struct kernel_param *kp, const char *modnm) @@ -678,26 +702,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); =20 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 &=3D CLASSMAP_BITMASK(map->length); - } v2pr_info("bits:0x%lx > %s.%s\n", inrep, modnm ?: "*", KP_NAME(kp)); totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, *dcp->bits, modnm); *dcp->bits =3D 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 =3D map->length; - } old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); new_bits =3D CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); @@ -1163,15 +1176,24 @@ static const struct proc_ops proc_fops =3D { static void ddebug_sync_classbits(const struct kernel_param *kp, const cha= r *modname) { const struct ddebug_class_param *dcp =3D kp->arg; + unsigned long new_bits; =20 - /* clamp initial bitvec, mask off hi-bits */ - if (*dcp->bits & ~CLASSMAP_BITMASK(dcp->map->length)) { - *dcp->bits &=3D CLASSMAP_BITMASK(dcp->map->length); - v2pr_info("preset classbits: %lx\n", *dcp->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 =3D 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); } =20 static void ddebug_match_apply_kparam(const struct kernel_param *kp, diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 5cfc156ca4bb..32a9d49a7a3b 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 @@ -43,36 +44,21 @@ module_param_cb(do_prints, ¶m_ops_do_prints, NULL, = 0600); =20 #define CLASSMAP_BITMASK(width, base) (((1UL << (width)) - 1) << (base)) =20 -/* sysfs param wrapper, proto-API */ -#define DYNDBG_CLASSMAP_PARAM_(_model, _flags, _init) \ - static unsigned long bits_##_model =3D _init; \ - static struct ddebug_class_param _flags##_##_model =3D { \ - .bits =3D &bits_##_model, \ - .flags =3D #_flags, \ - .map =3D &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_(_mod= el, _flags, ~0) -#else -#define DYNDBG_CLASSMAP_PARAM(_model, _flags) DYNDBG_CLASSMAP_PARAM_(_mod= el, _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 - * changes) within each. + * Pair the 6 parts by type, to show the pattern of repetition and + * change within each. * - * 1st, dyndbg expects a client-provided enum-type as source of - * category/classid truth. DRM has DRM_UT_. + * 1st, dyndbg classmaps follows drm.debug convention, and expects a + * client-provided enum-type as source of category/classid truth. DRM + * gives DRM_UT_. * * Modules with multiple CLASSMAPS must have enums with distinct * value-ranges, arranged below with explicit enum_sym =3D X inits. * - * Declare all 4 enums now, for different types + * Declare the 2 enums now. */ =20 /* numeric input, independent bits */ @@ -91,12 +77,15 @@ enum cat_disjoint_bits { /* numeric verbosity, V2 > V1 related */ enum cat_level_num { V0 =3D 16, V1, V2, V3, V4, V5, V6, V7 }; =20 -/* 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. */ =20 DYNDBG_CLASSMAP_DEFINE(map_disjoint_bits, DD_CLASS_TYPE_DISJOINT_BITS, @@ -116,11 +105,12 @@ DYNDBG_CLASSMAP_DEFINE(map_level_num, DD_CLASS_TYPE_L= EVEL_NUM, V0, "V0", "V1", "V2", "V3", "V4", "V5", "V6", "V7"); =20 /* - * 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); =20 #ifdef FORCE_CLASSID_CONFLICT_MODPROBE /* @@ -131,12 +121,10 @@ DYNDBG_CLASSMAP_DEFINE(classid_range_conflict, 0, D2_= CORE + 1, "D3_CORE"); #endif =20 #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); =20 @@ -211,6 +199,7 @@ static void __exit test_dynamic_debug_exit(void) module_init(test_dynamic_debug_init); module_exit(test_dynamic_debug_exit); =20 +MODULE_DESCRIPTION("test/demonstrate dynamic-debug features"); MODULE_AUTHOR("Jim Cromie "); MODULE_DESCRIPTION("Kernel module for testing dynamic_debug"); MODULE_LICENSE("GPL"); diff --git a/lib/test_dynamic_debug_submod.c b/lib/test_dynamic_debug_submo= d.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 @@ =20 #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"); --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03C0D20E6F0; Sat, 25 Jan 2025 06:47:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787631; cv=none; b=iXn9RzgEbE6GoMWqCpCRiAIasAIJUghTmTNb4jDHKKyczR5YzFHNk9l75Iijt50atUcdBOVQ+KrxqgxXjIVDpRYedvkhdsILy0OdkHMDapIKO84QQ8X/A1RdHAGjdcPQ/uNj+m/IjT9yBDuOh17rJtFCS2xCdfNj9IZpPADn81U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787631; c=relaxed/simple; bh=JTONJC2USTo5f58QWgkJFuOhxcuaEB+Ho70IChpgJLY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AxlmNS+w04cBNIbb1VN+0Xi+Pkszfum5k1XdOh3qeNzUvac2TtKUkSjs2hYLTYTph+N2xbKlKHExZTNp5DR7PvaW+J9AEWrB0lwyV1QEcriB0uLJqkZ2biw/6I1+K10pDZTNrRayksx10N6COGLZSL76IqwKd1xQUU6G5scpl8U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EO96HUGk; arc=none smtp.client-ip=209.85.166.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EO96HUGk" Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-84cdacbc373so84590839f.1; Fri, 24 Jan 2025 22:47:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787629; x=1738392429; darn=vger.kernel.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=CxerCwCa32SuNvijTSel2H05zJGPetjkTO/3X/VldcE=; b=EO96HUGk718rt0OUt8wbXix7hdhNqtmPrrB0h3bJCrA0qm9rWpKbdtR3ZWGs5hM1PN yqp5UwMoCsqQI8uGUHh7J2UCXHGGpBprDHc1E0FTdMXqCjym7m000jeaUVewP/AH9+Y4 KPXcCiHhO4z7d+VQDKnkbb1iHNeSsgagbC624uK8K5aLeo/EPXGoGsXyVTgnC6kK6p1g NP+FV4x7gPtwJSHXG6JjivBqeBhrYqyAG7uJbfYsviFUjYR/VYwXQWL7GBl3/HH+pRps S9DMhDzaknZkVKA4VY63sGQhU6Cb2w0F8Q2DX/2mhJtTAkPzEHrpaDKLp2F8Sd00qTeR 3Zow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787629; x=1738392429; 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=CxerCwCa32SuNvijTSel2H05zJGPetjkTO/3X/VldcE=; b=n0+wNaK8SLxFdW2irBcolCfaIQqO5pMkeWzjXF7KBCpuTWoxMa8Tu/26tcp0G+L66G MamRiNUktI4dwuHBMjM+WdTEjObAWtdNgzak/T0gaB9p988iVb/KtPLrCMbvamQVvL9c 7hWvEzWqB5dr6zMk9WRoHYzWxSOuhbq33p1gkrpSi4z4/wOwgkPLb6VOBTk2yesXs3uv dBixhorBuakyq4fOFjIfzAo1E8IaW3JOu9d16SxM+pYCxnFdj22P+FofNrD2uQEWL1Ld ahk4vXbc2lHThofGLJ4v8oAXSB1BDqiC+MQG23rWsA1riOjq4Wtn6y1W2AvLTGhFbmFi gMMA== X-Forwarded-Encrypted: i=1; AJvYcCUzbDnatbqJRuL+HybA5kvCMeeCNvtFu0ph8s/fPyAseijtSUwoZCLFW/wV6qKwMpp8SMHEH5jGawQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yxb601zFh6nKQ5UqP8bK4J9clVWAytowh4o/Q/E2Juk8IH1eE+4 UrRTZTm0lMICFSgX0i9CM7duBg4BaiJui9gZ4pweexVvdxqIA41Dz9BP7w== X-Gm-Gg: ASbGncv9dEZfK6DHc6YemQQRSscAfiQ8qPjuj+sX+gAL66PE8ttzRBtOHw1sG2cGu3p oMhqPv+txICPv2grQ7sukvAlooe4zTfKPp52L8cp5vAvW4v2IT4CJ3YatJGlHiPpHBCsS3R6JDr pbGkMPDfKHcPhF53QKQVZYFmTY8zJ8/+WoUhJYUvtTuV/PN2y6jvu1XXHv3Gu2c1O2gh/gK1ciy 8WYaX+YXzPBOBQFgphRw7vWlzo+TDK0LS8kdV4Yo1iIJUvECRlUCAHMgCadTVSuEtCl78NBDjig QtkQjPlNWas04NoLQQ7bcfwlbZ3CqZn7w6ylnA== X-Google-Smtp-Source: AGHT+IFeP81OrrwZYyhERt8IWjWebpncl5LYjvFIJ2Zw2ef9M59/qZvRErXREgk6q+sIWkS/LYegPw== X-Received: by 2002:a05:6e02:16ce:b0:3a7:6566:1e8f with SMTP id e9e14a558f8ab-3cf7447bb26mr253694305ab.16.1737787628880; Fri, 24 Jan 2025 22:47:08 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:08 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie , linux-doc@vger.kernel.org Subject: [PATCH 29/63] dyndbg-doc: add classmap info to howto Date: Fri, 24 Jan 2025 23:45:43 -0700 Message-ID: <20250125064619.8305-30-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Tested-by: Louis Chauvet --- v5 adjustments per Randy Dunlap v7 checkpatch fixes v8 more v9 rewords --- .../admin-guide/dynamic-debug-howto.rst | 79 ++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index 691e0f7d4de1..391e40a510c9 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -230,7 +230,6 @@ the ``p`` flag has meaning, other flags are ignored. Note the regexp ``^[-+=3D][fslmpt_]+$`` matches a flags specification. To clear all flags at once, use ``=3D_`` or ``-fslmpt``. =20 - Debug messages during Boot Process =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 @@ -380,3 +379,81 @@ 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 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +The "class" keyword selects prdbgs based on author supplied, +domain-oriented names. This complements the nested-scope keywords: +module, file, function, line. + +The main difference from the others: class'd prdbgs must be named to +be changed. This protects them from generic overwrite: + + # IOW this cannot undo any DRM.debug settings + :#> ddcmd -p + +So each class must be enabled individually (no wildcards): + + :#> ddcmd class DRM_UT_CORE +p + :#> ddcmd class DRM_UT_KMS +p + # or more selectively + :#> ddcmd class DRM_UT_CORE module drm +p + +Or the legacy/normal (more convenient) way: + + :#> echo 0x1ff > /sys/module/drm/parameters/debug + +Dynamic Debug Classmap API +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D + +DRM.debug is built upon: + ~23 macros, all passing a DRM_UT_* constant as arg-1. + ~5000 calls to them, across drivers/gpu/drm/* + bits in /sys/module/drm/parameters/debug control all DRM_UT_* together + +The const short ints are good for optimizing compilers; a classmaps +design goal was to keep that. So basically .classid =3D=3D=3D category. + +And since prdbgs are cataloged with just a DRM_UT_* to identify them, +the "class" keyword maps known classnames to those reserved IDs, and +by explicitly requiring "class FOO" in queries, we protect FOO class'd +debugs from overwrite by generic queries. + +Its expected that other classmap users will also provide debug-macros +using an enum-defined categorization scheme like DRM's, and dyndbg can +be adapted under them similarly. + +DYNDBG_CLASSMAP_DEFINE(var,type,_base,classnames) - this maps +classnames onto class-ids starting at _base, it also maps the +names onto CLASSMAP_PARAM bits 0..N. + +DYNDBG_CLASSMAP_USE(var) - modules call this to refer to the var +_DEFINEd elsewhere (and exported). + +Classmaps are opt-in: modules invoke _DEFINE or _USE to authorize +dyndbg to update those classes. "class FOO" queries are validated +against the classes, this finds the classid to alter; classes are not +directly selectable by their classid. + +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. + +The PARAM interface also enforces the DD_CLASS_TYPE_LEVEL_NUM relation +amongst the contained classnames; all classes are independent in the +control parser itself; there is no implied meaning in names like "V4". + +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. --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF86820F978 for ; Sat, 25 Jan 2025 06:47:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787632; cv=none; b=QpfPErQaSLUNpgKHJU6PyCXjzrBz0gj59MnlgLcRZP3YHNY3dainaZcRoDXhQ10pyep6F1I9DNpHjfybshbinUMiuU5p65sVvyXYOzQFJTbqZnNgpoqWbA1f2N/fEUQ+NK6lY9WmRjHASEw6CaPMipJ0g4l6OjQUdNFA2L3gYy0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787632; c=relaxed/simple; bh=8mBPJoTtZ1Z64e7ets6Lftpvv9xxyy6/HNCPnYxIfO4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GhFAdA53awpQjmyxjlpcRnAWgismLQCZ7Vuk+UvJPYEdySXbt/LRnqXstzkglDCVZ7/C0NPmOHI3LlvALNuCR0Xw6Z1Mk7nSt0tAmucurrfd91BwMQhhkp6W4nZpK3vSHc3tQE5mbqUuwhjHJyWqCFtfGM6ZzljbQvxeZdKynzo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BZFPJFNu; arc=none smtp.client-ip=209.85.166.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BZFPJFNu" Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-844e394395aso80211639f.3 for ; Fri, 24 Jan 2025 22:47:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787630; x=1738392430; darn=vger.kernel.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=x11BZKBrVuF//4sDIzHDHCm/mRQ6/WwpO4x5frMPkhY=; b=BZFPJFNupu/1mPRylyXIwspCED9nsukc+IDfZZbQvTQf0mKN+FU5zvQDTG/lY0VkPD 9lVF9It+mNovdIgUL5+MY+GUi/pu/QmUnadr1T2VCGvnxqbi0z1c3XtQNAm3DYLDly3l ew2vBGtaGNodWTpJx8qR/rJyy7qbc+eYgeVJPDnHkcfeqPZuJvfvsPfYMPqmDP5CL/dz vMKHxCBnGDG7Kkc0mxzLp8LCqmb5UcXZULFcBtpv5x5cperBoa5JsRg1y0LhILJgr8ZU D2HG9real1pCLd8XQdMjdPdQHu867ABOrrj/6wdfBas5JjDBkccNhf0fZxbl7j/JSGKG sncw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787630; x=1738392430; 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=x11BZKBrVuF//4sDIzHDHCm/mRQ6/WwpO4x5frMPkhY=; b=RDGWyN573EGnhBfVnowB+YRTczN7/F8lpnAND90eBu6KPPgfuq+CCNHMV8dLBI49ll Mo5RWyZONFh7G4Kyi7mJdreF2iPQhi78bYiQyN3/pCBakO/0QFjQOhz30L+wT2McYYNq tL3heLv64qoLJplZ55fOT+CBAaS9g99tRZCob10NAOgVbUpVwuBtmhd7SzK8vFtv5D1H io09y0pIOhruVd5JhZac6U2cLhHW/F6YNOZQ0GZW16DtCMpHbnsiOzfI7TOAmGN+rcvN i4+P9CbLlXO4+zuVpEZwA9OFd2RSSZ3PxTs/sI3jseB1fZBL3OeRi2E40Ao9wDdz47II oL7w== X-Gm-Message-State: AOJu0YzDAGFUGOpMWYp6eUM0rxo9T7ljYSNPy0iqD5xgljlqLVO1eyyF Ax+korisL31BfI+rw2Pok0qgzk2MU/pmgG6YMw2XEBBx3BSOrlDvf0tbBw== X-Gm-Gg: ASbGncvegBwQhXgrTMh2Ncvq2AlIDh1eszy8h1kJt6n7D3kGkl7uVr01EKbffj3bdM3 yNao7uPeoRO5hiN4d3kbUlzmg5uq57W8ofaBV9ilQRUUZvZB9UIDnLPIg4meD2TXjkrARlq6pVm NkISfcITMoL6Uv7//iZQ+fZMz/FElI40EWOk5pIF5+RzKHRCPpPgwPveGbTAWI1OeCF3ewIPFk1 DwTAaf+rcthk0WsDj5ieecY5Gx5xQjFx3w48JhPKC2DOYJ3uXQbclMgwWx10OBE9Ij+cqE3FRFC R4OYbxWk9Pw+kY9G1KAJqGK2ewIe6F5QiirCCg== X-Google-Smtp-Source: AGHT+IEMjfj5KPBD+MY1YnSxoaWknOFxVXF7E1RjBZMpsyNcxNDm6LNROXUaKAR5kPzioEBH7zCauA== X-Received: by 2002:a05:6602:3e94:b0:843:e667:f196 with SMTP id ca18e2360f4ac-851b61ee917mr3363869739f.4.1737787629916; Fri, 24 Jan 2025 22:47:09 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:09 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 30/63] dyndbg: treat comma as a token separator Date: Fri, 24 Jan 2025 23:45:44 -0700 Message-ID: <20250125064619.8305-31-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=3Dclass,DRM_UT_CORE,+p\;class,DRM_UT_KMS,+p or as a boot arg: drm.dyndbg=3Dclass,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=3D"class D2_CORE +p" new format: modprobe test_dynamic_debug dyndbg=3Dclass,D2_CORE,+p Signed-off-by: Jim Cromie Co-developed-by: =C5=81ukasz Bartosik Signed-off-by: =C5=81ukasz Bartosik Tested-by: Louis Chauvet --- 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 9283f2866415..56e09e878f80 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -293,6 +293,14 @@ static int ddebug_change(const struct ddebug_query *qu= ery, struct flag_settings return nfound; } =20 +static char *skip_spaces_and_commas(const char *str) +{ + str =3D skip_spaces(str); + while (*str =3D=3D ',') + str =3D skip_spaces(++str); + return (char *)str; +} + /* * Split the buffer `buf' into space-separated words. * Handles simple " and ' quoting, i.e. without nested, @@ -306,8 +314,8 @@ static int ddebug_tokenize(char *buf, char *words[], in= t maxwords) while (*buf) { char *end; =20 - /* Skip leading whitespace */ - buf =3D skip_spaces(buf); + /* Skip leading whitespace and comma */ + buf =3D skip_spaces_and_commas(buf); if (!*buf) break; /* oh, it was trailing whitespace */ if (*buf =3D=3D '#') @@ -323,7 +331,7 @@ static int ddebug_tokenize(char *buf, char *words[], in= t maxwords) return -EINVAL; /* unclosed quote */ } } else { - for (end =3D buf; *end && !isspace(*end); end++) + for (end =3D buf; *end && !isspace(*end) && *end !=3D ','; end++) ; if (end =3D=3D buf) { pr_err("parse err after word:%d=3D%s\n", nwords, @@ -595,7 +603,8 @@ static int ddebug_exec_queries(char *query, const char = *modname) if (split) *split++ =3D '\0'; =20 - query =3D skip_spaces(query); + query =3D skip_spaces_and_commas(query); + if (!query || !*query || *query =3D=3D '#') continue; =20 --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC3BF21147C for ; Sat, 25 Jan 2025 06:47:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787633; cv=none; b=VPzqEHbW3UUN1PVeUkK6AmGV9yBVLDL5Jt/dlgLegX2D0Q/4tIg6btDRgPQWdgDCnGa00kewg9N6kgZ/RzC1kiwn1qBzVDILeiSEv0+rPfKu+RfYvred2P9HgxoTKdgHh2pwsNnhuiJItgOrLj8sARlcZShV7YapFF7zbVGAKE4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787633; c=relaxed/simple; bh=7a6BUcXJVL44HC8+BhHl0XAarbZc9dlleQ90b/giQoc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pEhJT8uWWQ90n1fACZZSlVirEkZROkf2KI/FPbFg80yfy234Z48s/gIJ6xBuP+LKjTT97Yzsw64Io1GAwem65a3LU3uekaNKIMZQYjhPP9Ms4i/RTi1Edv6426Anvj1RDlPQknFbdvkQKgOEVKZTb9n8vJi2c1mijvZHNpXYkBM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XxViF8qo; arc=none smtp.client-ip=209.85.166.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XxViF8qo" Received: by mail-il1-f169.google.com with SMTP id e9e14a558f8ab-3ce886a2d5bso20711725ab.1 for ; Fri, 24 Jan 2025 22:47:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787631; x=1738392431; darn=vger.kernel.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=419xiuPVMG3qbwGo3tkCVXoWQ5CudHQx226Ckf7XZpg=; b=XxViF8qo6+PuYSl1s9hUZR2gkve7JrCGebWdMOjlOvSqfPNwABKfKc5AcPYBuIaqA7 OYHPkXekZwXzBsmhqPaFWkHlr8ITeICFklOJbHwIpO9cMzjLEbLyRQEpht99YQFSybdw qukozrh137w4Jx2P1DfB3gf9mHBimRb6w3Gc7psCGLfOaMzuNf4MEhO735Ve+4YE7QN0 5JHZL7oUYd8mxK33oaMCgHw98y93ePE2ybwcKb8gck77FMZKdJIRAaawFvETIoz91es8 CDjjqCZ2CEtHjChSJIBko4/6mgNPKrmAvwnzN5XHDRwuwko8gBwvzFym2K73HLXuG4K1 /fdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787631; x=1738392431; 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=419xiuPVMG3qbwGo3tkCVXoWQ5CudHQx226Ckf7XZpg=; b=kNDPC7J8aWG1UH+d3S0W3oHnSeCs0Eeogqve97w1UPm4zY0eyw46XbSKB2xAcH/r+Z YxIdCFcOs8HxiblvQ2Z1aHBCyLzLIetQp74Yey3ltmxOQvZ6hS3O644WaqZTpfd93VO7 avD6okQf9GJIrSS9PpTze0Frnbsdw4ZXS6uKpR8hGYNem8aqubnV8HyzpUznaOteUfQh 7zur99dJanVSG4XjBR+Y9zcKRo/gXZiGGhM/ZV/ConqvyCZMyxt9Zy1oUNZnYMh8he6N gtV2yEwDEqidbD6/VcJrMp+ECv9ER5CYIbhhV64jh9Kd0D+++HtbiC2oZ6RvTBxSf8QM aG3g== X-Gm-Message-State: AOJu0YyJ9O6ZXtGv3a5ImyYizcUU60SdL9HrNBKXi58hqgvII3GHZLCA cgdAZKcNRZ/Jy2crpHpgJ9n/PdECoxqLtLcAG3Gh/ORNH0M6JjNo6uTXJw== X-Gm-Gg: ASbGnctG9730PM8RIgvkdAb3lkZpRFGQoRmDCNV/hAUCHTwQuACEh+FYsSeHriO/x4U t8QGuLu/JSnRrREooF++bvPXkxJRtmucxy3inacpPzNDZbXraNAXypofFsQtotTyX/2z+Ay5Z7H DMh4vt3Ko3+5mjubsaqi01hxNpGIt4XfQKpbobOw21Z0affyr39aQdfn5fB3VJPPYWdKqbsONUG p1LXb1VSeyLJNuxooKe9mydZuL+guK/DPQ+GhECZi0bA5MOUX159lZNJZiaFcequRdzIJ9SMBQt tV2MPzMMwdwtrvOHIovD6xRkoi8xiNhr5cwfWJ231qQmQCH7 X-Google-Smtp-Source: AGHT+IEdolY48jcy1d5GbnNNp6uwMS0tCY3zAQsNey2Tb/bKtSSTu+VxIC9kGp83MyjaHTPxuWcnsA== X-Received: by 2002:a05:6e02:1aa3:b0:3cf:cc8d:48aa with SMTP id e9e14a558f8ab-3cfcc8d4b85mr45317065ab.21.1737787631024; Fri, 24 Jan 2025 22:47:11 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:10 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 31/63] selftests-dyndbg: add comma_terminator_tests Date: Fri, 24 Jan 2025 23:45:45 -0700 Message-ID: <20250125064619.8305-32-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Tested-by: Louis Chauvet --- - skip comma tests if no builtins --- .../dynamic_debug/dyndbg_selftest.sh | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh index 68a9046405f2..368d10a691a0 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -216,7 +216,7 @@ function check_err_msg() { function basic_tests { echo -e "${GREEN}# BASIC_TESTS ${NC}" if [ $LACK_DD_BUILTIN -eq 1 ]; then - echo "SKIP" + echo "SKIP - test requires params, which is a builtin module" return fi ddcmd =3D_ # zero everything @@ -238,8 +238,27 @@ EOF ddcmd =3D_ } =20 +function comma_terminator_tests { + echo -e "${GREEN}# COMMA_TERMINATOR_TESTS ${NC}" + if [ $LACK_DD_BUILTIN -eq 1 ]; then + echo "SKIP - test requires params, which is a builtin module" + return + fi + # try combos of spaces & commas + check_match_ct '\[params\]' 4 -r + ddcmd module,params,=3D_ # commas as spaces + ddcmd module,params,+mpf # turn on module's pr-debugs + check_match_ct =3Dpmf 4 + ddcmd ,module ,, , params, -p + check_match_ct =3Dmf 4 + ddcmd " , module ,,, , params, -m" # + check_match_ct =3Df 4 + ddcmd =3D_ +} + tests_list=3D( basic_tests + comma_terminator_tests ) =20 # Run tests --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00258212B24 for ; Sat, 25 Jan 2025 06:47:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787634; cv=none; b=Ft8QKK/0QWvGbO6DziMwW/SRXJW0OWJkYoz9u87r27/IfmbCCUpPjkDByBDFyfF+c/twlAeYMyYOJVfrm0XQUK69arZLDPrv8BABOBN/K1fm29nklrLhSdA2WViYaQYnoVCHFcaAHrQrvPc1pfDbg/u01iFqktdDqOluCVz/exU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787634; c=relaxed/simple; bh=aCX6Kal2ACEEIEYOkb7cfGQw3uOr903xUF0YsRypY1U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Hh5+3tcDHNSwvpGlqCHZv8LAW9LY2nTEkaUCWKkPM0s/TePFWuk4YfglApy/5Jj7GjCkNgM+PsjkFoE62jhqQ0mNDTrBR2jZoQCWHBxkQEt8KF6lhDqgoimjqyk/mJirjQsyKzq07z+INsZ5lCP87sS5Hmh6GEzXCA4cNyGLbkM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=d9JcowIQ; arc=none smtp.client-ip=209.85.166.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="d9JcowIQ" Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-844e1020253so73047339f.3 for ; Fri, 24 Jan 2025 22:47:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787632; x=1738392432; darn=vger.kernel.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=kn9t7zpPYa6nVFkxjXtk64MWrHKDx8bG5odGszaJqIA=; b=d9JcowIQfZKTmLx9H65cQD4z0Z7uGr9IEtuJ+cYBZga/IsRA2zTom4/hBkTbm+rnTY 8LQlMKrvWgcdbVQu2BYlN6KFUDqhL9G5T33IJCECtIqEN1e9BN5D2tqmnXLsba3nsnVv UYI4LYUxqADsRM2Qj5zk28L9G98ysxECoFuob2mBXy9QNm+RL9qkdLQClo791gX1N4jW Mo2QtGtxzMbZnQHvX6NsE0pEUmK7Vin/7tjiSQdBNB+uOxPQiG4xr3Q9QKsGXlDU6uKp laIKNFBCV3602ScGTzNP7tGEnnufc5oNiofRK82gnA08lJCK/RQhVAaNpoSzfzVmttmc U8cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787632; x=1738392432; 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=kn9t7zpPYa6nVFkxjXtk64MWrHKDx8bG5odGszaJqIA=; b=EMH4EJIWAZ1ZwvC0AmEHeoZt6q3CreQZlHS5Xtjx8LPnSGcl+ateMpRnf5QnYyNs26 kopTfNvY4EUoPUmPw4pZSaNgU0BJ0zdSjaNC8DKKfoXHzXEkvCcf42ATQm+TfyfYc9DV r35y8FZekhRwnX5VStwQBZEKnOHJc//vYRe5yq8yzcy6PDgDK054GoXWTy+rsC0KUzTr +NKIMtSDkv3BFsLTrSV8v49N5cKJjHEhQteVeLa376JtH8xODThOuUOe4joBof5P/pIB R4GnV1NxpDnKDFERGSRMBK7ePwrgiLYmQSe4AJ6OWkIz3m21ljeWbawffWxgyiexiBqE l+iw== X-Gm-Message-State: AOJu0YzXC0mbV+lpigZq0kjgwLiOmGkHVylY35ulN7D0tT1rdp7yGCVe X6RNPhwYPFA1PfnPezvNqLH/yKRxRgmyzVpSW5BDqL9qKAVmdX4jy6cc6A== X-Gm-Gg: ASbGnctv1nJW1DGMrACvcN2JofiXFY99P83i0cBqFklGdsDF63k1FUSWrxV5GhyMMia 5atONL36n1QIUBTFA6NlFCA5XupC7MG9TNeRbxVePZXMQ6FuA9jL30pVotuA5f4yj/1wPhOb2gR ZkRIhelskbcQbGvtg/iG0EwRi2H6ZMuX/IMHN974l5DCLRryajLX+6+g8uKLALncTof87Rcejhe 85zNZyCWROgsgNQGdYsd6xlG8IrlOGqc4fxoiA1vXKWNHtR1UglUWvbhH6t8s+w/UQUplz6b5xG M/7qMzCLRTO7dxCh9pG40diTI5LSZmaMmnHZdQ== X-Google-Smtp-Source: AGHT+IGbYt0eBv6uLTOumt0YrUKOyuE08ZMm9674V/UqKTNiWTiUDNTl45IgSuA0rftCQLWNy6OU9A== X-Received: by 2002:a92:cda5:0:b0:3ce:6758:2500 with SMTP id e9e14a558f8ab-3cf74418e88mr205433465ab.13.1737787631964; Fri, 24 Jan 2025 22:47:11 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:11 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 32/63] dyndbg: split multi-query strings with % Date: Fri, 24 Jan 2025 23:45:46 -0700 Message-ID: <20250125064619.8305-33-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since commit 85f7f6c0edb8 ("dynamic_debug: process multiple debug-queries on a line") Multi-query commands have been allowed: modprobe drm dyndbg=3D"class DRM_UT_CORE +p; class DRM_UT_KMS +p" modprobe drm dyndbg=3D< [ 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 Tested-by: Louis Chauvet --- 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 56e09e878f80..68b5a77c2d79 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -599,7 +599,7 @@ static int ddebug_exec_queries(char *query, const char = *modname) int i, errs =3D 0, exitcode =3D 0, rc, nfound =3D 0; =20 for (i =3D 0; query; query =3D split) { - split =3D strpbrk(query, ";\n"); + split =3D strpbrk(query, "%;\n"); if (split) *split++ =3D '\0'; =20 --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2DBD20FABF for ; Sat, 25 Jan 2025 06:47:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787635; cv=none; b=MWAqn6P3Qu6/oIXzKtLBY12ftkYoshfoO6dr5eV7BcLZygCvKhC007u2UDbl8pMzUC6QZFTeyJTg8b3HMx8pypMoXQhYm479byyNKGfMQoab6FmTC7ewkv/hMREsFrmhejEkjMMNI6WN82snYaQGKBmFJn20vXPOTjVM8cLpfMQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787635; c=relaxed/simple; bh=I4Rkg9DW2+0KPFZTG+SRqJzQKSaLNEHlDSV8wogQPOc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aex4tdlowgnydaShrpzTcWOauxoU9vw1ZKoQSFM9YYtGs/TrbWx9hjZk7L96FVA6moWtnJdrFVaXurAD+M5qcs4W6zTj6VLyWr+9GzxMa25IDIzADgzDpKp7YhLRd+M8GUW+hddqfB1B8D8Brgcuyk+JlxQGJMWwjvJneWojEFA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KnwD1xys; arc=none smtp.client-ip=209.85.166.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KnwD1xys" Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-84a012f7232so114027339f.0 for ; Fri, 24 Jan 2025 22:47:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787633; x=1738392433; darn=vger.kernel.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=8Fcd0CbpeqTSAr2MUddHNYquZXYxsn4RsHtjuNfIUxs=; b=KnwD1xys3IdtThL6n3DpeD5NW+Y/BuuB3nj8fWoJ5kkdbDQdjLFvxPLkewsNSLamJZ o8YhbMmF+9uwv6eRJ29luLR4Z6MpijnlsZfIYh1wZXJ2w/crwd8MFqIR1OdvnkBp11o1 71IhZr9mKFQLmXk6qrkbbEUOLA/95D6jA0D4SS9JutSbO+GP5/yDrbr6w1ljmAEMuKj0 lHWhEAe3MENG5aCWTp3im4solYSqFkpZFQEiFfkOpYaZJfEEdo2qSAlT7jJHz43uyEwI yBlShhi9BwGtbVUpZupczReMwWkdgRUkbnr4CjETq0TTLKlW0IDlM0kOI8lysFAMmq8Y ONGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787633; x=1738392433; 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=8Fcd0CbpeqTSAr2MUddHNYquZXYxsn4RsHtjuNfIUxs=; b=laBji8dBj5bwU3RdMG5kbWePNxvvNtkTyFDR0GDZMlM1wuMJneoMcf2WUTPCuOSqT2 hCZ9856B5MiqkTNeP9QF347bVW+cxMDOgdfWFNwRIr9fjJpokIsx603JD+m/O+kagYSP L7mKzYrh/Fx8c3YUCSn9HPx4JeVZ4OGm1V30k5tdkuf75pWREBokk6zUMVgpRr4ks69N vyyGGqCXqmzZws6LorPt4qN7XxRlrOkHub3UBPrMeDCXglxTzCGzL6AHyWY36AzifzX3 ic7HjhJChS3wtDQXtaLxTUZec+glfwLsdk+KHsIZ0nfBuufsI+mcNXFdbV7xHuqbVLZN C1mg== X-Gm-Message-State: AOJu0YxZN1uR26tYXUjKtmD4Wg32gUddOngsSfhhd4aIpUP8NBcg/OnS RR/tPxx01WgF6ujnnNETi6k+mUAr13aazDJpBSCMXe6+5DiUwT0y1JlcTQ== X-Gm-Gg: ASbGncsVFvZ9WnMcCnhJJjgTeL2HaHBv+J1Qtj8nYML/I0si0pDPQNZ2XS5LYf0mvku OIGDuGF/DhuPbpqxDd+7XzUc4NC/FdBmFlblmeEEV+QJKZZ8LdmJE6BTSV3Oq+dZ14URt1vUV0f r4eW7DIA+kxlvcncjs1T0XEqRQTbrca8kevV5UO1bVSK0LiKr3eIbqRDt32l3ShbVaccIL1ZHhK FErwA6D9457t50uwrYi1mdPy6wQN5TsYeXbIBupbsq9Ze6wLK3zbbqk5cXttkvXWdonl/Y35F/D NRVFjZCbMu+0Kn6sw8naOfoRZAHEb3pCuOrkXg== X-Google-Smtp-Source: AGHT+IFCwNCwKk2LjU+VISPtmf45oXrUgrMIIcfvyXFuFTikBwGEdBXb11cx99j0mRG19lRHebe9QQ== X-Received: by 2002:a05:6602:751c:b0:84a:5201:570a with SMTP id ca18e2360f4ac-8520bd814a2mr784672939f.4.1737787632909; Fri, 24 Jan 2025 22:47:12 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:12 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 33/63] selftests-dyndbg: test_percent_splitting Date: Fri, 24 Jan 2025 23:45:47 -0700 Message-ID: <20250125064619.8305-34-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Tested-by: Louis Chauvet --- .../dynamic_debug/dyndbg_selftest.sh | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh index 368d10a691a0..c97c9391d0f4 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -256,9 +256,29 @@ function comma_terminator_tests { ddcmd =3D_ } =20 +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 =3D_ + modprobe test_dynamic_debug dyndbg=3Dclass,D2_CORE,+pf%class,D2_KMS,+p= t%class,D2_ATOMIC,+pm + check_match_ct =3Dpf 1 + check_match_ct =3Dpt 1 + check_match_ct =3Dpm 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 =3Dpmf 1 + check_match_ct =3Dplt 1 + check_match_ct =3Dpml 1 + check_match_ct test_dynamic_debug 23 -r + ifrmmod test_dynamic_debug +} + tests_list=3D( basic_tests comma_terminator_tests + test_percent_splitting ) =20 # Run tests --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A1C121421B for ; Sat, 25 Jan 2025 06:47:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787637; cv=none; b=hrke63cAiKbmkesIzVRSrCN496mNupU7UJjLuyQPETXhINf+NyV9tJq+wUKpM7I3HyigWKvPXTX2c2yed/frgzVeQaCH3sY6H7FCeBqIb/itMZUfbgc+lL8vaVrPcmCS8/3JoBQ5b9dT+tnVMLam5BCnuVd/T9/PgB4SV4kiAes= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787637; c=relaxed/simple; bh=c3ZBxKmnmbqCCMeHiC9+dvwd/Vlz8dMZyN0oZhiIC/g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tBoFr7GV6fW4H5dGL0PJwmQD9ue1EinC8rA4T+OmWq7drIwSVDV5f6+gSlu7ev4pC6rFHRMKDykOPBKD0BXhTX0+MAsdeRaid/YWcYxHn4MqXRbalSjLSff7YgxfbJAtS9zAl6kSORf8Vok+pOSFrfDC+VbZBU4fjv+Y1rE6uwo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=i9hV2lM2; arc=none smtp.client-ip=209.85.166.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="i9hV2lM2" Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-84a012f7232so114027439f.0 for ; Fri, 24 Jan 2025 22:47:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787634; x=1738392434; darn=vger.kernel.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=JsyGIKm5KVw15Lrl3SAKRhPe64hFlD++7kUKJ3Bp+EU=; b=i9hV2lM2kkIyYO/yEmrmbvGxdLeUl50DDH4ZjZ0VZm3Zu/NjYW9omT4JJ496Fwdn3q U+NT1lCC7oo05M+dvfyOa9bRwO8lRUKoQQSqb8lLj9KyRzY6+GjkkdI1qQ6ZcmJnMHWi aJBIuf1BdlsmbW/6DiKqV4Z82k6BqtcaUktz1e3XepGAJw3V35hxELrOEDZmAmNmg9uj f1W6Iu/NRqok237ZLAzWejLgItC8NXZzqs05i89Ws9MqlhCKFy6JyzERSO+GUZPgQ7r3 w1HaturEIb01wwnp5f205TP4scRGjqKaCpCGDw4WLeKR2AAMrL8mje0xWi71GO6H7aEc /fJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787634; x=1738392434; 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=JsyGIKm5KVw15Lrl3SAKRhPe64hFlD++7kUKJ3Bp+EU=; b=fM3w8YxIeXniDr55bveQcKGfcnuxlg5T/BMPHvPyYr3bqjbxt1KLCy1kY6AbbJIHlc tJD+mlqC9wVip5FTJ9qb7+Ot+JZUjOQ0xPrKcru3vwkUv29vavbwC/E0ZukLJMMbF58M K4HVjFpxEhzD7EJzksY3C54DNm4kPGsBWGmnxc1zrp5KYROMgjEH8TfBKNqNyO4+32Ku dbxCwWx7sOgTBa3yWzHFL7JOOJdiS4JcqmzBRpyF2DqkjIPO5y6i3PxsDi4RhGWpmo2G XGgO9cY8VR2cteTCXx/XjyoBBHL9szIiid6/hM84eaNog/ziT9EuI61HrD/jmGNG9zY5 iJUg== X-Gm-Message-State: AOJu0YxITFIhC/oNI6v72fxczPHlExRaEq4eer6FXQVNXJKjiIP7E46/ HI35ug+qgq3SLbEwhD83ciNd9wUxFiukHyC0LMVlzCugag9LPMRAYto0TA== X-Gm-Gg: ASbGncsbC41IL9bVUoA9I9ieZVgWcpx+dqY14YYgVqQn3ImF3JVPmJljPsnrfXvfubY pHCa0rNEMPjrzduHlghoEkEWFQiAE/rWT5D8fSIHPQcuo/QTFmjGQV9VPGGLddtZAlauaJRYhb1 TAcmp+ohwgDLFCXUDJHoKQGgRtQrY7OBL1lnJP3uoNedaXwxzNHpVBXyLoCT59NGk9uydBCYuGw nCmU2V47uk7giOAqHQck/zXoojFmkr8ysw5/cMJ/UroZSxRODsk63zNbRWKJ9QRWdJ97Qvle6PL Ig+Pxov7zbPuKhDcveWMv9g59+qacHzPmt2wFw== X-Google-Smtp-Source: AGHT+IEO16ggXmzyfYHgop4tbbYRoiJ+jPn2ZC4cmvbjRlCrlzH1udV42UlgxC08+7x3doqhyHdvvQ== X-Received: by 2002:a05:6602:6081:b0:841:ab27:acac with SMTP id ca18e2360f4ac-8521e1a91d5mr552474239f.2.1737787633949; Fri, 24 Jan 2025 22:47:13 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:13 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 34/63] docs/dyndbg: explain new delimiters: comma, percent Date: Fri, 24 Jan 2025 23:45:48 -0700 Message-ID: <20250125064619.8305-35-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add mention of comma and percent delimiters into the respective paragraphs describing their equivalents: space and newline. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- .../admin-guide/dynamic-debug-howto.rst | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index 391e40a510c9..c3537f8689e6 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -78,16 +78,19 @@ Command Language Reference =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D =20 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:: =20 :#> 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 =20 -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``:: =20 - :#> 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 "func foo +p ; func bar +p" :#> ddcmd <<"EOC" func pnpacpi_get_resources +p func pnp_assign_mem +p @@ -109,7 +112,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 "*". =20 - 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::: @@ -133,7 +135,6 @@ keywords are::: ``line-range`` cannot contain space, e.g. "1-30" is valid range but "1 - 30" is not. =20 - The meanings of each keyword are: =20 func @@ -158,9 +159,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:: =20 - module sunrpc + module,sunrpc # with ',' as token separator module nfsd module drm* # both drm, drm_kms_helper =20 --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1CFF321422C for ; Sat, 25 Jan 2025 06:47:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787638; cv=none; b=h6vDxQLiRRrSODszccgKQUjCLgeT0/ai2HtfKilJJXbQ7G2d1VQA5/4oyEbUb7eRJxy8K63eoOFpYQQOLm/0zc4/Ttfwc5DNbUIdw749pW30f2buI32mhy2BS/owoQpdFmtwPNgs1wEdVJzx5YUYaddQ0JcqhwenE+n6Q/G9urQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787638; c=relaxed/simple; bh=RN3Vjgo9aW4H3xuplh0M5d9b71cmuQpX+4vQwTKrFuw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O+IelzDPSAGRHy11ljbmcGSLRGabEV/9kUWaHZN90AFngFHnoEPw72a2enF3kkqqaoc1TxMFLxwNYIEG2Vc4Zr86UN66DESkZcgethEjAgOMBNWNHqg50wUl/kFXiVE7nFdYW+yJL2kpSU8vyuyA9VF7ZTBaMLxqj8M0YVvnni4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jhEeS8XB; arc=none smtp.client-ip=209.85.166.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jhEeS8XB" Received: by mail-il1-f178.google.com with SMTP id e9e14a558f8ab-3cf880d90bdso10175415ab.3 for ; Fri, 24 Jan 2025 22:47:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787635; x=1738392435; darn=vger.kernel.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=I04a0kW+UR6r9NTRsDJJoUdmO3RA+TyzEWylVuR4B8w=; b=jhEeS8XBvdIiIBKXmM6j8qInzN7Fz25ObxoPDdWRTLbys314LC155nFWrCpezcY2Bw t1VAxoBvXhgCuFQsNozSL6PUDE8eqhzYDr9dwkj9M5w0T8exBOrPEzXW7krjPIvYnp/o 3jnMDz5x3MKd/l8NEXpzZlHMtjPze+vvjN6s1tmzgsBW19a0xjzeFXYuELY9riRtA55Q X56lQ26hB69oZu4FxuYDNXeaX3ck1DMtAcLbuTVlnLJy2pYwJJEOxTs4H/wDjmAv3cBJ yaDTPgEnT70BF1dqxshIGMAftndFvfzvLQ5b+r5pB+fhUdPspI6Pb4k5Xh3G82IjRb5N tC/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787635; x=1738392435; 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=I04a0kW+UR6r9NTRsDJJoUdmO3RA+TyzEWylVuR4B8w=; b=Hn7ysE4ezAbeCrp2ak2GMR3pYEpdConI6zMl2KBwSuNxxyCRc6U4fwhMr+HDdgnzgT GFEswZ9KBN8OIYv0tQfY2AP0NNiuYQcA4+bOlh4RyXxxW+/TV1S3Q7gB13jYlAKvDqP8 0++1UCS9Avuu9HSNdlZlvkrND1PtWj8ToxYonnDiT8bgm4U1FpVPVmQ6+uorzBAqs/2R zJYiX+aq7ldhb9W8suiNZUT6kY0iNZhML3SU532YxyN9f8sHwaYiynr25wdJC4DwX0I2 7o0VXjPaW0mWoBESjKHPRdL2gnod0v6vNXA9s8LQ9hUjM1RQ9srJDsYcOUpTS96b+exn 7DsA== X-Gm-Message-State: AOJu0YzVe7pbmxuaI5EnKnO/jIWeq9D5HVpTLeUjlO+Y0Y9DJJytCaGS gr2jRo+11pYVWUF6w4SevCFBTBUS1xF/elneqOKPAQ/TswO9ixu0rKG6Fw== X-Gm-Gg: ASbGncs34pNgYuE4lduzR7WMEcs3We9sUgnoOJWnlW4A/UsD9OMQYw0MD2v3WhFTHd7 hWERnD3gG84Q2/pIWxgXPG8tqoRjVbndKjuJdjdYxysqzNSWxrQ7m65236iBF1YLPLnFiFbvxI0 TTc11kQXkbEjro8pv9Z7zJ7QK+lbISpwdMgj3zcXJYdqdUSsgPO7z+5x8Yp213Gvz/Umx3N8NXM UHXfr03uZhAOAWm89Hu3IOvjOjAQFzAUW8Awxi42qxWIwV2wlnnBs0L2+YAmEywBCrFU3EiYHqz CWaEKaL0GK/fEivfOQzbXmlVGYTSAQk002ZpAA== X-Google-Smtp-Source: AGHT+IGIM5csLRgdDio0MZ1C+W8ZtXGP9ro0KKbKTmSNfS3XJ37G4loIhg3hRvpEN8PltJakl5OJ5g== X-Received: by 2002:a05:6602:6c11:b0:842:ef83:d3b2 with SMTP id ca18e2360f4ac-851b6522640mr2688351539f.12.1737787634956; Fri, 24 Jan 2025 22:47:14 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:14 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 35/63] selftests-dyndbg: add test_mod_submod Date: Fri, 24 Jan 2025 23:45:49 -0700 Message-ID: <20250125064619.8305-36-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This new test-fn runs 3 module/submodule modprobe scenarios, variously using both the generic dyndbg=3D 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=3Dy failure. 1. 2 modprobes (super then sub), with separate dyndbg=3Dclass-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=3Dsetting (like drm.debug=3D0x1ef) 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 Tested-by: Louis Chauvet --- - drop -v used in test_mod_submod(). V=3D1 does it for whole test - ifrmmod at test end (Lukasz) --- .../dynamic_debug/dyndbg_selftest.sh | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh index c97c9391d0f4..cfed79b34996 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -275,10 +275,79 @@ function test_percent_splitting { ifrmmod test_dynamic_debug } =20 +function test_mod_submod { + echo -e "${GREEN}# TEST_MOD_SUBMOD ${NC}" + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + ddcmd =3D_ + + # modprobe with class enablements + modprobe test_dynamic_debug \ + dyndbg=3Dclass,D2_CORE,+pf%class,D2_KMS,+pt%class,D2_ATOMIC,+pm + + check_match_ct '\[test_dynamic_debug\]' 23 -r + check_match_ct =3Dpf 1 + check_match_ct =3Dpt 1 + check_match_ct =3Dpm 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 =3Dpf 1 + check_match_ct =3Dpt 1 + check_match_ct =3Dpm 1 + + # change classes again, this time submod too + ddcmd class,D2_CORE,+mf%class,D2_KMS,+lt%class,D2_ATOMIC,+ml "# add so= me prefixes" + check_match_ct =3Dpmf 1 + check_match_ct =3Dplt 1 + check_match_ct =3Dpml 1 + # submod changed too + check_match_ct =3Dmf 1 + check_match_ct =3Dlt 1 + check_match_ct =3Dml 1 + + # 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 =3Dp 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 =3Dp 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 =3Dp 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=3D0x16 p_level_num=3D5 + check_match_ct =3Dp 7 + modprobe test_dynamic_debug_submod + # see them picked up by submod + check_match_ct =3Dp 14 + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug +} + tests_list=3D( basic_tests + # these require test_dynamic_debug*.ko comma_terminator_tests test_percent_splitting + test_mod_submod ) =20 # Run tests --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0067F207DF8 for ; Sat, 25 Jan 2025 06:47:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787638; cv=none; b=DRL7X+0lXgH0x2qMDrpJxEubOt5ecnnzKI1KTLD82yNWVyn7Uxeb1seGg7J7NJTf2ntEKM90iSU0Txphj/bimRk9Bv6jY5IODrLrE7CtLUgp//h7V0m7DvNJjld7vkADHnCIw/lpJthyWqUXeEspbuWd+OD+LUCjncLagxcPlWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787638; c=relaxed/simple; bh=NUKBLreV2V6Xt9VP/Iyf5gS27NIo/qOExsV4ApIKSkY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kVJNkiQVldFG/M/2bLEgc2eMUsMYArZVqoE8BNrAiufTy24LZNYsIBJkCd5fKkTE4JqkBYXRn/fukinClkT32RwOfzaOvCen634+jLHwyXDTd79Y0Qz5l2KwBPCXmRh4Lg8heieK5LGvaJByBuFVHtXK/SDjI2bbxaFp3pbAGzA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bjXcwN7l; arc=none smtp.client-ip=209.85.166.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bjXcwN7l" Received: by mail-il1-f178.google.com with SMTP id e9e14a558f8ab-3cfc934af74so14340695ab.2 for ; Fri, 24 Jan 2025 22:47:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787636; x=1738392436; darn=vger.kernel.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=jfhcWZrz83wYOYEIdNpEF1X0nPHND6LQ2XiKG1miCwc=; b=bjXcwN7lVWR8AkR1oA8jHv5wovVM1SFPEhGRq5eIHnSbF89aauwEAVFqsaReoL0agJ mpqqw+qt52ZAkYWqDiD6eK8bJAE6EPtceu4NNNFx1F2DuUmubU/jgoDyMin1v8ppW6tY V1mVBz95IPzUu7rpCV07odRqfqrbBtsg69zC0tf4EDwxMqf3t4Z7eruQeJzpGlrhwgFy UAEu6cEEXlZhXr3+MZU6X92tyCWSLqq/LwQs9Pmbz16fnGH1Vdwz1OX+hX2KqhcJEnYz T/J3y0gPsPHayyq42iw4TjoaT3DQoAdQsBjCBiVzaAqPFEinETw27s9iI2Otm0eafuv7 sSUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787636; x=1738392436; 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=jfhcWZrz83wYOYEIdNpEF1X0nPHND6LQ2XiKG1miCwc=; b=PIQ4KROPWRMmLKlaF0kCd0NPnLLKO/p4Ny6acUcU+fMitCVf6DTURvkqrlKr3r+7xl tfJmwOOWuLztwsF0Og/m/QNYQWDEJ1OqPa09B41FlWhWQoXiDXdx6tj30ZUyHZxiaQKy JlWpTt7GdgVnx6Qp5dp4DqlESe5n6ECKGEMzvoxB5gaunv9DWuGU8mkFfr2bR6R2iTMV zlPccNvAzNbtCYI+ekGBq3/jITu419qkCq5KIakDv51LNsLMich+Vvp6zBwk5HpNNq2k TLLFq3HraNTrPsk/vh+Ke+7svdkrg8O0ZD7xN8pc7fxfPBDYrJuNN2xWOxLPpTLPlixP HAxQ== X-Gm-Message-State: AOJu0YwFVVvP88r5BkYBOs+Um4hgRD1QAie8eCdIHpj0Tu6lZrbD/SAC VnnQJd1xnCL0TpdJ7WtCd5BxIHEG4eci0PvholD9Btwj4oJVzn8AVeg51g== X-Gm-Gg: ASbGncuSMc0UH1/vSwoKBi7VfNBC5mYA0S3AHFhFSzrLMQpQb4YOayfC51EZ11UUT/y zCjC4bpbY6C1KkOv/uJMLQ4tVmZCtiS+GyN8ZB5IullUN0EW7t3wBSlCQgj1TnHQumWVjCoC+IS j3xpKHpxLcsvUYyPGM78UE0iP+X0LA9wSuw04eLVTZBF31WskSbOhCN7+JZlJh6dJ6EDDTN5UCd +XA7IjpjDY3hcrO6jar0y7MM2It/qyLAXdq0mm7UmJ54U5Pb4RUZuleLRegbDxRQICAstJZXCc+ zpjijaQkJKZYSzZJqX41gwWLXhwh8+4C6kCEhg== X-Google-Smtp-Source: AGHT+IEOc8EmSIZbznFHHPXX84xuy1I6pZ+yKmSAQ2gwM3rRL/NYDxG3wxu+D0E1wbsVsa/ZJEfxwQ== X-Received: by 2002:a05:6e02:3f03:b0:3ce:87e3:c26c with SMTP id e9e14a558f8ab-3cf743df88amr329678565ab.5.1737787636061; Fri, 24 Jan 2025 22:47:16 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:15 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 36/63] docs/dyndbg: explain flags parse 1st Date: Fri, 24 Jan 2025 23:45:50 -0700 Message-ID: <20250125064619.8305-37-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When writing queries to >control, flags are parsed 1st, since they are the only required field, and they require specific compositions. So if the flags draw an error (on those specifics), then keyword errors aren't reported. This can be mildly confusing/annoying, so explain it instead. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- Documentation/admin-guide/dynamic-debug-howto.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index c3537f8689e6..89810ebaca8c 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -112,6 +112,16 @@ The match-spec's select *prdbgs* from the catalog, upo= n which to apply the flags-spec, all constraints are ANDed together. An absent keyword is the same as keyword "*". =20 +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::: --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14714214804 for ; Sat, 25 Jan 2025 06:47:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787639; cv=none; b=ifmUMxDK08G9GgzWwML/v+lqCD2ZsaVvA9RU2Cz/WDHt8KEGnn9ig1R3Rw4lnpn0aiCZnbnz+PUKVGL8vFmZacTb8TItpQT8Qn5kOPgLfohgTmLgCJZ93rcjP567OkPxMBF1VWG/WlS/KKKuOwPVKsdW2ysUTnGCCpVXFYiKaBg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787639; c=relaxed/simple; bh=MNTktAh82iJrPM+3VKXbEqKKrDjxq0fxzS0qLGh+NCg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hb7Q4TXSWwIvQotEcVZNb3r+OU2cgXRaosbdFqLMiVq6LjfcgXNn/+BLZt43NJ6Py5DqWNLUzk4X4zVjJQ54fsMzE6hDbj8e4xN9Rv/GjOjK0cAzQNPv/qTtNEic2PNgNYF8qcUPJSbktRuy2ofRj8ApEtA5GB/KRsRj3IJ5Mcw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Cw7QHiZT; arc=none smtp.client-ip=209.85.166.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Cw7QHiZT" Received: by mail-il1-f170.google.com with SMTP id e9e14a558f8ab-3cfc934af74so14340795ab.2 for ; Fri, 24 Jan 2025 22:47:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787637; x=1738392437; darn=vger.kernel.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=R20pJusVAFn+0eRwjuybzN3XQmUoFo5g9xIXn//WdwU=; b=Cw7QHiZT8WnFhkkS6fQRUu++q3VsyMXt0eKDWzSrFdnCIrt/n0PRQga5CyFZMU1OLF yzC5TIjGnky8btyNhUL1nHFbB/CjwivXefX1xjovzI3YMPT1gcL+BcF3y3r8+/pVYy7l eRL6njMv3esTRFoOC++Jin3NCw8etfaJjPSQ5joC+H14uQ78N3N7buCVT56aIkXQyb1P ZAsHTqamVg77ObR2eUknN3+AG+Oi2fB5mVHkRawlXB2m4NEOG79VGeQyqmYiv2+yOlYL Kk6S2zwcoK+ytkNLqxFGUYn7J9LkKPNjRNYUb85sstC1pH9KOjiH0Mfkc+j/sbxlJ//a KsIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787637; x=1738392437; 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=R20pJusVAFn+0eRwjuybzN3XQmUoFo5g9xIXn//WdwU=; b=JwYJXc1tq4bowJkiKZ5I7dfvGjdVEAG9iWBriga/B3GZbu2B+nBaxcz1bKvf+vM8mi ahZlzti0gODqirqSy+JiftZFZ31QvbkPFAGnMx+SdcO8aQChRaLXtBLxlJoz54xgQK1l i3/PqiRm7eTxdBpTdfLA9B7euP4aG7r8OHeWK1eUoMvoBGw3xY5UBMRtX5T8feIiquL5 jpb8OC1bMV6AlL5YVH2HoJ2jn+ftaQdp0GP+HBgMrQOYmBbstX9bfAcovJGdPGU+nMRE A30MdN8SvakGjS2+ZOIlbtG1vkKw/RIC0s821DwPIPW9kzoeGP32MgnsppP/a5dA/Mzx BOkA== X-Gm-Message-State: AOJu0YziRcQ3pi9ioM7v00kIAAHCFbD1O8airrAP8mzAjoEo2Llr3Y5R NC6FdwQBBTUtjHDZp9/XSzmxfTSKnxb9gAcgds41/wnGy0oZMICOC0j6EQ== X-Gm-Gg: ASbGncuVqXHWj0XF297JVLLx/1A42G/UfVEpfqeWTaxBMfe2k8NKSNz0xSBUXyoo+bM DgzBc0HigU5KyqpfBu5U6J6jxpfpDwaDCHJZns0ljF6LTXvfQvPt7P1PtadszpJfg8fMcflNrcb BUUDCOdhN9yFnRgxdYjpjHDtuDTSQfRInvmpeQRfNRfpzR5uUd6dP83cLL8YreLTlA6zJ04yU1B ik7SuEFjKYPPGmwmsi08hqIhQ0BqHsvV62W8Iotv6NkovoxeeFbeQoCXneQbChs+wGjHXfrxgEV tWQtppgLCUd5M3VXx0usyigce+ATlEjXlipfPQ== X-Google-Smtp-Source: AGHT+IFhqHjUjw9cNO0qk0/umRlKp25sKTeEZ9PGaxIK1gOwxXhslLtN+M7fQRx/uvI7gn1cs6FAKA== X-Received: by 2002:a05:6e02:3f03:b0:3ce:87e3:c26c with SMTP id e9e14a558f8ab-3cf743df88amr329678925ab.5.1737787636967; Fri, 24 Jan 2025 22:47:16 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:16 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 37/63] dyndbg: change __dynamic_func_call_cls* macros into expressions Date: Fri, 24 Jan 2025 23:45:51 -0700 Message-ID: <20250125064619.8305-38-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Xe driver's XE_IOCTL_DBG macro calls drm_dbg() from inside an if (expression). This breaks when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy because the invoked macro has a do-while-0 wrapper. if (cond && (drm_dbg("expr-form"),1)) { ... do some more stuff } Fix for this usage by changing __dynamic_func_call_cls{,_no_desc} macros into expressions, by replacing the do-while-0s with a ({ }) wrapper. In the common usage, the trailing ';' converts the expression into a statement. drm_dbg("statement form"); Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- --- include/linux/dynamic_debug.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index b47d1088b7ad..1ff7bb6210cf 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -331,20 +331,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_DEBUG_METADATA_CLS((id), cls, fmt); \ +#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) + func(&(id), ##__VA_ARGS__); \ +}) #define __dynamic_func_call(id, fmt, func, ...) \ __dynamic_func_call_cls(id, _DPRINTK_CLASS_DFLT, fmt, \ func, ##__VA_ARGS__) =20 -#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__) --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44A6F21504D for ; Sat, 25 Jan 2025 06:47:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787641; cv=none; b=b3vFi/XqKIUmKcepqR+vEK4up9A1eP7hLFt4xyjfUt7QltN1I0Z6+UYubdxrTzJteb4Ofk+1fzOcfADorv2woh2DwpbmPsGi3X2wptB1cruMGEBDmu5BKdtmtOm5ZkiH2Hm1p5dwE4JxfjIzsW+4hIAuU7FKthhaSZ9LHTCFm0o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787641; c=relaxed/simple; bh=mhIYPHL/Ok4i9nfyLpKtTml5RWbBA6+tIXNMr9jjkBs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cPBBEQVUawnsxhsbCMqZhDHUaxxKvHhjGNhxWjXJk3h2uOZqcN3rlDtKubBoXcvzy832Y55vntUiB9oCFsU6MJsPcYxTWUFxvPjWpkQULvWFjN5mbLOYgIePsPAJhej3Key5zWQ2xeum8e8qAzXpVxda6UhLrGzIlXxk3e+WNcA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dOKU8/MN; arc=none smtp.client-ip=209.85.166.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dOKU8/MN" Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-844cd85f5ebso196408139f.3 for ; Fri, 24 Jan 2025 22:47:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787638; x=1738392438; darn=vger.kernel.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=4odqpWJj3urSpAKp7yVqXYnx87D5Dkk2hzn6/0RI0nQ=; b=dOKU8/MNOv5zVw0BSqdRHTB5F6L4Zf8/EpXLqiFgUZZYJtIwsZXIjdadQ3BhOIavsn zvdMt0sDyQCaQfwlEgFqRqYfdBV6SafzRpl9B+QNeBJLyGDe/ws1QWM7ka5uklUASDi5 EEM7/gUJrVINW7UguPu7M/FjWQJkiw4FUxaoF/xYpbMfSdbuSROXXd8V5lHniRRFm1LX aR5gK8rMsEmDJZyyQsco4aDrXBsn+MTGRB4G9rlHT8U80U3x46cj46CbmpUzcal5vG85 4eW4JqaWH3zvlMTlNXIjL7GJ5hzlgEZw8Tb03UKPkv2J1hdMc/9vFF7jUlqW38JmVOnB a9kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787638; x=1738392438; 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=4odqpWJj3urSpAKp7yVqXYnx87D5Dkk2hzn6/0RI0nQ=; b=XJBQnsMwacYiqFHz6KfJvVJGedFItCP5vvgzsyCxzzWdAvSbb4GtdddxaedAYwYkjk qD4x2ZL2UQH5veMuQT2rsJzCvXIG9Lsb/LEcFn0COF1EP5CpTvZPsIs9DE17Zr0A7NZ0 r/9JPphOzE5y+RE5imGtjDsDKp+g6zMOlFG6YgIlNEL9JpvKuCUJR0E1e3gBPYiyh0ti 8l9E6G/QlqpYNDE0dZNOcmrcCctibLFVsFKp3ceVejjXB7DI1jkiHWLHen9GhheHkv0j ESgwXCNViWyvmjHskvUT0BHR75V0bZIcDpUbhCjAgKtDyXjIJd8uHD3u24OfqX+UUfqL GG9A== X-Gm-Message-State: AOJu0YwZLdfgikjQ40GT7mys9y5W3bbD5AO0oQGM2uaPyxZo2iBUOYeZ IzwWxlpAOWs4PXa1lExVRla8xjP7g89Yi9fei7nWsemdGbhNimpinC96KA== X-Gm-Gg: ASbGncvPawEYY3+2AAJDPoU3JjQ3n4hlEnobIkOOCt/Q3Gcv3xyfrjBiqsEv8ADN92J nvo2OYuE+r4oNACntWEOecu9/HSyXlNiO6Zn4LUN8sEU/lGvP5BpLR6y7o+qBJDmcMhuDw/Kex7 tAN4q1B214QR5XbWb7e62IumwhiORr/ko+Znn98OHCEuIvc3hRfy9f/gSQcG7/s6KSrAmOzeaHG 2F+Zc/kYCwUov4Lhk33iDgzOFqUT3uDtqa2nbY2Yqn3yIWeNkom6wZzPmNY8matBgajaW1Xl748 3qaa1EZ425izYBWq6em40gNLvh8YxcNdX5cOYg== X-Google-Smtp-Source: AGHT+IFIY03EaHMd/D6gQtTi8TOeZoophYBCZcpKsV2aOF16dKNLKKSpMulBpaJn1LdTAQ/2EmMthA== X-Received: by 2002:a05:6602:6c06:b0:849:a2bb:ffde with SMTP id ca18e2360f4ac-851b61f90fdmr3893348239f.4.1737787638040; Fri, 24 Jan 2025 22:47:18 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:17 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 38/63] dyndbg: drop "protection" of class'd pr_debugs from legacy queries Date: Fri, 24 Jan 2025 23:45:52 -0700 Message-ID: <20250125064619.8305-39-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Current classmap code protects class'd pr_debugs from unintended changes by "legacy" unclassed queries: # this doesn't disable all of DRM_UT_* categories echo "-p" > /proc/dynamic_debug/control # name the class to change it - protective but tedious echo "class DRM_UT_CORE +p" > /proc/dynamic_debug/control # or do it the subsystem way echo 1 > /sys/module/drm/parameters/debug This "name the class to change it" behavior gave a modicum of protection to classmap users (ie DRM) so their debug settings aren't trivially and unintentionally altered underneath them. Afterall, __drm_debug is authoritative w/o dyndbg under it. But this made the class keyword special in some sense; the other keywords follow the rule: no "keyword value" given means no skipping on that criterion. Jason Baron didn't like this special case when I 1st proposed it; I argued 2 points: - "protection gives stable-debug, improving utility" - "class _DFLT" assumed in query is not that special I thought I'd convinced him back then, (and the patchset got merged), but he noted it again when he reviewed this series. So this commit undoes the special case, indirectly. The difference in behavior comes down to a choice on how to handle class-mismatches; ddebug_client_module_protects_classes() names this choice (and defines it false). On class-mismatches of this kind, it is "called" before skipping the legacy cmd on a class'd site. So this makes it a policy-choice, and reverts to original policy. Later, if any user/module wants to protect its classes, we could add a flag to ddebug_table, a means to set it from CLASSMAP_DEFINE, and check it when applying a classless query/cmd. Further, runtime mods to the protection are possible via an exported fn, or a grammar addition to >control. NOTES In ddebug_change(), the 2-part class code is mostly unchanged: 1. query->class_str is validated once per module, and maps good ones to valid_class, now renamed to slctd_class to convey non-boolean-ness. 2. in the inner per-site loop, site mismatches are now 2 sub-cases: a. a class_str given explicitly, and site doesn't match it. skip/continue. b. no class_str given, _CLASS_DFLT is inferred skip if ddebug_client_module_protects_classes() else fall thru to site-change CC: jbaron@akamai.com Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- lib/dynamic_debug.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 68b5a77c2d79..9a278c7ca365 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -193,6 +193,17 @@ static int ddebug_find_valid_class(struct ddebug_table= const *dt, const char *cl return -ENOENT; } =20 +/* + * classmaps-v1 protected classes from changes by legacy commands + * (those selecting _DPRINTK_CLASS_DFLT by omission), v2 undoes that + * special treatment. State so explicitly. Later we could give + * modules the choice to protect their classes or to keep v2 behavior. + */ +static inline bool ddebug_client_module_protects_classes(const struct ddeb= ug_table *dt) +{ + return false; +} + /* * Search the tables for _ddebug's which match the given `query' and * apply the `flags' and `mask' to them. Returns number of matching @@ -206,7 +217,7 @@ static int ddebug_change(const struct ddebug_query *que= ry, struct flag_settings unsigned int newflags; unsigned int nfound =3D 0; struct flagsbuf fbuf, nbuf; - int valid_class; + int slctd_class; =20 /* search for matching ddebugs */ mutex_lock(&ddebug_lock); @@ -218,21 +229,26 @@ static int ddebug_change(const struct ddebug_query *q= uery, struct flag_settings continue; =20 if (query->class_string) { - valid_class =3D ddebug_find_valid_class(dt, query->class_string); - if (valid_class < 0) + slctd_class =3D ddebug_find_valid_class(dt, query->class_string); + if (slctd_class < 0) + /* skip/reject classes unknown by module */ continue; } else { - /* constrain query, do not touch class'd callsites */ - valid_class =3D _DPRINTK_CLASS_DFLT; + slctd_class =3D _DPRINTK_CLASS_DFLT; } =20 for (i =3D 0; i < dt->info.descs.len; i++) { struct _ddebug *dp =3D &dt->info.descs.start[i]; =20 - /* match site against query-class */ - if (dp->class_id !=3D valid_class) - continue; - + if (dp->class_id !=3D slctd_class) { + if (query->class_string) + /* site.class !=3D given class */ + continue; + /* legacy query, class'd site */ + else if (ddebug_client_module_protects_classes(dt)) + continue; + /* allow change on class'd pr_debug */ + } /* match against the source filename */ if (query->filename && !match_wildcard(query->filename, dp->filename) && --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B14F2153F9 for ; Sat, 25 Jan 2025 06:47:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787642; cv=none; b=QLhPL3xvHuucTVez0a2uazSG8qINYiIBAeW7FzxmAcGEjEmvFOoIJVvnyeiN51aP2SnoHs+GBQ3HcpXJGnu9DuuD08CnLCQo1GqQXRrMcysrFdGhZWtuHaIGrmwpHaXlVMJ1EOS+Y81nvU9/sPPrHlgfEpMzLO1XTdYsyBJJz0A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787642; c=relaxed/simple; bh=ab0L1B4Ou9RCA65EAtgp+ERGcaYRy/hyqD9Xh3jBAUw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dpVX1y5fNEP1eB7O1PS4tMNt93PK5LOvC/iN3avpdzHHIzWcnGDJ+G8r6GVGcOTNsN6oheIzGaPwvZXCGtuS4zv1R4cWpMN+HvdMw9vLDkiqFY4a6kEZDgmoYLe67qW8Xyv8m+2yCPgvtRkc83BdEYj9QymLbyjsr0HbM+fsuko= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SlZs07He; arc=none smtp.client-ip=209.85.166.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SlZs07He" Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-84cdb6fba9bso226672739f.2 for ; Fri, 24 Jan 2025 22:47:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787639; x=1738392439; darn=vger.kernel.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=7okjdo4kzf0n9cj5qoEk7NZRKgM0oBuQJfNPebCfII0=; b=SlZs07Het0uHGN6gYl8GZLAK354dzS1HKM3aVWP/l6woYF0f3ioG7rNi8y8A/7dYKf e/rSeJznicFoAzv3UoBobFofpZ9FCqulBZkze8iK/KL18YLvcTSwaqAj+q+NDVCVbe9I S43uRiM4kiEDTupGeONfnsS+TCtDYfvG642sX49fjFhj30fQ6cWuSu+4/ob7E/x/uAFJ QhpeAxS8Cv6XL+v1thFbelcr6uDUgTDkNOvm41tYGGx7rBW5/0/GcbhEKlOXJBDNSAVb o4quTXK4qqzOd6EcT362NfCVw3LUtramHBFdqVBz/yMyI2mar8AxACyOpHH+SbZrBDP9 OWjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787639; x=1738392439; 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=7okjdo4kzf0n9cj5qoEk7NZRKgM0oBuQJfNPebCfII0=; b=OIWZL+LwZj48+50A2L5dQlLa/Xtex8IHjZmzJVhtILFNSDVgC5XnxtFCVHNs2QflHK 0759ixUucy5t1tU0RrddA49GSPSGutBfhOVb5vAnm/MziJWvY3/xu8DATBmdGK+ZXKmG a5vejcQQoWk0K9BwYgP/zeHs7LO6g/XZXgQ5EHg37nUewL0+QrMb/MWEuhDZtCokg7nt wWsx11I+MXTeeyn2K/k2ck57hQrt/3HYv8TQdRcjpiC0PnuwrRneJrTd7AuOunUXbeSj bJexU5vL/7RLMbBAR5cag54x7b8PAVhydSmbXrg9eipVbB8RNg8FSNI1CtU2AXARVWB+ eTZA== X-Gm-Message-State: AOJu0YzTn+RKPJCX7ny0dCEJ//i8OtKxbymxC6phC6y4cKyMkWkIYXvS WwMCU7ybJmQsKcrTWS42V1oPs00NNktiAonZNa9q46oFVE6NWiCvGjCOXg== X-Gm-Gg: ASbGncskLLWw+fnNxM9WYe6eWwWgcmDNHKUes9J/AXW1kizJHUhg0cXc036Y/jGKm1R dXF72kITw9vSD7TyZ3LZFdCmmPpGnGPyXVhQZfNxzoQZevbGvwG26VJKEepxAYA9cbbs6nFoQem T59EItv8dlyAoslMS9SDpq1TrIFqBLu6QTb6l422OY7eEBrl0X9ryFGWf65MXHqG55aaw5xkqIp FiP5JmXnu4FwWmSqHKgTyVdRbXLCfvB0181prQZjEWxg3Nzm+aTbC+bYZkk+rxw4tZtYF3mxCHA dugfVuDa+YkuELK6ihyfFpJ5YkeiE56CdXVj5w== X-Google-Smtp-Source: AGHT+IGSUM1TcDKPGhb3XRzoRxMh1RMpP2YSvbe13uSEF4aIKxZI5TTMJsRkfxieViI/wN1pm23ceQ== X-Received: by 2002:a05:6e02:1c28:b0:3cf:ba60:e2fd with SMTP id e9e14a558f8ab-3cfba60e6f9mr102334885ab.12.1737787639218; Fri, 24 Jan 2025 22:47:19 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:18 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 39/63] drm: use correct ccflags-y spelling Date: Fri, 24 Jan 2025 23:45:53 -0700 Message-ID: <20250125064619.8305-40-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Incorrectly spelled CFLAGS- failed to add -DDYNAMIC_DEBUG_MODULE, which disabled dynamic-debug in modules built with: CONFIG_DYNAMIC_DEBUG=3Dn # 1 CONFIG_DYNAMIC_DEBUG_CORE=3Dy # 2 CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy # 3 NB: this adds the flag (when 3) more often than strictly needed; modules built with CONFIG_DYNAMIC_DEBUG=3Dy (!1) don't need the flag. Fixes: 84ec67288c10 ("drm_print: wrap drm_*_dbg in dyndbg descriptor factor= y macro") Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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 463afad1b5ca..2d68e6841cde 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. =20 -CFLAGS-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) +=3D -DDYNAMIC_DEBUG_MODULE +ccflags-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) +=3D -DDYNAMIC_DEBUG_MODULE +subdir-ccflags-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) +=3D -DDYNAMIC_DEBUG_MODULE =20 # Unconditionally enable W=3D1 warnings locally # --- begin copy-paste W=3D1 warnings from scripts/Makefile.extrawarn --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 687EB215767 for ; Sat, 25 Jan 2025 06:47:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787642; cv=none; b=KTcClWHkwI39SzvCtjgjhN+8KIAwt28mS9GlO5B5EVIrh3zLwbXZeJaR8EBUcwFfjBjDFn0YvA2et2t/f3Bk7jC52senETXeWpqEzEvhv4uG44Lb1f0ZDkK4/PXpAJiVR4j5LQLMLKInJXaxPP/ZZ2vTkHrtYdZ6RcOwhUAte1s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787642; c=relaxed/simple; bh=/DGcybV4z9Qrjh0SfcfK88h7n1S5ljrhXeLGlAviCN8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cVDa5OUHkytWP84I6OlEgBR8YAsEznbwc/ukl1mG3FvQ/U1zPskjwLKmXKJ83LiNO1R79upNMY/X42MinoLpCuP2nBxSzjuBaMFBLIZNZI/Q7PVZj30tPBAm+jwzmfSInqVGpu1CF/6FF3TCEmvd6MdEOBSgW4bjTBuRrF+ZTGM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=E26CO3Lo; arc=none smtp.client-ip=209.85.166.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="E26CO3Lo" Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-852050432a8so79392839f.1 for ; Fri, 24 Jan 2025 22:47:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787640; x=1738392440; darn=vger.kernel.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=LhR9o1TqB18h8Gejof58ltJDYupe0+A8Qxz5wplRn78=; b=E26CO3Lo2NIP26e5JM5RFF2aZmFbzn3dzeLembKkoE+NoLri+DoNi8cX0Jo0DE4nEf SwctgyMiLagMVxPXj1jjMKHQnrE0mFt0c7TDAZJ7FXz1kYSIXVf9ehpS2uejzhKBH6Hm FnODC8M0HDs3BrlsMPaQQEPNW9xdCxxdNeWGVexXWJ3li7Ui3zU9Ubs67wydF15LcvVf D9uzzBxHKnGx++K+7uFQRdCuULj0A2mb+oaGSnNPQoIx/OggnXABur+h8bsi/lJnm7KG aTkZirch1Rv5J8zlWEmZ5LkWrp8q86DFCRk5OmxnV9yIbL1PgvVcdv0J2pdaNtyr7gAj xZfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787640; x=1738392440; 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=LhR9o1TqB18h8Gejof58ltJDYupe0+A8Qxz5wplRn78=; b=HAk5n0YNAs320CJFYuHcuzaa80EGO25TL5gHkGWZVWPzy7ke879cniNS0WeCtyNS70 ZYEhHpXIOq9qSWTGiEKx9a1twS8lySjC3PLDZPvS9lfRVElL5s7psL6X2ujhf3CuTqV4 qKdfB1OH7yrsckRYztxLmcITdEWY2J0mK9MMT+2ycFe9UDD78kx7GQnM1Fv1O1Ziunqx utp6hupP8oFZQ7FBSp8i2m3LfHVuNIK2IbQpskR10oEtswMBGYr7eneJwUp9zv89A/k6 6I7EZAZcyIzWrKz2tZ9ZGj2qNAZETt+lxbvkikGARXoaJQ1HNCIRoSrKAQBCc3OTyHmh DAzQ== X-Gm-Message-State: AOJu0YwZUmkkT4mfC6RtzhIlvVhS6us9iHIaY6CCb+4tzHaJe6KNqQP1 oFkhqj8JU5/EioxS4wGB78nkZeU75xgquT9FplPmIY8PHo6P0mTVicsOAw== X-Gm-Gg: ASbGnctuwYrAU4KOS4HqeB26JFEl1X/yeCuHue0Akk0YvsD1lxwtto4tW+ugcyrzM+9 RwQl4KKQM0asFenGDw4K7qeXJa9DfwnUmf5h5XAkkwI0zjvIrS7L0qsAFMbiRRW5thw53w/PELc 9HQ8tFki4H3/DJ4qHAKEFIUVoVeVpWqBboVfWvupMhTT1M/qdfTIS2kv+ku/rLhIEJ3W3XUnYRS eq2w7PMKXguyEP4pdljlDpK8qejaSJFxYTmOVh38qvbEDRI0w3gtiaNHeTM+QyqJIharXN0EoDt AeY6aIbyGaQEq23zvmFoSTD093FE+U6q0JLBHw== X-Google-Smtp-Source: AGHT+IHZEzBNBYNOEBBToI8KiDl5Tsa5XkYH0RjpgGMIymyYt3NOZibANggXDZzgs4FwkUSL/FRdxA== X-Received: by 2002:a05:6602:280c:b0:84f:70b6:d827 with SMTP id ca18e2360f4ac-8520bde410dmr633621439f.8.1737787640439; Fri, 24 Jan 2025 22:47:20 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:20 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn Subject: [PATCH 40/63] checkpatch: dont warn about unused macro arg on empty body Date: Fri, 24 Jan 2025 23:45:54 -0700 Message-ID: <20250125064619.8305-41-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" we currently get: WARNING: Argument 'name' is not used in function-like macro on: #define DRM_CLASSMAP_USE(name) /* nothing here */ Following this advice is wrong here, and shouldn't be fixed by ignoring args altogether; the macro should properly fail if invoked with 0 or 2+ args. cc: Andy Whitcroft cc: Joe Perches cc: Dwaipayan Ray cc: Lukas Bulwahn Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 4a93b2ede8cd..8933bd30317c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -6046,7 +6046,7 @@ sub process { } =20 # check if this is an unused argument - if ($define_stmt !~ /\b$arg\b/) { + if ($define_stmt !~ /\b$arg\b/ && $define_stmt) { WARN("MACRO_ARG_UNUSED", "Argument '$arg' is not used in function-like macro\n" . "$herec= tx"); } --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D856215F56 for ; Sat, 25 Jan 2025 06:47:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787644; cv=none; b=SYBDdnTtXGwRxA6OPlt3+CXdewpajjAMG5PLnk+FdM/JwNVyj1QMXVytSatjmJEVJ09pstjx68+SyAVti5HtiZBhOHqiKkn30O1l9RzXIr6SKnobABbhGygo5Eb0RnMYsOJWLRTIVv66ZPOxol/2XzFDe/KKaYmSI1fOSRtG9is= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787644; c=relaxed/simple; bh=xxIZY+fJIyYPzMEKPuqRGcLjcSrnEj0Z8rlD/3fw0+8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WPCOL42R9c8AsUBxQcf0dzQsB6IOOsq2uXSfeR3cgNaPUuGdk/0xbKVOkmi2hD7ERrFzMLgcX66TGzC7i0wC/3uKOYyChkt92xTnC3w4BduCDVLsTfW6dpto2AMBhqy3UK4ZnsbZIiDGT4/aeJbu49ZeO1A+L0PnPMP7P4jYVQs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SCqUg/rt; arc=none smtp.client-ip=209.85.166.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SCqUg/rt" Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-844ce6d0716so215113039f.1 for ; Fri, 24 Jan 2025 22:47:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787641; x=1738392441; darn=vger.kernel.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=28x5d6xbEGUAT7PLrsu8ZHGSSAEZicMzeP2EW9a2UNQ=; b=SCqUg/rtEBpTW7BQnn+q9oyfIANLLJ/MbrEB3LLTZwrmcSW2TpYdJQRFdBLAQ7rQI4 wVyUhgEXEO0ym/BPMSfxQQhF3ewRdkTe9cl2dAx+qyp4OBjQ6NjgjGXoZTIBqGpaEDNP hod0rk6tM2hZWss1eeBLnvczu/P2qnZuHzXhy1gAyAB7mUQmUaDVOBnQBjniEmvsfkga ErGEURWcAETbfdsWvtretnFqBQUuZMX+l8Zfrdf9ANbcRFoCGv3AVGwFVgY9VVq318Zo pvPWMxQMnYsbjRv32Ttw9m/Mblpk8mghYNu/CN0LJjgtihO9dHjZTz7UgeusFKtpL+RE vH4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787641; x=1738392441; 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=28x5d6xbEGUAT7PLrsu8ZHGSSAEZicMzeP2EW9a2UNQ=; b=nLprm6uwGF+L2AGFwdbxUTSdgLl0gpdlbvmOcnh/1XapUuir7SEOSp+9GxhvVPqdEW j4ldkQI+Ch177FR0aRlwy/KbBQMLGtkWFqddQPXPCPyqtl7FaVgrJwmHzIs5OP7NzNWd F5gsHLj8m+0oSh9zjZlFnakeJmr0ncNnG1GddI7ZxjT8spGmjsjOqBJufYTp75leGVic yqYi8hCXyAWDyHgFjSgEauI8SfdG2A1YPmu78tuURML++r5R9tjs5y0Xrkuapq+tPy8d C5fc2rPaqVAporN7TSOc8cviAGdhq1jEarWEIBJJieVkinz0UqM7HyszHwNPm/4FheZf FEVw== X-Gm-Message-State: AOJu0Yzuvs86sh/GpOT77erEYB+jmPG/JDITFs7QsV0+45JFk6Mms6AQ lyYwSkoHWMgABauDAs5xFySpNu7viKVw7T9SvvdF8X0sgWn1KygYyQaocg== X-Gm-Gg: ASbGnct9GNaH7wWv4z5CgSHvSoWLBt+ZbL2xbgOFIhl5wCo/PrAxt7naSMRZs/GtskE ln8TMxsu/UEptppPZq+LRSR6gQtfqiLOWMLXsvaMoUjSjOar5OkJMn+KsmgN7xadkH+cT5+e3S4 PHn6j66CJmOrya01t4nSFtZpou0mwishm+W3/tnowyg5RBCyzjaQzn1gCDXLXvlE8WoS1C/ZLRa tb3vJD/ZqDME4WRZWnL77SYr8LGzYkrxhry3hEYGsrjDhGtXNmKLaV9pe//JbKS60XmzAGTBAy1 rUiaKcRKqi/6FAVqN5QPC0DkcTHPVhuQ9IqnPw== X-Google-Smtp-Source: AGHT+IEMKrFEKpi5SUwkWWCosuXW3ioEVtU6ebYP4sTFzqjXc9Cj2di/duqbptCHxcYLBwKuqsDHFg== X-Received: by 2002:a05:6602:2d91:b0:835:4cb5:4fa7 with SMTP id ca18e2360f4ac-851b62b1c79mr3161244539f.12.1737787641477; Fri, 24 Jan 2025 22:47:21 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:21 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 41/63] drm-dyndbg: adapt drm core to use dyndbg classmaps-v2 Date: Fri, 24 Jan 2025 23:45:55 -0700 Message-ID: <20250125064619.8305-42-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" dyndbg's CLASSMAP-v1 api was broken; DECLARE_DYNDBG_CLASSMAP tried to do too much. Its replaced by DRM_CLASSMAP_DEFINE, which creates & EXPORTs a classmap (in DRM core), and DRM_CLASSMAP_USE which refers to the classmap defined elsewhere. 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 Tested-by: Louis Chauvet --- this ignores a checkpatch WARNING: Argument 'name' is not used in function-like macro #70: FILE: include/drm/drm_print.h:148: +#define DRM_CLASSMAP_USE(name) the macro is empty, and correct. only 1 arg is expected. --- 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 08cfea04e22b..8f7b2aed81ce 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 eac= h 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"); =20 static struct ddebug_class_param drm_debug_bitmap =3D { .bits =3D &__drm_debug, diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index b3906dc04388..46aa1bcee1a2 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -140,6 +140,14 @@ enum drm_debug_category { DRM_UT_DRMRES }; =20 +#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)); --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69F60216382 for ; Sat, 25 Jan 2025 06:47:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787645; cv=none; b=fIHWJ+yydWwm3pq1jPkrL7GJwwKDimCKpve+ctk5eJotDy9A6AUHIp3X6ASdjMsvL7GnfPGQ7Japd7gkQ+xR3TGjVB5JBQzp9+iRFX+3bMiE10Z6c7+DtEio4tIgAo6bcZ6WJPTcbBdvF2QPN6rX3Ktu97vh4nvwto/QbTIGAdE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787645; c=relaxed/simple; bh=yYRG6RQgN5WFKSzQ/lHHD5ISD4qqrzINoLwFJsXrzs8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KzDX687wgJ/OfRFCEZg+lc67PCf1GMO6hoRrbsDcrvJe4CWVSRNPwdubudH9pt9qgn6TPMBRavB+Gs1bq0265U0Tr+DV1eBS3osUGaFbpeuT/RmH6OpDtgg0qJ9BbO6S1J+regaKRDr7Zh2N3j05Jl2AJZvM68HFtRjEeOQrQJU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ad7lm9WS; arc=none smtp.client-ip=209.85.166.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ad7lm9WS" Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-844e61f3902so200575839f.0 for ; Fri, 24 Jan 2025 22:47:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787642; x=1738392442; darn=vger.kernel.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=CdP+5ahFf+s27dJYZ4lT8xt9OBauCFRo3IWsY0YnyjQ=; b=ad7lm9WSYCpfLq7wB7QzfUZoCbm0Qb8SUNXbRwy/1gzNDnnfyJWw7sKQbCtRjYJCYJ A9O0pM5/z2d+u1wXUqXF/eptiHl6a5/glvo9RBuxFFzVxVIeG/X83jOztnbwzRukp10b swDrF+C3xQasrPnWXwVX77AlKzp04wOzMRUbS7G1A2kl/yKRtpKwT23awm90uoQIuWcY zLwLRaLcoQMEd+fBKgBbk0xmI+rj4w7P0G2VW3lLpn1odzsnNMtnTKtFQS/7DD6+gr1D LAnfJhL/5k3SG0kiuLpmt2DuzbTgvBQw54/OU8Lqf/gJKg9Up+ighLuaAZ65rzS5uQnb rvkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787642; x=1738392442; 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=CdP+5ahFf+s27dJYZ4lT8xt9OBauCFRo3IWsY0YnyjQ=; b=kVpEo9IaEruK3rUzl5DHX1gBAGLUpvqTiORzAH8uWR7qmxpSJE0JLddG1j08tF0AqT i/12Y39au62IZwu2hijzhq1QMtt46YpDkxVCX+t1hajOTojtgWzrAvlHj0RM4efqahRW XhYI3azIILfmLx+Vt4YXVKPnCdJMDU1jEJLEaUdW769kSD9yzF5a5k9egUFtyfmXIsRh aA4dd185zICc8XndnOiiFP2R42zOF2Em9mmcyHFDi740goZ6vrjb5F4nWACGzfGomPiA nQXkticPyac2MSLPOq2pHVqO06fAWYkUoLPTkpntfhX7y/LETt6PBCcsHiYqP3PIuD7k VOVw== X-Gm-Message-State: AOJu0Yx9sFSp7VdgpH3oHTnsMzxecCBGk1pItmUJYpn5CGz1i4xeDvAR i752q5P+tZovZLwl0AKooXaTTpPC70HKj49MzH+tlxKFvyxgZmGG9zd9hA== X-Gm-Gg: ASbGncupvvUzeg7R4b3cggH0Mox+OcjMaDLQf4PcEinVIqoNYghQygrD6L4qNGdzodl LwWm9TG4lSAaTKhudtzYALir2VyZUVhyNO4QJ1NTADZs1hmKXcEK7+KqLGGrhaEYbbKaG4aZmop 34zqrkKFpb84Nihpt8QNouDHfRrUBkHW+Egr8dnksdfNSEtaasmiqL3oBwcSxKf3WPvw9TLeD20 ilCiR9sot3/NYrJxtykvLp4mvBtdER6sNHgWZ9rdgWW748q8fQ2NHUeksFOt/sY/7YjXKeMGMn7 Lp5p4f9vhqyTpby+hfyMs4VeqcTQUiQk4V2aNQ== X-Google-Smtp-Source: AGHT+IGP0GWDKG4GMuUlLSKsdtYWo97WA0h3IFnQzW7R7bdxh/A/DFPj3CVg43yxHZDS7JI/Popefw== X-Received: by 2002:a05:6602:3c4:b0:84c:e8ce:b547 with SMTP id ca18e2360f4ac-851b62b1e17mr2865443039f.13.1737787642440; Fri, 24 Jan 2025 22:47:22 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:22 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 42/63] drm-dyndbg: adapt DRM to invoke DYNDBG_CLASSMAP_PARAM Date: Fri, 24 Jan 2025 23:45:56 -0700 Message-ID: <20250125064619.8305-43-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Invoke DYNDBG_CLASSMAP_PARAM to hook drm.debug (__drm_debug) to the DRM_UT_* classmap, replacing the ad-hoc wiring previously doing it. Add DRM_CLASSMAP_* adapter macros to selectively use DYNDBG_CLASSMAP_* when DRM_USE_DYNAMIC_DEBUG=3Dy is configured. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- drivers/gpu/drm/drm_print.c | 8 ++------ include/drm/drm_print.h | 8 ++++++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 8f7b2aed81ce..b5fe0c37dcee 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_DIS= JOINT_BITS, "DRM_UT_DP", "DRM_UT_DRMRES"); =20 -static struct ddebug_class_param drm_debug_bitmap =3D { - .bits =3D &__drm_debug, - .flags =3D "p", - .map =3D &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 =20 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 46aa1bcee1a2..53b62b6459a0 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -141,11 +141,15 @@ enum drm_debug_category { }; =20 #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__) +#define DRM_CLASSMAP_PARAM(...) DYNDBG_CLASSMAP_PARAM(__VA_ARGS__) #else #define DRM_CLASSMAP_DEFINE(...) #define DRM_CLASSMAP_USE(name) +#define DRM_CLASSMAP_PARAM_REF(...) +#define DRM_CLASSMAP_PARAM(...) #endif =20 static inline bool drm_debug_enabled_raw(enum drm_debug_category category) --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85D682163A4 for ; Sat, 25 Jan 2025 06:47:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787646; cv=none; b=God9C0kTaZ+2gdsz63OIOIj0/UL58FZtaIivRV1x4IJs7Zs98+DmDz5JIogI8rTyR6m13sD9yZkJ+397X5iiUNfx29CIuMGCYUUp4kgE2FUIP0b4cN/zcEFhFdpcZZKwgWJtg1yF30YtDIuJNZ4AvSoIx+M7i1KRegC74eybJHI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787646; c=relaxed/simple; bh=+wjwpsPj/1sPPCtA3vtTlM8eMk+tU17VlVzU6QrjcdQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NzmlbkyuxiLEquk3wu7yzz2iwlTH35PDL2APJtF2sYC/iK7AgD+Ok/LXixUrVnUZPUdzKqTNfc8tDyDlTT6drMO5eXvxKk73ZdHBCRA7okJvAO0LuLY+r+wPHzOMvfl+OX0TqHQ7BFnGeHBxCcH5KxJ8K6sgVvx7icco0hzccNg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hGHtPyqv; arc=none smtp.client-ip=209.85.166.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hGHtPyqv" Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-844ee43460aso183965239f.1 for ; Fri, 24 Jan 2025 22:47:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787643; x=1738392443; darn=vger.kernel.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=jK0UrBy056BGUqJ1ryqJN7gZOTsk9pTFsv0ec8+B0yU=; b=hGHtPyqvojAsmEX3KJy0sxRedcRbYR4dt84MQ6vrP+g6NSVj3AC1qlHVjtY9xrRUW1 nlokq5THFeCxcBMFQvQP3j5yxFb1QBRvvT7WK9xYZqnmgEiMcrkxPF8nI8MJ5lVqO4tk Au/HGDKRW9//inxwJse/o9F2E49mp6MVW07L+c1D7dQBtrQTP6gQ9GDBTjjhtlFrocju L2M66DL4dWcWBRQ/x3NhB5o72bBTYUTmwC/TvURBUiRWaoZgwWvmr+AjHivWgwS2KU+h dufPBXnn0Xr8vHnQUXfUklBBri9aef4pS3hbuamaHjOpJgar7VQf7tUQkdE23JLyd9b+ pV4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787643; x=1738392443; 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=jK0UrBy056BGUqJ1ryqJN7gZOTsk9pTFsv0ec8+B0yU=; b=IBwA9Ge29yF3QLy6uQjqUksDY4Mxs7wIxrmBmJ/biQMuGzAWdZDrw3VnmjW3fOK3dW PpLmfSyNOabTXBNnZK8AFUGZR0uylugHsxxsTNYrr/2spn4mNJcsPz4gYyW5ulOYosaV W1m9M8yefumJTdk2DvvHWSgsCBmxR9Bqh5T7Xze/5wss3Ybk4MBb7ZYIORDHIEElpkXC G+RMhF5sm0afDLlrUEspv0v8AkLaEZThunLZVUndUc0zQjIOBYhPRSjXAVT+YdT/eG6F uxw0y+PFAFV+2v30fifPAGwIynjffqpOndfAgw/NVTJbM93urMffVkey6eiJ8Q9A8LuO ovqQ== X-Gm-Message-State: AOJu0Yz0DZG/KUFNzyr35ffXj4yuEeTY7v4G0YRvHK5hsd2pmYVGDWn/ BrApwWL+qNeexM5jchJf1oK11+MHDHgEJneFqnHYP6r2J3wORkqGCpLiPg== X-Gm-Gg: ASbGncuP5sKGRWED7kZRSo+8um0Kwp/jNgE9YRZasctGcU1BLV7bGm8Yn9orkOzQm0l uJXjtt8+qp6G3dG2ZsSlxxJnCpKeZDnvbG2Gl6vSlbC6KC1rrj87ZQtLPr5Ve02hhdDoDwRHCf7 wqvWyz3x8QeERhLg0jteypmyvp366N2om09y74znmNSTHDif+lvMMlyb+MSE7HghrINRLs/A+Qg 6jbnrzFnYgBODGrvUkwrY2At8CqQKoDH+MAUAATO29uueNQsEOmqn3bFzYZPGZz4qQHPcaiipXo BQCs1nbHNDBsRA4CZS3QO3rdHIuOQdon73vkZg== X-Google-Smtp-Source: AGHT+IHayxOMJs31PstVOcXn+82f63fxvtyYlv8CLQzhR0Q1eGOVyp3qvY9W6qSZ3tkYze4hI3v78g== X-Received: by 2002:a05:6602:27cb:b0:83a:b500:3513 with SMTP id ca18e2360f4ac-851b62426b6mr3493044439f.8.1737787643439; Fri, 24 Jan 2025 22:47:23 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:22 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 43/63] drm-print: fix config-dependent unused variable Date: Fri, 24 Jan 2025 23:45:57 -0700 Message-ID: <20250125064619.8305-44-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" With CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy, __drm_printfn_dbg() gets an unused variable warning/error on 'category', even though the usage follows immediately, in drm_debug_enabled(category). For static-key optimized dyndbg, the macro doesn't actually check the category var, since the static-key patches in the proper state. The compiler evidently sees this lack of reference and complains. So this drops the local var and refs the field directly in the macro-call, which avoids the warning/error. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- drivers/gpu/drm/drm_print.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index b5fe0c37dcee..dcdf21eb73f1 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -212,9 +212,8 @@ void __drm_printfn_dbg(struct drm_printer *p, struct va= _format *vaf) { const struct drm_device *drm =3D p->arg; const struct device *dev =3D drm ? drm->dev : NULL; - enum drm_debug_category category =3D p->category; =20 - if (!__drm_debug_enabled(category)) + if (!__drm_debug_enabled(p->category)) return; =20 __drm_dev_vprintk(dev, KERN_DEBUG, p->origin, p->prefix, vaf); --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC0FC2080CF for ; Sat, 25 Jan 2025 06:47:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787647; cv=none; b=mpMSXZxeSAHpkSqtahaxANMLteeZ6YtjwyJhoqi67cmCwufwoMW+m+FvHDHIRWci7PgZG+NXbRA4Bq7FwwE4AXFJlk9zStZ6/RTeuhhNCJBrULRzSGiEuIUiybxoxHBods54JLvHaZTLRiKW9S4w+aNNyfk3TnXsnYrKA9VMrxs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787647; c=relaxed/simple; bh=crjSKISjvAdhGGczqHah2I9SaZ3RVB2p90Xzl0cb5Ik=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CFQTlzAfyvqWMiBQbmfYrDJVr54Cipmt+dgBxMBbmtgQySfxyPD4po94I7Zj42+/Qyvsnb4aV4KxZHqj+4P29sLfumq4x2/3KjNSY1HguVJqOQjhkuN7mXN7hqVf55b+otqSnwV18zQPktgSztJY+DvB/QNhBSRNwI6kTrybHOk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NxUV+8kL; arc=none smtp.client-ip=209.85.166.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NxUV+8kL" Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-844ce6d0716so215115139f.1 for ; Fri, 24 Jan 2025 22:47:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787644; x=1738392444; darn=vger.kernel.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=p0te6VyEocxzJeuDOCxt40TuU8GT7eXMxXNwkYWCJTE=; b=NxUV+8kLtkdzEDvVLAH7+CT+qdtM7oUgSMaDIJb0PQ795WK0ZK0DG0fclCoNErgkz1 qLpNx29t8kQ4yIYeAxoYRQvEXDoy4lkb+oZwX8aHqTTUgArwSRWtLFrQjZkS//wpz2QT JJJW/fu0/OrgzEw5GhJyjlARHniNvkTdVYh56yxDiB27UZxdLjcYfcRJLDNbJUbiE0Ma QBEX0q/BamkZKjYgxG5RTfiRHsozJ5YkOr3q7E1xPGlWH8B1Y+4rHTfPTj9bOzaw2/Zm jKt5shAfJETflxqkcqZY9bQiszP71BFXlDS01uX9aGMu7WBVKg+OiR5c2zF8nRPksMvT bnTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787644; x=1738392444; 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=p0te6VyEocxzJeuDOCxt40TuU8GT7eXMxXNwkYWCJTE=; b=bysT2Jc2e1WmQz7z4ddvd2LzEybsotlhPOZzTUja06xuu6vRzXpC1avCYg/PI+pANo pwkyjj/4H108Ae8lZoz6M1fdv5G0lqDz2PkN7YJ5HfqSkVt8kqVbZUzKi33MmIDWSb0q 8qlhmC5C1W8ZdEWoMkAhUO85HyyfNsOaTKz1EPgUTwdLGHsr1wcLgzQ5eODWyIbSqvii wHR/OoVYIy8i6b2R0MhUvoFNSCa1LPPow9IPj1X8OUdm1Ey5DhRKe20aqw99dc05QsGH B7qFbCxnN+RBCkDzXv8mn4zBR5t4bWDCIkSqUHb9z+c0TbNBm598ykROrZbT2mElR+ub f2kg== X-Gm-Message-State: AOJu0YxxBGP5p9CivFLrdAo0XhrdODFiyNwuwn3WvwMSWPq2VUGs5YAN ypqFd4zUCr6ziiUYNGVrSAIpvN8s5HkOWrbTF6wo6sMbUknrX4hxOvzWhQ== X-Gm-Gg: ASbGnct3iQOTjPM5YBBoqtgkEK09fX/ggFtVBkAoua+6izufHNjFNXCCqR8GAT9fTig SIL/pJsrv2175kIwnPI2JruCmREnJRWP/fjNBgQH/iApQS9XhI617lkHQg0V5fM1o5MAmZNzpHB IBhtmXGemYmtuNxrioVXMowaxD55wpbICR1AhQ8AoX3Yqb4qpl/2dJvXMoVOImvP8AuM5pVGcpx sbbZ7YET0NhTHkk7mi2qwpO9rL9J77VVxLdjMjoyUwSXF/qASC+zOUnB+FWdQb66zAopW9IbT+I Sfb7Sv5fuLuIJylISJ39tGK4hhc+dbA9zmBAQA== X-Google-Smtp-Source: AGHT+IGCmjf2GomlIQcJQ2AcpeuD/T2jw/K/OqyuAgfExaAaQ7nIOHSuZwo9+1fzmZ8pVKiyG+cedw== X-Received: by 2002:a05:6602:2d91:b0:835:4cb5:4fa7 with SMTP id ca18e2360f4ac-851b62b1c79mr3161252939f.12.1737787644534; Fri, 24 Jan 2025 22:47:24 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:24 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 44/63] drm-dyndbg: DRM_CLASSMAP_USE in amdgpu driver Date: Fri, 24 Jan 2025 23:45:58 -0700 Message-ID: <20250125064619.8305-45-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 dr= ivers.") Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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 38686203bea6..fab98e8418b4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -232,17 +232,7 @@ int amdgpu_wbrf =3D -1; int amdgpu_damage_clips =3D -1; /* auto */ int amdgpu_umsch_mm_fwlog; =20 -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); =20 struct amdgpu_mgpu_info mgpu_info =3D { .mutex =3D __MUTEX_INITIALIZER(mgpu_info.mutex), --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2C9F21660A for ; Sat, 25 Jan 2025 06:47:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787648; cv=none; b=l2SfNo8VLfxFB0mji+KLQaLgZCCk2SVxcp5kwLbcYsyiSu7qqcF6KeO1s/22jYMwZabnKWbxtTnRRbbrEXOhTANMbjwcxbr/Kr0Pt1dswxbniOTvgc7Asi8KuFx8GJh15XmVT8YotJNM8wTq9iLtGWTFchs4O7W9OfYel8SlLtU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787648; c=relaxed/simple; bh=ZlKssqTrvgGOHnqXf+Vkf4gTmaRgz84XsZ06n/CEBNU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F6D5y+5fSDPMS7+gCpQcB/GWL4Q9zIc9k8UBWYfhpKy7ijd/AkeobisSkby5+fdwRzpDbMttkT/OWv63symNvcHgkWunHa0Zoq6hgMNZr3jJkrJwJwxuI4nHNjZ9LEnFrxPq8n7bOc5YnPnx0JtsynPF4IVC86FQhB+4gXejy+8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AokWerTR; arc=none smtp.client-ip=209.85.166.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AokWerTR" Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-3ce7a77e5a1so8061645ab.0 for ; Fri, 24 Jan 2025 22:47:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787645; x=1738392445; darn=vger.kernel.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=OqtI5matOTmKZS9P8ui2u3cYOkCmkkFj3gRElUN8iAI=; b=AokWerTRu3QtPJ6zNsOqVMpQ/wLsKQWmU70T1t1Ic4QdbmRlN8xFGv1W8A7vwUTrIn PEaEWgqRdIlf6qh7Vh2/OxFcvtvvvcIBOfvTGcm/cMIC5wUsqj0EnrtNy70XudiZSVZx GBA+uf0E07EdsSeF4wDiqodNpIQomWF0NtuWOYVuBSAa2hD2H0uq8BjV2eiTDxt1ZaJ8 j8ah0FfybjsVCCd0FfBKFhaOdUdCu4zhFz/3IrS7zf33UZfnCeWX6IRn5ueAxzPSdYfs owDNi89TSaVtFl+twaidor8RXnBunk9LfwilQ0nuKsb50svGirQyZp6mPI3sM3DH2gwR iQaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787645; x=1738392445; 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=OqtI5matOTmKZS9P8ui2u3cYOkCmkkFj3gRElUN8iAI=; b=cgEHG0+ZRNnWuEigCE6FjUr2kIVQYf2e3KZxXYo/Aorsb0WaW2GZjI/Iots8laPioC M/j8+RlQDtVzcEC1ah/OtI8rGlorpyQn7IN6B961SyKITpGpTQwegvDffLtJNS9jOlUL WjpLdLmsOWq1Ct/m5vHIILxl61AAAxDKmTxhmfxupngbPD6QGFU4k1sOqAJQ/N4rqO/K OKUIfFfxIenX/HJotF4bW7Hcl6ceJvMWYGR8etP73ZrTrFly4ZriqlSf7GIzO0bHf76l jGcJ9Fe+r/hPZOd2Tm2ZBbO+6rq3XOiAn1DVBuTFeuoSn1Er3Ahia6HQqC/civ4qzECM SZ9Q== X-Gm-Message-State: AOJu0YzcSg1NaV6Qp9aHNwrkh0BSz7kZxJ4uSDTBnY7dgbfn6PzYLWFS 4mqc63G+8fUH9WUzdwUtpW+/Jz+A3MFBFzd5D521jNC8GuKySMvHtvSluQ== X-Gm-Gg: ASbGncvrrLXXAyhy1SmETdrCrCumSI/kS2LmaPQt1ur71ANik4STxONpOJ5+xtRg31L 8jWWWGXI/ISw4Bc7r7Ae9YW3qDrSv2YMND3HVSkiCfjCimWb1ndFFfZSJ1+f/Hj7UxXi8cnx4rK YwmwXEP3y1uaK3XB67Eyslr1OJkjBN1VZDKReD6oYtngrN9uw2BEUGmguVkCl8wzwsVWf0pn2Fy vvoIvaDCErsb1gVx3kncAMtOAwAo40MJ8BoHNJE0EY+pLjyexkLd/S28eo/EnXLXWjTDZKkfjcE G6Y40eKvB8wwErom49WesSC3chIbeoj75opU+Q== X-Google-Smtp-Source: AGHT+IGMtD8RFeAK5aJiKHyxksBNSACUL6L/VSDumbjMDcMZoOolvucD5p/b7rkbhCRrZuZ1NimS2g== X-Received: by 2002:a05:6602:2d83:b0:847:22a7:2412 with SMTP id ca18e2360f4ac-851b623bb6cmr3299854339f.8.1737787645553; Fri, 24 Jan 2025 22:47:25 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:25 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 45/63] drm-dyndbg: DRM_CLASSMAP_USE in i915 driver Date: Fri, 24 Jan 2025 23:45:59 -0700 Message-ID: <20250125064619.8305-46-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 dr= ivers.") Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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 37746dd619fd..2dc0e2c06e09 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" =20 -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); =20 #define i915_param_named(name, T, perm, desc) \ module_param_named(name, i915_modparams.name, T, perm); \ --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24B3A216E05 for ; Sat, 25 Jan 2025 06:47:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787649; cv=none; b=AXb6ibz+7mz2TXOdp2JYlVxSSKIkQvY3J2qAeurYsTSdoJlPTjyiZXcuvl/ZOpS8WN1RBbEtW9KuaQgKwmXeOjyScFrc///ELvJU1uOwNL3o3pSjLzVB4sPTyasSRYOAYeELyhGVEz+LKha/Acbkc5Rz/mWLrZWJReV39MH3rno= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787649; c=relaxed/simple; bh=4gL8LnnV+QgOQ6JA5NnkBkOCG+fICib9V5B2AAq+Cwo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OGOHS9uhrjsAdEqxrhfW9EgNUnBGgUTHaDB6Cfln7xkKKbWsgILPx1t0wgrUfE8djd+QDR0tDBUjzZDdhhRERKHEKUrS+J6u4ywc1fVfnnezRNV+hZMEuSuA87GnUA1kAhJ9P+UGCXJxrjI6pxwSV9NN06X36qYrBMcfPwWPWyo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BrAnEcMN; arc=none smtp.client-ip=209.85.166.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BrAnEcMN" Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-844cd85f5ebso196412239f.3 for ; Fri, 24 Jan 2025 22:47:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787647; x=1738392447; darn=vger.kernel.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=fLfoUWhaMiEqDFRkLf7kMowFy2bNs5vWxblm6ukXD0o=; b=BrAnEcMN/VIX3gFnequci+4s9IIiiGZTcUwfuFXi89rWubyr2gZs645uDOpdKX/JFj uoH0FjQfoff2AeWBzfFnPFlHLBwslPosXx5JbAutEmfEDmq3TH2lO3LjqnQ6xmmtvcDG Z4c+NewGdhqTj2tE+4fxhJbPmqibMckz25Mu6vJ/GeB5T3HTF9Iavmc+FL7jRFyzvYtr v6db7h1onkmChQTuI1/IuDPb5Q1lrB4Ny20Y5RSrkUPqXB+s6dHdADbxsvdP8Trm3n5E Rh/sVuzalYW5YH7MRE8ZNtIMxbw5xHSPk3JJfBy2rdmb9iTyOSHE13OTXozSJatwYdFd GrbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787647; x=1738392447; 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=fLfoUWhaMiEqDFRkLf7kMowFy2bNs5vWxblm6ukXD0o=; b=gvy3YpVEKcjzUKORuR76p1U2+Y7v7wiW0v70KxAOdJJFscXqAT3aLqynjfOyv2ipEm YrkQQNySFZR63hgriPGLxdeWbcBGnx5RlTiarqbJrBP0l8SkcSjqvDbAkF+fjBCDblUn 0c6cnEAduPCNxfWhyOgPW1LooEUo0sErYKK4nP/Bg0zl2SLt63eeIrR+n+d/l50Wqd2e y+cuIFS6uRbn7kW5CkuRGOlMMdKigXh6AyP+Xaf3NqJQTjRb51u3UaAX+xi//+ajcFWy nVlwiMuw0vXKS7Y4ohUO1dNCg0Z0/s5uL0Ewp/i/To+dJCITIj7Ryoe1EJJ66lulAFnB dwYA== X-Gm-Message-State: AOJu0YyjjZfS6gUn/ocmh4aiyu7BNp7MMTD5XoBhJZl626R2Ykp7CrZr uB6OoDNroUzovkoRZ5DxnZwZXc8pcrejN2hjaSedd0iBDE4ktKLrOgfAHA== X-Gm-Gg: ASbGnctFH4Y5s6R623j/NBIr2mSO/sNn97Z7GMoo92/LcxE9oxis8Cgux+a4vm1/GKz J3a71E/e22E2zluIxKc6uqPuVsbeGPmOIFuC5GNAvGh5iv9OdQU/+UreZnpo7iYs9sSplZRw2wY tOTSBRae1nJqIhIIHPB/X5Mgctp2Xwz4rYO5yTDOaffOuyYTqcrof5rUbM1sfR6Bg1CEhWKJ0Lg ZBlzHxNL5fEytLG4Q52H/LWIB6K+ZlDgUlL1VRnLvP5YGYFRzlqkuwNrz4+Z6TWIrNX0JIv7jqq 5fkCEWeItKsNC8kQx+rsk0TiKPemiwXHERXixA== X-Google-Smtp-Source: AGHT+IEdJ8HqnmoOBBNAqF1bYkKrvE24cFN/Ts8+1XxohrKoBZ7Yps/ZVEmmHpXktmEoZ+ldlGFBXA== X-Received: by 2002:a05:6602:4a0b:b0:84f:44de:9c99 with SMTP id ca18e2360f4ac-851b61f9123mr3214701539f.5.1737787646929; Fri, 24 Jan 2025 22:47:26 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:26 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 46/63] drm-dyndbg: DRM_CLASSMAP_USE in drm_crtc_helper Date: Fri, 24 Jan 2025 23:46:00 -0700 Message-ID: <20250125064619.8305-47-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 dr= ivers.") Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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_h= elper.c index 0955f1c385dd..1d08d759f238 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -50,17 +50,7 @@ =20 #include "drm_crtc_helper_internal.h" =20 -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); =20 /** * DOC: overview --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D150D216E17 for ; Sat, 25 Jan 2025 06:47:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787650; cv=none; b=je4dSHF6TloZo3FGLuqOl4oIyZ3o9xGZhC1A3VVzVjSzfXIGqlvXJfGsg1eNahtn7yILcs0f/hfSW2rroPrBe7MK+azO9LYgcSgoPIVpIpzDSpIp/bO7OzNCDIVIHdCSktWKelao5uip3DhOch3oGfl7ryRO3owoQZcgnjTx4+0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787650; c=relaxed/simple; bh=gXYWz5OA3APQ9SOGyQtjNk6O4u+ajOxYQi1X+Wgj5EA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b8DlmjBg/aW8BYYnrIfYg9MDKT4xa38LoQuD4DrQuhLAe7MgPH74EJb+IrO4gpTdeIccYMNVm8UizaVylQyHU0gRz7+FGU4zLhFR2mgoObwBASRBKzkTzBcTwK0BC9Xg507Jc76YGAcWANAS85vy9ClZDeegOICT37amdXrlr1E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=i4tD4VG5; arc=none smtp.client-ip=209.85.166.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="i4tD4VG5" Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-8521df70be6so138816539f.1 for ; Fri, 24 Jan 2025 22:47:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787648; x=1738392448; darn=vger.kernel.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=a5Fx4vD8830ygmwK/CbGq51e5E9vq9b3i0UwFgjm2S0=; b=i4tD4VG5W3Ta1UWXszoJX37HalorPquDNyKFdrLQSdKHME4fjKsAfE3I1hThZTxLiT MzAjUyR/1wabfNbCY0xrvZaXMNclfLjRbns9DHPI1WLmlIABtDOkakeEOzGxi6QSgzYb fI7c8Qpr3zx/YZ3tTyXGkPftDdgQPgJLy3loyz/JALqNcuP7ra8TBkbqF/yhg8roIYYU cGn/U5D0gzGyZU0BCcLFpv3aiONV+tqS7AayjjNXXeJ9M+jcKolxmU9iOpIanHwulb0k Q6bxFgG0soJviTLitRYtM5B+dNPWXDpLC33e/fGTvwU9KFsuKSvofSMsxCPvuYL1/Z77 ODYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787648; x=1738392448; 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=a5Fx4vD8830ygmwK/CbGq51e5E9vq9b3i0UwFgjm2S0=; b=GrdDfEs7k5y6H7vUiyzhTpi+AURgQqQlWpj/D8ESzxs2diJyQgKCry0T5Rio60Jtx+ UXxgi4qO+RnIslB5PAhdN9mb3I4jXEYnCtioeOVrQzLYP/g+Esz7Z380kt7xEdp6UK56 vVxmtXyGJjiF42O86eDcasab3YSIr8dPeY006KhX2aNeWRP2ZnYMo9v3r1TbI7D91KnH j+M+jErnU6MD8mDKbGLabEn3BgrNtaRok9S+SJps9nqx9ds1UoYfy5hmQ/B769FbmiSp U5oH//T6kODkmhBQqDjgWXIKTKpV6gxiullekaj4Xxr2no4aFpts3aIvQfpDtQ0jv24c 5a6Q== X-Gm-Message-State: AOJu0Yx5uZMjjMUpZwHfjykcm7/8AzB48vZo7WXmmYbgd61HC9b4WQwr kDXRJKvT01XxL5CTqA/vMrek1y6NP8A9L9BAcQAUa+TbzIDFcmOErd6oPg== X-Gm-Gg: ASbGnctTRtmiVxYjnjQYfjdcDuJz+X8xT0LXXclHQphk1WWDmmfMJDSf6+Efm/88iCr OG32HMK3ViU887Jc0tIJA5mjbWwPMH9ahuzg9JExHG/zVNsCKKD4RxuPRTs8yvf1vpQacx6HGRu 0hmIi/NnFHWqB51wzNaHvj8P3+SZhcQj9sL/AXscZnxdO3DPu/CI94R6ZOAv/esvp+f22s5/r4k MPbuciQ2MfRxUpLanJ8W0tRHtxLRPJtkRRAid3Cu4HGiGhwtR3W8elj1X97hpb5VzG0LKAEhciY OJ9/lfqG1I09jgMskyJr5/WL8WTuAp4uL9Gc6w== X-Google-Smtp-Source: AGHT+IFRDe2KcxcBNECeYYJdcgCZVcjRpFlIg8aq2/iCR1BiW/gFQkHcZx8djmRi6ashMmRnx1PoRw== X-Received: by 2002:a05:6602:418d:b0:844:bb0c:b899 with SMTP id ca18e2360f4ac-851b6170923mr2710428339f.1.1737787647828; Fri, 24 Jan 2025 22:47:27 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:27 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 47/63] drm-dyndbg: DRM_CLASSMAP_USE in drm_dp_helper Date: Fri, 24 Jan 2025 23:46:01 -0700 Message-ID: <20250125064619.8305-48-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 dr= ivers.") Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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/disp= lay/drm_dp_helper.c index 6ee51003de3c..04884ff96c96 100644 --- a/drivers/gpu/drm/display/drm_dp_helper.c +++ b/drivers/gpu/drm/display/drm_dp_helper.c @@ -42,17 +42,7 @@ =20 #include "drm_dp_helper_internal.h" =20 -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); =20 struct dp_aux_backlight { struct backlight_device *base; --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E557C216E39 for ; Sat, 25 Jan 2025 06:47:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787651; cv=none; b=A3MlDerQO6dpjz+gZMXu/OgvdnPgI0lYboZ4Kv+QdKKbO1lEX1DB4uCGNmb9NIvFyRGOqo5Yn/AyFI+xW/Zy5dSNkP1d7WWWnQSEQFW0RXs3rrnP23+c3FWRI5EVBhsv6ARjKGxt7QB0sTGaHzOPT0jzLrbqSamBi8fnvqOrBT4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787651; c=relaxed/simple; bh=yLLRSo8kHh054d6tZ2671WxwO92rjM6wXrxvRJOxazs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ulLoGrmKJFSjTGWBOeGSdf4F2EkkFsID/Q6CmQSQV393fYkoqfA59Un2ZzmYH0otw7cCamzAPS/r2W23DXhOKQudJVn7DU1AyjlFaHOAh4Py8UDjQw/U97+wkowoenK9jOwT4LyI9n4MLrgmbNGxbdhRYHwRDbSMn5Q2R+W9JTA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ivgYtH+u; arc=none smtp.client-ip=209.85.166.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ivgYtH+u" Received: by mail-il1-f173.google.com with SMTP id e9e14a558f8ab-3ce868498d3so8477915ab.3 for ; Fri, 24 Jan 2025 22:47:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787649; x=1738392449; darn=vger.kernel.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=dejYp+eKN9WKMrqw2DFywvLty5rdJ1+8alPM8PzQvUM=; b=ivgYtH+uOb7WF0wX7errVUjii4Ya3yZnXAgcQLGPRDXBoLxNizyQW0H0s6cBz7/yEC OIdKfTiytgcbzK7mnnuyyT/CzhO9jYMJquHpLpRZ3IGRFwgbAjjMFT8CP3BmJLBoBxFW LW2qB2pUoOgxf5DxI5CuTCSkLO/fcOlOttEJUEhXNNZ8D/PbsJM37nVkNfzW4F/22tfA EMrbOamUnYnC0ZKjaKa1ho1hxAHVL+CuN0pmIaSQp+0iMarZynI4QvD6m1sRpyPSXFE7 QkfnILw+GDqe++4KHlVMWg6aTT5I/FcnPRF/sCO9Z353tAMSNFR3ysKYFbtD8jz9IW7H cfSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787649; x=1738392449; 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=dejYp+eKN9WKMrqw2DFywvLty5rdJ1+8alPM8PzQvUM=; b=Un7fp3uemFQwgwxqQO2AqBUvI+JVgyvc+MP3yQWwpQ2y44R0cjxB8l/iStSCGDVNEb QZ4LCdQWUpfI5peIbi4wKU09YENdZUBep4nmECSwCB022cZCNSIu9HWe5b1156zbksmN XC+JkfWaXq3w072QrBWjR3tbuge4FSGAQZ/W6ynPNt0IJoc2d+ojvtCeGFK/+RLwDWpq GcPxMgM+Fhps7YQS1GJ7VRphGlM4M89hU7D+0QG6sWtYsbdiYgLTv1Du0RAEDMrw0760 4/nVvxCDXGc8n/aK3P5wQ5lamNs2zBGKGwXD37uWqGsTawed8dumcXyyfBgbRJVwU2w+ ohzA== X-Gm-Message-State: AOJu0YyBFeYsOwYbZtdwfYsGf4GM2bBGPF17ff1JNQ8icaX0zbqwV2dX b08/8DgODOU6+6Rpn3U8uqdAwA6483l/UUnROJkKflCxQWQERQK2BPjg6w== X-Gm-Gg: ASbGnctiL6N8EuFfrjKaMxg0UMq9GM63Bn7rYf2YdzQjiUc6ffJwB26iprYNdjDuhK1 13r74aaEgwV9JGD+bq9so3Akk6UOvl+axOrVD64acVSmeitr12oVB9WccXIhoA74PG9/bQFPaMP uCVDXXlvR4J2iC+WjAxgtUAkUel7CcUh0PeaHS32rPUHFPy5aZrFJ2gnhLWqfhsBoFj79zRCSax j9Fz+0WcCX8UxkakP98ivvN+quadNwOgxXpp66XAQId0cdqPCUX2h7GE3eh94earaybBHMBQN29 gSTGj2f/qMLA6CTnmDsr4WGnHjdM74Zb6cEBWA== X-Google-Smtp-Source: AGHT+IEAUiOldW5NYz+yhWjZW7GY3yrwC5+bdXLqQ7WliEEkiuhkttZXPlv4GP8R7SFDqRQg9KT8aQ== X-Received: by 2002:a05:6602:3e88:b0:84f:41cb:1895 with SMTP id ca18e2360f4ac-851b616dc39mr2912096739f.1.1737787648918; Fri, 24 Jan 2025 22:47:28 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:28 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 48/63] drm-dyndbg: DRM_CLASSMAP_USE in nouveau Date: Fri, 24 Jan 2025 23:46:02 -0700 Message-ID: <20250125064619.8305-49-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 dr= ivers.") Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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/nouvea= u/nouveau_drm.c index 107f63f08bd9..416e122fa58d 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" =20 -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); =20 MODULE_PARM_DESC(config, "option string to pass to driver core"); static char *nouveau_config; --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3274217659 for ; Sat, 25 Jan 2025 06:47:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787652; cv=none; b=QAIn2o2cAl2ZCTSv7kntJorfWUq/CwLjbZsVhIRmWowuSwKNiCqBk7TDPxVKdM53e2eLbrfqR3mYZR0+yNrjeRxiLxHx1GHS2qmjPnEV9w2fMf8k2AY8aeX9lW1h9POjJQoDTQpS6q+KSvIJT1TPEgBzvdhak1KKuoz2H64DCX8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787652; c=relaxed/simple; bh=NgJ47bJbEz6iWYB71PlaC0JXjv0fTPoXY1iuqElmLVQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=puWbdVC2t2WX0FUIbEtPJs2zkwEW5/HGiXVGuglSDaXTPrdbHIQCRhsONpiWyh3JFA56dmAOAA1/+C2i2kMob8FayAPh2dDWwGgyCNFLA1A8EvK7mEW+emvlHjSND95paeGMAZ8hrqlSiLri8tOd+Oo+0FIfsFCMUJpTwDVG7zo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SZah4lI8; arc=none smtp.client-ip=209.85.166.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SZah4lI8" Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-3ce915a8a25so9044485ab.1 for ; Fri, 24 Jan 2025 22:47:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787650; x=1738392450; darn=vger.kernel.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=jU6LwNcJf+1qCGpisTck4NmcFzAnLgO+JmsbcvhTW5Y=; b=SZah4lI8dEe7QMO/7YIaFeFcDeF0BTFIeXnrPDitqyPB7xFFqO2lSgTuXboRL1Dlls IFXIMH+/4QQ8JO28PfOUyRT0MSQyIxBzgysEDcRwBAkGDn6bljCdYpL4aIVkM6L99uKG 0+E/eEPuBHKtqH8jO8oJMvFg9YKMUFyS+wpFjB1R0R53nhf7nW7d2SN/9PCjag8ICP9F //Hk6+/dfoVuwLbspMsOMsIrfCK1d7liSwgpM2wt5JIQnoRF+PUmI/qJGInjJIOWRpnB itGpBZHHIgZKMiD6AWcfz3aDmxpmx+Um+eTyax2QSdSiYhO1MWkrZxJoYH8KS64DtNbZ 7aBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787650; x=1738392450; 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=jU6LwNcJf+1qCGpisTck4NmcFzAnLgO+JmsbcvhTW5Y=; b=rp/4Nvr9I7BwjLh8FdF9xwNek6neZ2X5oPFokAbg42m1IdQI7nlO9l9sxNJMrFwXvn gRhOHAet/Y69XTtPuxnkdlYybDs/HM1X+hJH3WsLfCJmEB9AqTQtxC8cyqlhqjfPBTUc FogCU1KvH9ZzHFtULAA9uMK/zIFDs9a+JnabDweFUIigOWqh8sWjUqrVUB9yh/Azo/Sq Saa0qkz9DcjgI52PFwj3C4Kr7+kbbf6wZw/sug6MweyPJ0AVTcsBY3Ww0p6S7jA/u/XP bx97nbXYkze47QnA2ed5Mq/HSsqmS1oxtQXoZaRV5FzMjo3Pl3tsdrxqgkRlrOous/Up aCxQ== X-Gm-Message-State: AOJu0Yy/QNuRD+fy8yHSltfwaD2z+260MZAdyxEcbz/EpkacAR9dSXxy 9nyuTNvwg4gpyfFBm6byAr/H72CM0QKotzw40W83ZxrMM0Y9XCy+JunSzw== X-Gm-Gg: ASbGncssW95SEESqNeOnCyToIvDMFvac20JnoTsYHRytIigy+njWm9yeEygwEf+4nLu ol/0STL4djBAc5l5iK7Bxzsljq617EHfvt0bQdhp7ZWMUimmkenJO+pMcbumKXWexdhzkJtwkVz X5aiIvUvPtaE+mbRZJFX7W6UOvQSzoJFqKQf4Do4QbVj1vK/AYu0FhvRtubfci/K+3OYOUKNGZg zTcLiU2vgZVt0OiXLyqDF1ME42ZnAd3hhttuDzdcOJbpP+Jc5Cvy+j+WNT/PbQluBUXQDIMswQM MXXnyhUy8W+/Lw1JkKBoGvzyjNDFrIYfoLp6tA== X-Google-Smtp-Source: AGHT+IHa2Qexgyp2+jWWz3OzYTEauOKi/oF88Wv+H5AMShMh8gmnOOv/yeYeTqHTM89uZp3AjCMbVA== X-Received: by 2002:a05:6e02:2383:b0:3a7:be5e:e22d with SMTP id e9e14a558f8ab-3cf743c99c4mr293832725ab.2.1737787650054; Fri, 24 Jan 2025 22:47:30 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:29 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 49/63] drm-dyndbg: add DRM_CLASSMAP_USE to Xe driver Date: Fri, 24 Jan 2025 23:46:03 -0700 Message-ID: <20250125064619.8305-50-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Invoke DRM_CLASSMAP_USE from xe_drm_client.c. When built with CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy, this tells dydnbg that Xe uses has drm.debug calls. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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 22f0f1a6dfd5..6d36c2ae4f93 100644 --- a/drivers/gpu/drm/xe/xe_drm_client.c +++ b/drivers/gpu/drm/xe/xe_drm_client.c @@ -21,6 +21,8 @@ #include "xe_pm.h" #include "xe_trace.h" =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /** * DOC: DRM Client usage stats * --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E61CD217674 for ; Sat, 25 Jan 2025 06:47:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787653; cv=none; b=Mbs1lSGnQ0WjSJExuNBmnCJpUKV5DyRN2ICU1SbaUc92JzbdakxtbZO5Yi4hKHic6kn6piVUiv/aPbdMDO4XLh7o4quyKMa1KncLg9LJ6qSfH39VxLchQFpExb4WwtnwITQFAummdrBhXx1ScIrawlp4+eRZZLyX+RqRgRvhd44= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787653; c=relaxed/simple; bh=N7SoY85Bs0j+Pkj1pdasAu+hgXhcChZLaSvrpL9qiKY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XnB/ArdbGVLzNffRtqTZu5bqT0mKoUFEpAogHwvfwqUC4xMUDBmFo5tJZV4WwW2j/3Ch2QS6CEUkVvv23SamxSCBVWfqKWiW+0iJu5A1guDTnuIPENs79XsWMJsxyooh4H+n0sYjkpOp0Ue5AkSQXTQel9700pUANFbRR7HdIpo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UJEcSUSt; arc=none smtp.client-ip=209.85.166.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UJEcSUSt" Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-3ce915a8a25so9044535ab.1 for ; Fri, 24 Jan 2025 22:47:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787651; x=1738392451; darn=vger.kernel.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=bLkPNu2Q5EYmviVwXAixj7ZJhhmJ3xs87XYWfnwbjNs=; b=UJEcSUStinmSTiuoWhWoJjGZiLstrxwpH5rKjvdiJKOMrvDxXhW9JB72lLIam+CW62 Mh+hlvnyW3XNGbExpY4WgA4nDVPF4Aldar6mtzsOzCVC0YQzg2gyhQd1urgrdVH51hFC VTiKzZ+QVQiB0BYpG2VWS7RGSjqImOCUGxuiN3s2iMaIHmbO+ZiLVfv88Whj6JIIvcvm Vckf+iraXHdspXAKWdTRb2bghPfMLlamUbtnPi7hNGEW3u18GMiftdaTOUdAYrZ3Kl62 RglEPzcbYhMStKsIZSn7yqX2WDyQPZRiQgLAXcaHNclxmVpdzj/6LkL/M4FvJ2kv2oMA BAaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787651; x=1738392451; 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=bLkPNu2Q5EYmviVwXAixj7ZJhhmJ3xs87XYWfnwbjNs=; b=U/yMsH9N25pxb0G4/g7dVP/CiD72iZcGZVoXOT4TIwLGufkxDm0jTty1XKyjOVlJu0 joxfpVAL4yxR6gUg40VOWJoJYCxmSfhpnnW1ChMpNsA5HjYqvau2RsFaxZCiE1yAoZae U4RTqE5c5T4Irk6wpH8sD9/H81P6G1lFlP2XsvVDOni7IrsDOiz5d099r8I5z3hFKlio et95vgymB7mUbN1IIBXGYCtGp0YqrxV8iAcyRF1TIG119EVFhQN7WmS4AAY8byptFmDU k4oyy7tBEgqQiiva8iRF7YpcrU+VPhxPxe+slSklFMfN5/h5EbY6Xr/oNVYcVOGQqtNc BMmA== X-Gm-Message-State: AOJu0YzI8VkrmcGduzUD5mb8G8UH29pPBAVAnfd3cxaezMAJEmRkmP9G CtkH4iG0dCA5lv5ogRkl/PRnbGTnJa6yRux4bVHjkaFyl33M97+KKVse1A== X-Gm-Gg: ASbGnctMR2qHh4dslbcXvbTAKQTh8EvAX5qX2kiItU04ngrJPGns87+r+huvwqxWkkS xk88tDWtnkM+T52IMp95x2B2BCOtPwqjkXtITA9Q4i5LZqPqsNPkTobRWlYGb2OowwYD4DQZJhL YPVdea29RmQjYSRORo83OYEpf87AJlcNpULK1xjZlu3wHDbgMr2y1/ONKQWf7YWUdGq4If3Bncj twYmEcqc3k+xuqL5nUSOUiH4uSljHF3QPFjjo/huriAXiWVIIfy7X0huVDSudETucIGNFsJTK98 soXvOVzRCH9wSMZUBUSWb+oKrigGOEHD7ZKrPQ== X-Google-Smtp-Source: AGHT+IE+1sdA59rvtPU5SkxEWaRpr0NIdPh+RV46664Rr2xVtF4kdC2MMHfvNMK5CKli+LmN1bSAtw== X-Received: by 2002:a05:6e02:170b:b0:3cf:b365:dcf0 with SMTP id e9e14a558f8ab-3cfb365f19bmr116839155ab.19.1737787650985; Fri, 24 Jan 2025 22:47:30 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:30 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 50/63] drm-dyndbg: add DRM_CLASSMAP_USE to virtio_gpu Date: Fri, 24 Jan 2025 23:46:04 -0700 Message-ID: <20250125064619.8305-51-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" virtio_gpu has 10 DRM_UT_CORE debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/= virtgpu_drv.c index ffca6e2e1c9a..fca1a1250161 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.c +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c @@ -45,6 +45,8 @@ static const struct drm_driver driver; =20 static int virtio_gpu_modeset =3D -1; =20 +DRM_CLASSMAP_USE(drm_debug_classes); + MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); module_param_named(modeset, virtio_gpu_modeset, int, 0400); =20 --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1938721771F for ; Sat, 25 Jan 2025 06:47:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787654; cv=none; b=ku3evuVJRc5iU3GWLBcGdpV91Amp4TEC4fqrHre8bI7ZZIybDKgnujKM40pKDKnVQtRpTLYQRoWc6wPK+BvU/SdK5JsJ+NsfLYuZE++u7IUxy1g1kTRJZDs7vl88LlKJK/0eBpq5UOxteYjYRMeD67w3zOBkIn9M+XCKCcaM5Xo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787654; c=relaxed/simple; bh=w04IjhkdHn75hUariW3k6WTaUZeXOh8GFU4apUrruu4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MROviDpSW5puqEaYYzBpcVXc1/24qcRpcMLFzonIkiH1rsfcI7txDdqmUsJaU/6mE3e5L2nm1+LPrCce/if2CRqtOIHhbM3LLtwcQFS+Yjbaa+QvTxL9wBc0zweB9bL0eFJeTFOyi9V6S4DsESBT3L/FRgn1AFeSXutUZ07QWXU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KRM3SyIj; arc=none smtp.client-ip=209.85.166.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KRM3SyIj" Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-844e1020253so73050639f.3 for ; Fri, 24 Jan 2025 22:47:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787652; x=1738392452; darn=vger.kernel.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=9nFXwDpq2Q3SkKmn7wq2mLhcg7oyd+q4sRfSktkILp0=; b=KRM3SyIjP7m/8aiohe3GzdgEbRmqBBYDeabRELbvPRB6qwCXyVIDzxopkZr6ZxKUw2 lYWwPvw5VGEje8KxUb1MvV4rLz6Qur80yZ6NlgK+sLP4arElkVkE54rVoHl0eZuijFr7 bI/fxZMLyFdJMClS2JdcrUPyjW7sU3n08s6O3gINQejn0BlUvWkd3n1x4zp8QjedfqKl jPOPKxbVviLjxAPap+fYzYoV5oMtlNN39UC3XfGeD0nwgL13D6Y8oAkg+2uUYngfS01K zWd+mE6tqT2DBjIrAcxhuuXh7ipGa9kFyzxAiowgQ3tPPZhTQOhcqaemuZXx+OP4N7/u uiRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787652; x=1738392452; 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=9nFXwDpq2Q3SkKmn7wq2mLhcg7oyd+q4sRfSktkILp0=; b=hL69LOIqNsLQq+liGW5ILLhIHy1N/wSFOR2EA2Vn4BttV3mKn22osDTaLuUtT6eA9P xf8CW8sqRwQxGm61wioosoecJyFm7Yvre8Jm0GF4Kxdcp0RCB/A+eXDWhSieM8mg9MHF bTgJzy54UeO0p6d4jbGV+DTErpvcs4DXpAqSsvJ10O7bBADFIqWTNC1PDyfxXUtl8hlA EBY2TLnDwry7JAg89G1lM64aqrbJbSeMfC61iHvUVtJRXZA5s2h0dyyT0bujfRcAK5lU dT/AEQE+ujSJONdQyH+scsEsrUVjWS0KfvDkPitdys4k/Vvy2XalrfhDw60hNQNwKUuA ID6A== X-Gm-Message-State: AOJu0Yzk1hpK+MPPaklAxxswGZFilzeqeb6Om3lj2HeRLxh+UH6w2iOe Oir+kC4v5Ch9x5YsGn/UCrR+fERdDf6g3sI2IagUvn/SlGwn642Jt28Bbg== X-Gm-Gg: ASbGncvaWRf/wiSdra9rfh5PTD1OXRvNVGrxnyaeESWzRtbIbSf6vaR4qatVPeuvUoE zIIABQF8KO9QUStrdZowdhpA7OtIo/24c5/aQa+UraL0jzDCqviPe8l05B9zgM/YsZQPwR7NW+r 6rUNy28L44wdB9irLv6kb7JEXr9vtIXQzlOx+CZapKEYCCL06sR9haUfxPLZj5g7PhBjXmLm67H s6v89ckHvEutV2+VMrLRto0rtrsA0YOXTMIm465MrC111fafElJ8Umf+CtVWs/Q5mYa0GCqiS7A PmvHanAai5vLNwCbIsMiJKg/kNJhE63yaVaT5Q== X-Google-Smtp-Source: AGHT+IGdia7MRs+Xca+0tVgRbyhuswJTIMLLqTubbBnEVp0qZ3vKl3vZA4F4GsGhK46lRDAVflURPg== X-Received: by 2002:a05:6602:600a:b0:849:8540:446 with SMTP id ca18e2360f4ac-8521a727564mr600091039f.13.1737787651864; Fri, 24 Jan 2025 22:47:31 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:31 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 51/63] drm-dyndbg: add DRM_CLASSMAP_USE to simpledrm Date: Fri, 24 Jan 2025 23:46:05 -0700 Message-ID: <20250125064619.8305-52-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tiny/simpledrm has 3 DRM_UT_DRIVER debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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/simple= drm.c index 4d4f05dee244..7d9e7420d85f 100644 --- a/drivers/gpu/drm/tiny/simpledrm.c +++ b/drivers/gpu/drm/tiny/simpledrm.c @@ -35,6 +35,8 @@ #define DRIVER_MAJOR 1 #define DRIVER_MINOR 0 =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /* * Helpers for simplefb */ --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD9E8217739 for ; Sat, 25 Jan 2025 06:47:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787655; cv=none; b=R4puS1pd2hsue2YzS3uhqH22xkiBgHANxKswlhtXU53gmidkSEVWul0VcFMGepd1Z0ua1H2Pr0222PDyBQu+Sf9MQxrOO7FV518fQUMRUCdvMlJX5rzj87oMg6y0Vjn7UGb4U5RWSquXE5qWRTzmo33qifr8drEcnCL4LnmK8Zk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787655; c=relaxed/simple; bh=Dbi3QyhFWcDzjIrddgYEb01ZwTnHXfK8el2TguHnvlQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M8jNMmxiyU9Kh8NjAFtMjqGAcKqwyfzxGAWUoOKxqytTfNdtu7Z7h8PZ0WJhjXuu2+/tndIALgTi7eHcet1ApHMMKKeejPD3zrHPFrfbBBYcedE2LCbcx62EMH0J7cEC72qHzWKWuQuG/R06+P955yJF+bYuusDoqUAtyx/Utdo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=aqM/Io6O; arc=none smtp.client-ip=209.85.166.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aqM/Io6O" Received: by mail-il1-f170.google.com with SMTP id e9e14a558f8ab-3a7dd54af4bso7026785ab.2 for ; Fri, 24 Jan 2025 22:47:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787653; x=1738392453; darn=vger.kernel.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=QXJvwkX5dMWwVOOB9k5iDyJ+DvIudVbZ+A9Ut3PgCsY=; b=aqM/Io6O349wqBejZnRmzQHpS8Nz9vJaULcm15xHipbt7pRewQ9OTtTECrlRrzdvtD JqzaiT/lyqdslVxPzdzbbtDktB+jdovT6i2gQ0+w+7Kqbiyr17mIO3OOHk+pUDm4/YUW 3WOL3Uf/bB768kB2HckuDwnHfeZBqbw13DYVtdHSJY4utsXm8IQl2oo9fAkdqxsgWKOd sZJOD+J+jv4xcC86woYojL4xsnC+wYLu9HbdrnE4FJtMgfs9q66SXMYQ2PEhQ5z+qETO TAI3+5BmbBx3+SOIPpA2ZHFG/UesxPN62J+Qs7SCKmSSHHxfJs6JDjFGRyY3qiypoZf7 dIjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787653; x=1738392453; 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=QXJvwkX5dMWwVOOB9k5iDyJ+DvIudVbZ+A9Ut3PgCsY=; b=e9OVPgkZGji/3QvriI5GcsdUHXDRxOWjLbmRROB7TCFo9DNgzXKz8EU8gWLz9x1Ggt Y3tkgtwPbrvrlAJ1/FnoztdluH5mHQEH/cUBP90eVAYGzkJchGzGSBuZc1RbwkmAusWP 5r4IAEjZfuuRxSzh0hFYoddKr9TBW95N4pVo6XsQmlTjwxwe2dgUHcLRDPMhh+CsAeSZ 58Oxui9JeLT8pGFo06+aNIdip2P9XXd6UjYlxNgyWTKR5idO2dp0CuM2/ZMPA9E9w2HJ 7pLLzzuX95M3uJQbT+S2RzCkYJZftU1lvrcCNxAKylmCCvUPxIc/E0a6a7Fy7zuinC/S UAGw== X-Gm-Message-State: AOJu0YyVpt8dC7wNkwxMMUZyAoyMpoHwEwrXDG7I0uHMFjLga491dhGJ a4aXLlra8cUjYy/eKw3V92GV26zgA/5Nk8pVfzQKiN/fsmUo7ASNCMJv8g== X-Gm-Gg: ASbGncvOijSC3fzndb3YD7terXaSKUBOcHwc4Oo0aHsZBslvz+tYwMotiwHEtG83gjK Kgx0ZNhhhEJEkX9KSqUDca/pDRosu9JPhXJp/wrdp5F4VV6nwcwcHWjHflbJAqEU+V0c7Pkb6Bc B1Pq0gniD/S3Pnn54Y0lZJe9OBkyGr6svxE6NodyaWzeazdasNuKT+6u+mmiKj3aZd/j/Z7kDAS Gx1lmEkMRqfaCq4rsNKoaQZwBba4T8q44MSa4vIUKeE58nYUTjuQS/Kn4xWKuxoS6Szo6ZmHOt5 Bn71l8hyZ+y9WDVknCGReeiKE4JLTeRbB1wcCg== X-Google-Smtp-Source: AGHT+IFR8c5S4HlnxAhhQQrNs6VgmiPrwR9vlqdXV98OhQbNPjVEjH4OwoZZHaDBKr7qyvOeA3I8Dw== X-Received: by 2002:a05:6602:4881:b0:84f:537d:b097 with SMTP id ca18e2360f4ac-851b62b5a35mr2857317739f.12.1737787652958; Fri, 24 Jan 2025 22:47:32 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:32 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 52/63] drm-dyndbg: add DRM_CLASSMAP_USE to bochs Date: Fri, 24 Jan 2025 23:46:06 -0700 Message-ID: <20250125064619.8305-53-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tiny/bochs has 5 DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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 6f91ff1dbf7e..d29541aa82ab 100644 --- a/drivers/gpu/drm/tiny/bochs.c +++ b/drivers/gpu/drm/tiny/bochs.c @@ -59,6 +59,8 @@ static int bochs_modeset =3D -1; static int defx =3D 1024; static int defy =3D 768; =20 +DRM_CLASSMAP_USE(drm_debug_classes); + module_param_named(modeset, bochs_modeset, int, 0444); MODULE_PARM_DESC(modeset, "enable/disable kernel modesetting"); =20 --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A6582080DB for ; Sat, 25 Jan 2025 06:47:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787656; cv=none; b=Qz6q8oqBLnDJHZmOtkBu8JpQW8Vp+gk0LMP8b3b49A9345Mbm7jlUAUZVM4FVKC7yutQz4ZfIlxExOzdFY08vBv3vZ26ZOB8fRV0qR0c8wxTyICbAT5RX20I5TpTqduNmLqlGSTab4vqCdt3KIR37pJaCOIxmpPIo5xEk1xwA8A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787656; c=relaxed/simple; bh=mWgxh22EdTJuJg1ViWbebZd1YwZmj5EuLUMuXB4GkPg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T3lLeQ7mNQWjPVBLRIg9qceOBDjD7MTvYtfwgbl65DEByIt/kqAipVnUPvy98EYMVjgI1WLsy32CXTwJOogVnK1HRKl3w8GVW5sO8vipEHYaCK7Qx+5Akgr4ggSaNWqtXAHjShfCrOzR78ye+VWwMGyVY76KdK636DFrFqjYkn0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BBOlddeQ; arc=none smtp.client-ip=209.85.166.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BBOlddeQ" Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-844e1eb50e2so75456939f.0 for ; Fri, 24 Jan 2025 22:47:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787654; x=1738392454; darn=vger.kernel.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=QcpavcUXYAdtW417rxXVfrXu3Dd8GPKW+FYGpTZrgBg=; b=BBOlddeQ+xdUpCU814DF6CxkdbWJJk7dA0hsnAERjh3k0x88OOxbfl9+86OZwJ2eqQ 9tmhPjMZXZsdETpDn1BEIQ/OA8QkjNTi2KYowC/GMp7w85EERq9xEScZKwSXLUnnOsbn 0/vmEnDDH2SPeDxylMn1Fc2z2xpZZShSJcXQFfr4KuAjKwSAETANTWileg6g2IuAs22b tG+tsx1crk1fJpCStY7ikfsiSYihUqO5wnbl5iUgEaZD61Nq9+Go+799ao0vCLOoVH/R zMycZ0mGQsGAy1g2qFiTZi1EhhqG7MB3k5Me+DFdIaS8saRAg36bGLMHdxl0SF/+ClkY zg1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787654; x=1738392454; 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=QcpavcUXYAdtW417rxXVfrXu3Dd8GPKW+FYGpTZrgBg=; b=LkcqnPFcfbyMUr8+MJ+4nlWt69R1vNxsfusZCri1NMMiSUYQzU8qUD2a3oN9eTwFDJ 1lnZDRIMLCiz1876RGcaqNMTMyFcMvUEyvv+K0AtvgydjuXLVY9rkAab/gBbxyuSqWsY JwhoQbqjrI6MVgrUOP5hX7IUSY0Sr0YwwnQ5yg9BzBfx2h4OiVMjSpj/sQI7eLVzFfg0 l7ueKtFV3XbfOFBFH6LJwHNYMY+3uGpJneJARCEoVgCwv4SqGcGyg5Uel0xoypmstLNf PcsVbpHKA6qyrVoalKhMyMhykUimk2doPuAUmKGPoeYj0Rt4POvy//jJo6i9XnWFHQ7j EBLw== X-Gm-Message-State: AOJu0Yzjgyti5TChAdg9q/QBpX3eHjQI2+3lzV9BNJgfR7T4ugJDmas4 mcjh/WEQh7SgsbFP5t3U20xBghxYs+c9Wf8nNS73DMY805/SV7z8C7yKcw== X-Gm-Gg: ASbGncsWl+3dWb2s3TxVa1ZRl5NGqaQ3P2actOwvVddIKSpc6mqGM8E2acw45zSVdMO vhP4IS2t2t2iFUuzswdm9DS8Sx6KYK2zHw4sBBnfsBCk4NT6DB3DsTLYJF/13v2Ga5RngIrwx5Y 0q9VDsTnz4yFjdcGXcfZw6WbnCA9Jq8Pe3ERkP59gcqfNuJftXgBhVB9JtMEQaR3pYtEzHMNUvI 0iFr9Jpe8KYY8v3CnfYRtF/6XevdzkuuKan9NYHd4D3V5g1w4Sa+fuWN8X0E3WzWy0DBte2FdJU JzDB3ah6xAsGuFXAS++oqp3O7wINK9SvjMhG7g== X-Google-Smtp-Source: AGHT+IHqoKSuGlX+q9v1Ocs1Z6z9FnMPhWaJOuL9McgRkRNJSbEYd+QYa+WkyaLQg8Ipw+FhxU4mjw== X-Received: by 2002:a05:6602:134c:b0:847:37fe:e25b with SMTP id ca18e2360f4ac-851b62842eamr2705537139f.11.1737787654037; Fri, 24 Jan 2025 22:47:34 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:33 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 53/63] drm-dyndbg: add DRM_CLASSMAP_USE to etnaviv Date: Fri, 24 Jan 2025 23:46:07 -0700 Message-ID: <20250125064619.8305-54-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" etnaviv has 5 DRM_UT_CORE debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs as well as plain-old pr_debug()s Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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/etnavi= v/etnaviv_drv.c index a46f9e4ac09a..9c2bf8b5726a 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" =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /* * DRM operations: */ --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 12D6E2185A6 for ; Sat, 25 Jan 2025 06:47:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787657; cv=none; b=pWajhx3b0ZrPdjKiziAN8HXpjpr7N2E6BDsdxh+JErDrVuD455TknsLhS/bHkxy0JoybBXaqA+fhiAlNr+ZDTU9sSaFd7OQZkdRZxtalJ0+GxCzFM7+loiz5swv9o+w+Wm8hs9Krr0Kiz39uEeWgoiAQ0i8bc6j3qlneKr+djqE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787657; c=relaxed/simple; bh=dy3jwCw+cgf916SsjVYoRcRqIhyD6JA1jkW+li0E/Gs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jArDDFwICsTxaYSxKRlHPmiytCM67+/taafCd8HCkvxM+NzSv6Qhdgjn3Gr9ZyL75UCopmexhQ5YIgzJnIk/cUUf4c/f2ccNuMcBpww0uCXETwPfz79PszsB7v1a6QWwLtn3YBI1qlLPWuy58sjtOQT6VOc/GzR5ymp2YZf/E/A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UYQrlMqk; arc=none smtp.client-ip=209.85.166.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UYQrlMqk" Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-3a81324bbdcso21663765ab.1 for ; Fri, 24 Jan 2025 22:47:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787655; x=1738392455; darn=vger.kernel.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=mb4Ui0ZOoqST0yf5w9jN+3KbZ6kX8awp7t6bwBFZ2Yw=; b=UYQrlMqk0r+Y03HllYelpXTse0+fZLq0EFIOGUZIxUEHRcqZ0c5f55BXwcdLBAmUul Hyj7rFzlxWJH1K6ZQFkHGIZtEZaGBOum5W/efaGD4stgcje/pGDPWhAdtcm4yAZmpSwr fyAHKezhAyG/fSIN9xSfyRB6J1fNTqo1XeQZdP5TwkAIrL34revMxVzaJeyD23KCUbOZ vNp1YUpaen9DRa7I+ZAfEemBPHUTFn5j6fN4X256VuRJ/LuDpp6kSrLyC80uIBGuKnS7 QGh+3QyLw/qzJdYQz/Il1t4FXh2Go34eUVRxGDliFaK79/bWbK0eNM/Ke3xgvSwCHxHv Mskg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787655; x=1738392455; 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=mb4Ui0ZOoqST0yf5w9jN+3KbZ6kX8awp7t6bwBFZ2Yw=; b=VvuoZz3jUFH/jVuIcBQ7Pg1FRZNDn8+1KxH9w6QQYPLshpVxcn1CYBcgoq69z2dgp/ FA24gfDIbyOBrW1aXi0ZLuxlADkQWR1EEBOHIXTdKyGEvgwSjq+SRYMonyFA7TocY5+W 5/GJJVkKfNSW+zd6TM8k74JQTYPdFpfxrSbaYgSFkZwM5MJdRh709Swlh3jv7hFuI+Lr eCG9ISaXKTdR3wAH3EV7LdLlO4LQylH2oRDndBOyslLdONN4adSZCdG7KGg0Mei27mOV vCuUJ6AUQG/F9IvEFa9d73aSLJhmnW4SiNYfO1ZqY4uHCTd+usqEH5Rn/9RvwKXoXh/w cfDg== X-Gm-Message-State: AOJu0YxMeKx6ArY1pieDmTpy5vscLeKQjM5HTi8Px0BCVtaNjovTCj8s OLD9HbR4/pFAvpJ9bRdZgg4NjjIf0rsCFKorvFmwklkx7TsITV6/TO8naw== X-Gm-Gg: ASbGncv1RVvuyAw9a0P1JVVOC4chU0mQqfkQmFqF6t/psqtH5LdM/8XLSOzWXkJLygt k+R+QaUeK9Aj8nb944AyMDBgYB5hWlIY+yBrw+c7vRkdZorwZalzcWaPAEqSUAZ1Qp9HpRqftD5 iuqZA9jGNf0x5UbiKgkUyJ+IQdLtOGR7GXb0DFUin2CFFd4Cdbt2k9PQFL47027mFJpJcb9tR4k BnWqlb/Kj2QnwyF2P678IIHuDWOU9RsAOqYJSmnMFnx0PipEMrhvjD6PobVRw3p2hAdq9vRvO6c YRkZr7mQ/sIzEZ9UM7TV6A0AhuwWdsddSbI07Q== X-Google-Smtp-Source: AGHT+IGfeKDyplrBtzVGoQ5v51IvfRsTEUeek1sQmLZ+1EABwZiHBKfjiwWPAysM1nJz2q+YUDvJ5Q== X-Received: by 2002:a05:6e02:1f12:b0:3cf:bb6e:3065 with SMTP id e9e14a558f8ab-3cfbb6e3a3fmr100200135ab.0.1737787655039; Fri, 24 Jan 2025 22:47:35 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:34 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 54/63] drm-dyndbg: add DRM_CLASSMAP_USE to gma500 driver Date: Fri, 24 Jan 2025 23:46:08 -0700 Message-ID: <20250125064619.8305-55-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The gma500 has 126 DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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 c419ebbc49ec..0d53806b6f72 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c @@ -40,6 +40,8 @@ static const struct drm_driver driver; static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id = *ent); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /* * The table below contains a mapping of the PCI vendor ID and the PCI Dev= ice ID * to the different groups of PowerVR 5-series chip designs --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15F6D218851 for ; Sat, 25 Jan 2025 06:47:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787658; cv=none; b=DzLGEUvqv9NbRtTRTyl0tnOfoCN0Cz8B2s+rF7kjJsttO4oHk8T47LLNwTLWaPfCXDuEH3RrsGMd8lWzoHChT09rwC0h+EREg9um1PyM+d2fuExIfiQ7tt36oSdwOaklKouLSH9jRFTqFCsY4au8+oysAR/RTnUeR9EnXO6F6oA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787658; c=relaxed/simple; bh=FXnKjO+VIxiVeulQC93zWmfCgk3v8gDs8xABY1guQUo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f9JbaEhlOsy5fmtLcTZOtHNQ/ZUAL1U+Tj+OA0/KtLnPhyXI4AluOhIf4S0l9Zww3d6niuHA77kqu+zlvwlOVNKtO4o+dChKnrkEenprzXawJJFDhtVKTWv3pPv098bF7O5dEtVfjWz+jz7h+v/qletK+Pw8WlukJ6K4hvL3M2I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=A1a9ltsc; arc=none smtp.client-ip=209.85.166.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A1a9ltsc" Received: by mail-il1-f170.google.com with SMTP id e9e14a558f8ab-3cfc8a2415fso5391645ab.2 for ; Fri, 24 Jan 2025 22:47:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787656; x=1738392456; darn=vger.kernel.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=ql8+Sd28U3OYErawdU0P9/UDn3jtrynMdSWwaBGt8hk=; b=A1a9ltscOX78oJ/0OrdMD8QcFDQQBAPKU1j7BSydYGa1FwI/ewH/x1rw0R4SIHcDcS 3a72HnD0wsVP0g9Ja3r4ln6Tqt+grsw/CCndQ9xHyiXLYi6dWtCZ2EOm94MNa4Ar/wXX BxS2zb84o5K07vd/hnELbsUlGB75BQ0rFSf4biaZ3YwDHX2v22i4TaKIaoBrwvyHNarY kk6c0oe5R6gWSJHKtcxpvWdJoUHk4mdMbUnFcuCU7BXBFshAU4qXAWDZbM3/AqW6SL21 ASvFnpWwh1nsPgfV12AcuHxR5qBBnFJvZ2oxb8ZlHbjEzbF/we4PgXmiWjRMRAgDYJho uRDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787656; x=1738392456; 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=ql8+Sd28U3OYErawdU0P9/UDn3jtrynMdSWwaBGt8hk=; b=UOWvLi+NXfq6eU6N8z/XqqNtrqPNG7xLG1/OXoHKKRBP2/afoeXRMJIAmr+NCdUJMI JFZcs7V4mvnkibsT1wMbX5K1PvXfBzBmKzlrBKayKZFkXmcM4eGxhlZdF2Ry3Ez9Nf4c r7eRoHKZyZWrg+NppvlU3qg6VbBLXkGCO01/wkQTHa2Q8lypZ0MAuHV010fubkDaqzmr zC72oqJ4R1Ew0XVgFciX6Flc3ewzdWJT/yFfqaI0uM+j2UyOJ5k2syz9Ye/16pD4Gvap eDc6Akkcb763h7Bi0HxSasXI0kGsRphCSgezsEyrP3hP9KNPIFrIupVq+itt+z/k+cl7 rW+A== X-Gm-Message-State: AOJu0Yw98oBRmhjhHLzvDI1e36iGuorwuoy2tP8wJbLfy8M1+sl0VRxr ADLaSizVsT6qg3edvNh1svNEqP+aUwNC1SraN7+9SQYQxx8O2UMAsdW+9g== X-Gm-Gg: ASbGncvpY3QtwUz3cG/EtsnWBKKNgsOO8EWvsG3OkYvC8B/ioCeDPZICxm92Y91FnDx NLAD4/57NMr/BeUPWwEYfRhBU9KRUb6j/iNvXo92p/pcrwd7JMcsuUliCqDD8E2a/HvSGpfbFq7 d95bbk335uShxkWInKdib8Z53lUvRtkBeLJD8mWGs67YB22pdu2zeFyQPUJrh49rDc+jVqM73n2 yoSlewuxZ3sdHb8lQvUL47hG54Bg3qYbFnV0o5ZhsDA7gOD1LnIHg/zJCXr9mtGN5BNR23edTEe JCTEvuibMyGq7vH749uB/k91WGr8BmyUUbYF/Q== X-Google-Smtp-Source: AGHT+IH2IBog3sKmGnBbGJ0PnP3Lo2liPfO+4K6LPzzZwjG/QTxkHqsi6rm8EDeKjpBGZ1861EYtWQ== X-Received: by 2002:a05:6602:3c3:b0:84a:78ff:1247 with SMTP id ca18e2360f4ac-851b6286c35mr3044514639f.9.1737787656003; Fri, 24 Jan 2025 22:47:36 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:35 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 55/63] drm-dyndbg: add DRM_CLASSMAP_USE to radeon Date: Fri, 24 Jan 2025 23:46:09 -0700 Message-ID: <20250125064619.8305-56-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" radeon has some DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg about its use of the class'd debugs. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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/r= adeon_drv.c index 5e958cc223f4..beea273df8cd 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -253,6 +253,8 @@ static const struct pci_device_id pciidlist[] =3D { }; MODULE_DEVICE_TABLE(pci, pciidlist); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + static const struct drm_driver kms_driver; =20 static int radeon_pci_probe(struct pci_dev *pdev, --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C827218ADC for ; Sat, 25 Jan 2025 06:47:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787659; cv=none; b=K0jb/TC3aQILERQ0uvunoohLSA+G9/saNjlHbOGKDB5iQy7JDQ9Ix6pT8i96SggNOQf0WI2Kaa9rwBvnz9PeLBGrpa+VO6RWYs8iHTuRBpHbubZAZ6ujRDz7g7dWQuofq7RWBjhVFAEVF5zjehi0k+1Fp81BvDYmUsm/Bjk59P8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787659; c=relaxed/simple; bh=Sdc1+uAOUtIQcP6svwY0W/zPPS48J7wUJytUlI8X2lE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PgWAbaz0rV2NKep4eDrJgfJmLYbkmJY6urEGeBqrPqjaTpDFfYfyTV1eKWtsNXn9Bn45XZzU4hpXr2YVEbDmUKQLrMGI+BaqmEduwPq7VTGcj9mpft9f4oFkJQqaMeA1xR7beqKEgsFo25qUQJSRxJT+UYBDDkRC13ZAgEvydY0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ULUBFMug; arc=none smtp.client-ip=209.85.166.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ULUBFMug" Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-844e7bc6d84so90840339f.0 for ; Fri, 24 Jan 2025 22:47:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787657; x=1738392457; darn=vger.kernel.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=DhCfYf7LWbGsDKgpZFGMa7Otj3zRUhvG+D/wYe+cSJI=; b=ULUBFMugAhUFrWPVojNSdfm6klcoa90yK97zazlFdHRBv7N9a2u1b3o4PlyPnXorme AocZvV2tBMQJHTIV08LnqpUkt0mskgPvHGZcyvWT1rmr3m+vFKk3GyjzhMFT9zyhxABD it8gF5tH8w+d+/CGBSoI623DSrmkg27YntLFTgniAstJYlXRMDVQJSkT607krI93gzWG PMm44FtslikqbL5l1hizL2hVeQFBCjhp9tVWqRBB+d3bUQKObS0bggaBg8bBJmYI5CBb U+nEATPjHbx2f4Lt4/QKpr+MHxM94JWvnNu7ggoJ46rUa7aXkWZvmqf98hB7hzg3U+Ot HD3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787657; x=1738392457; 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=DhCfYf7LWbGsDKgpZFGMa7Otj3zRUhvG+D/wYe+cSJI=; b=MaGXn78IardACdRxR8FLur6JAHDMu/h5UFtf4krXNAbRhk7iFHoi2d26PwV3xLw5YK xZMcQINOAd0V1CYHyZEMNKIUvY3+wDXeYBK1BTLlX+i2hsj829WZ6ZaTkI2YhF+HTLc8 r+tGvMW1l3otr/wBmu9gp6IfJW7eU089YOV/dZFwpnLi1DohOiBtz/Krep9Hrtrki8S2 doMfF7Y8qpnYeqvii+3dReGCouosX2msi8dakeExj3fIESe8nKJpSrpAB8nI2EspV2vc vrqE4KSA7Tc5R5W4LDsmPVHX/9CgZPTTRlJ7AvTusn6z6YCgvS/0ZmQMSQnx2qJbcQBr TKcA== X-Gm-Message-State: AOJu0YzsHpAlr+XQ+C7erAfV79WgVJIxEnY/7UkOEH6/3zXgDHvpp3Ba q8+pCV9lqHeyoVVrasD4Lh/49Rxw2nGkPMpQFTbjibY4h/xPykNSWx90Ig== X-Gm-Gg: ASbGncudMc3Kwk6oqpiyurbEXH+pEgmn/wV16bN0m+pWLW1HTOxSh2rwkuunQ46WpBJ azlmCnFu6EmvgWNUH8cpbvlgJB8u9gRyU9pr5uclkVe2Fht9OfNMH3cCTLOnGTid1qGQoidVa7C eDWwdZZ0IckSoAgHksJU98Jr0xZhoBFKxdiDauX4cuvlhRez9sdGlhu5VJC3PHecH6KX/p78+RY brSrhOvy80mSgKV9dJk5qLouvvMiGTuIjAN70VAe3mjovkO+AMb1YLrM4mVLGtrcHPh7OdMQIeM CHLtDFccmsxtE2c5cZwwFV+2bv8vEv80NL+Zeg== X-Google-Smtp-Source: AGHT+IEOsWBfW6JMMeblHf07aDl8IvLJQ8Aif02FrLV5eXAYXXOlj7T/wgGUMmZxrrBFRXc4sTl7Ng== X-Received: by 2002:a5e:c302:0:b0:841:99cb:776f with SMTP id ca18e2360f4ac-8521e350512mr486421539f.6.1737787657015; Fri, 24 Jan 2025 22:47:37 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:36 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 56/63] drm-dyndbg: add DRM_CLASSMAP_USE to vmwgfx driver Date: Fri, 24 Jan 2025 23:46:10 -0700 Message-ID: <20250125064619.8305-57-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The vmwgfx driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/v= mwgfx_drv.c index b19a062592b0..20ad48f3efd0 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -279,6 +279,8 @@ static int vmw_probe(struct pci_dev *, const struct pci= _device_id *); static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val, void *ptr); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + MODULE_PARM_DESC(restrict_iommu, "Try to limit IOMMU usage for TTM pages"); module_param_named(restrict_iommu, vmw_restrict_iommu, int, 0600); MODULE_PARM_DESC(force_coherent, "Force coherent TTM pages"); --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30078218826 for ; Sat, 25 Jan 2025 06:47:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787660; cv=none; b=kzXcH4pEX0VDMkKr01iDLnYmmei0sg5WeLoxA0MvndmPoC5gzfXw+991XFG/Axi01BNksx+XaUhJzZBD5v2ZoWJbvStN2+3aGvIY+XQWfIip5xY7yHaPHgCMr2UfOzKADjZV3NbDvgnKkiPHkpDpMDFJCi20+IglNJYc8uZgeOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787660; c=relaxed/simple; bh=PquNhYXv7PgvYqEhFhZm1Pc0wZkdiF8juom17Dhl0CM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PZ3r3vYg5KpbKblbfx9cfgT/L9ZNruKQ3EHi2ddqxYP0zl/NWThLT2b0lufbQIedmurEuIr3kHE52L6RxpOqkuzYQRg32vwseaIEMH1z2eSzOn+NJZpiVqzwUqk5auN/T+VA+5dIm3QAzOpiLI4tWDJ8DwTZLBpRfx5ugN+cJug= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OxtU7emT; arc=none smtp.client-ip=209.85.166.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OxtU7emT" Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-84cdacbc3dbso225295139f.2 for ; Fri, 24 Jan 2025 22:47:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787658; x=1738392458; darn=vger.kernel.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=Ml0f3Pd8Ka4iU5aZCXEGIrryKcpgrL2K29uQN80cdi8=; b=OxtU7emTauyAQrHmwN0TngJunEWcfquZLokaVCC4avx7cAPrO31ZB3ZiuWHUi+otEE McyLhnj8IKCW1UMXLZhLyDkJUQrLrz/WGr+kDiv9/vhkSOl/2UIVY46tu+4O9VLboorc BZ7r3cUfK8m42OhpXoL3dfRHcZKZZUAr0+mAkGBA6YyPJjH/YCBr4jH5upBGBis5I2mx k0v1/YkMy3URc3p5Qak5dpcgH81uqZywqQWWS3gDyxrMdl2+FJ+zWrzzj4OlShFqlmFP N4fGr0nDi5tP/LkyMxZdBq7UWk9i5hCwBYDtM62PJSTh90kKryE+Fzu99OVm9RviFMZF FiGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787658; x=1738392458; 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=Ml0f3Pd8Ka4iU5aZCXEGIrryKcpgrL2K29uQN80cdi8=; b=VlAVKYNuunqFeuKjIqw3UBD9nYYBFp8OZ4Jf0jzEf7IFyh7wmPlVW9WgPmCbik1wXK EZ6tE/CRK/5pbrDCtBxj4AnGVoEELgogGCSDx91IpiT19nPft7h7KNxC7z6TdLZ5ksh+ Q6FTlQT0NmS93XYGe5dM8k1OxJVewtdFj1YYBx/4rE0JvJeeMZrmbnINq44jhEG3RfVP LuDvsw+i69SI1jjALylMqEqElU2DRZnVDfJqKOMU+SKzsVIHbrUUwd59Td5GhdsBmD8V 6rGsLZnYPh9XwZeHFcJnFQMeY3xaZsxttLjfzbt+S3Sv24kTk3h56jLISgwK4fXk606f CI1w== X-Gm-Message-State: AOJu0Yx7VVEkc44NwOd3+T3rtccd5Yu8uFtJ/MfrFgDIiDcklhJY6As+ iQ8KQ41/BFCjC8pAtoaQ0sqdzlRU0xIXQwkjCbPUzTeNpurEQ9+I9cs3Vw== X-Gm-Gg: ASbGnctwr6tZRZAe4DUyUtwS1QRrr6PRwq/2ksDZTrHjQpsdRpqiXc0Cqi0Zb5Z9b3Q s2ClDrJjc487WD7CQY0BDBkP7hlguOnTYyXtEsQ8k6Zta+sWeB7o0EIhE5J+zuCYZdCd4HY+7bD t2qOT/N3nIuGqgD7MJi0zI/5sE7EfNUNyDP2WlomA7AgOnyvs3SuqBzYIxE8g/cmYOEGpEcv/md MCbCHvwDRkWH/yKyEYUdvGEQy61Pl52QF/1z9dis/sPbi8gesv5D+gTGzf+bUwI4CRWytdu+yll yFIBvnfsb+QdQ3CoXC3PBfJt0DdvNm+isXncSg== X-Google-Smtp-Source: AGHT+IGce0KIu/cX2IH/rWl8zI4G4c6laHe0V/hYkyUUaTQ687Q3YC1U7XADmcyJKObXxSVBExI4fA== X-Received: by 2002:a05:6602:134c:b0:835:3ffe:fe31 with SMTP id ca18e2360f4ac-851b61cad45mr3108696839f.8.1737787658078; Fri, 24 Jan 2025 22:47:38 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:37 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 57/63] drm-dyndbg: add DRM_CLASSMAP_USE to vkms driver Date: Fri, 24 Jan 2025 23:46:11 -0700 Message-ID: <20250125064619.8305-58-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The vkms driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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_dr= v.c index 2d1e95cb66e5..4d6b525dc5a0 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -40,6 +40,8 @@ =20 static struct vkms_config *default_config; =20 +DRM_CLASSMAP_USE(drm_debug_classes); + static bool enable_cursor =3D true; module_param_named(enable_cursor, enable_cursor, bool, 0444); MODULE_PARM_DESC(enable_cursor, "Enable/Disable cursor support"); --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 272D121ADC6 for ; Sat, 25 Jan 2025 06:47:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787661; cv=none; b=QvBkLXBU0oGzQeweMWLwcpJvxUvYCbGEcK7OwEFPvDNHnjP5e3jMB9qOrc8tjqb1EkmdaAcoL/h0WcHS5WU8eDY6hB7yYEKqO9mUDh9ZT6uJ3Bc8KoX1Dv1esqwCaEfxfILrdPKUcv9+rSCxsMjRMmpOcIifgg5shgKIAwq7taQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787661; c=relaxed/simple; bh=ULYwAPW+w2emIWPoyOV7RgnrW/VZGrtxIM/Quxhnxhs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PkXRUfru+RFzaR7ze1gISvrki4GchxBTArMkTsxMOMkwndCnOK0yoWWndZWhBbIskYA9FfNyIaYjSSN0JlGeG7auZPZa6mLdBiNuJW/P/nysT6MI95TRxUFICWZdL2B+nbl+3BOlpiYu1eCqhT2KTQNUFC4fu5WcRQzJ9quftPc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TYbJr91Y; arc=none smtp.client-ip=209.85.166.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TYbJr91Y" Received: by mail-il1-f181.google.com with SMTP id e9e14a558f8ab-3ce868498d3so8478115ab.3 for ; Fri, 24 Jan 2025 22:47:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787659; x=1738392459; darn=vger.kernel.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=VU+OXKhsA8muIGMedhlu9SK76WVthVv8XHWCwBdRt4U=; b=TYbJr91YVGvh9xASCeCUU0VqyjVS7utXqi4PBGvV+gN5x/kVk33+8Orn4UkRqomvjr 0NkORNf8HQ1Tp6rl6xeQf7k7uLi5snUZbc/U+77djkuGLGg5dTZaZ/RDeKmngCG+GWAv H+1ordeXjLG0ImuJrZ6+4Iimnn2c0uXuOL/2lZOSN9WroX+T3msQQMbBIhLHqD0rkTJA hufU6YOXysc3SFoC4pWGnHZY0u3kp8/uWFFRfMO8SMfTtE5uaAHl+rs1sjq3Tzo+m6Pr FrlM1C916rRaxS9vbUu8Q4o2jJDvUVIM/UoNGm02s4DN2JLVvZ5k4ZZMsOszPAjbdVRJ rABw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787659; x=1738392459; 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=VU+OXKhsA8muIGMedhlu9SK76WVthVv8XHWCwBdRt4U=; b=cg/U+B8LjdnTpOlvqiAguWwhMl/1c1N/U57sMFfuEybUHCqCHQgN7kRZ5NCXBvpTPY Y7R00iU4dyeK6cWOtM5bSUl6OtwZM5df8PpU4L1EpEYI56SPv9cfg9BK97HRaX4wHz3U 0QTzCLMrspF+itOs/oBlQZLn3mGfHodmu9qAFBvY06ZPYFAN0aWSnQ3ggrO30OROQAlM Jasmcmjp6ikRsa/DlCog7NznQKBEFAUisZD1pBNyXWgHFUw2BEjO+umoWkv8325zpje5 S2F+i6waIElYKxUMRp0oFADXw5WAzt0XlgQwxEsJOU6EBUmiGpMmJDpH2T4N7dunqTV5 11cA== X-Gm-Message-State: AOJu0YwWsOt4c6UfvGMxPp1TfjSYLmINfXK2vlsZtuilB5DZ8F7nzcpy upfjYf6JWEgMVKyWj1O1F5+BXVtny9LHhBVHVy8VR+NPCy7S018UV8xROQ== X-Gm-Gg: ASbGncv5cbIUwFhTO1wpAepnADgdCaFsZTrsZG+p13389gV6PnQ1uzaTxTa8fpna8+b jNyHXAC954XT6tME+UfkGRREbz/CauH6Hiq598oLhCuTmxyTNs+KGCgTAJB3hF8akXM76jt8Siq nKImpJoTsv3j5BdlNNX7vIkD0G2JkR1WbryrF99Dt0xbfrhctGuFbPmbLvZN/tzEVlalAGzCPEC GES9UtBmgV6Lg/7OE5SobsjzeBt6bBJdPXSwefuDOAITp00wlhwQvTLnurQFWxWN8BtC7AjeOsj vdzkLIsGKX1E93sfuBHjM7eEIQjfgHyJ+9OOVQ== X-Google-Smtp-Source: AGHT+IECxSnSj0BufGaooCZEU7hhYKuc1bJycu0qso/Y9YV8tt4jSwt2j7TpluNjluBnY0rIhk9i8w== X-Received: by 2002:a05:6602:3e88:b0:84f:41cb:1895 with SMTP id ca18e2360f4ac-851b616dc39mr2912118739f.1.1737787659133; Fri, 24 Jan 2025 22:47:39 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:38 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 58/63] drm-dyndbg: add DRM_CLASSMAP_USE to udl driver Date: Fri, 24 Jan 2025 23:46:12 -0700 Message-ID: <20250125064619.8305-59-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The udl driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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 @@ =20 #define NR_USB_REQUEST_CHANNEL 0x12 =20 +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 --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E3B9224AF9 for ; Sat, 25 Jan 2025 06:47:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787663; cv=none; b=T2Wda7EZxHdgIL7736cgmSpbG9mHiZeEHzIT3RtS6nz5XZEk6zCljPUvudDGZ2FDOci8b/eMy+EEMuCRTVZX+BpULDNh+aZL8YL1t62A4R+YM7X4eI8vAsVBu6b9/eqc6qhVsy12SVlxC2C+1zc/M13rQYLEMxnX7KMh/85ogfo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787663; c=relaxed/simple; bh=xwFUsk+GDABqu3xBwezYcNbMSCsA/gM4w1QmvoBwaBI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JYqWwUqbSwfp+eGdpi/hjSPw7+PeFeqdeK9OAftQEGBHwPUvaa/0ZqWXGPFMxseRrjQAdzQQpsusu5jf/W7pdkZd9ParfaC47WsMqdZSj3yMOlmso0e1AcGGWWpOsJ0VWApGW3JUqE7RUxjiZ/7vr3y+dkcMubAS8S2deMV+1wc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Wp5p/a0p; arc=none smtp.client-ip=209.85.166.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Wp5p/a0p" Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-84cdacbc373so84595939f.1 for ; Fri, 24 Jan 2025 22:47:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787660; x=1738392460; darn=vger.kernel.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=/mUFZ8Fx8Uy3QqB/hbqxnrTn1Tk9spmVb/f/WA3FR9Q=; b=Wp5p/a0pqjf6MqCAfpv+wB48ZTphJPSwKRnP5413CNBsx5TMLWUiEFIUknjAUngFv6 ISWw/CRfoRbRVEqp3rWzIUHRZTNTsynILK7gJZPKp6ERr9JNEQMSbuNXcOrv8B9DzhMp u3h86pWyJK43MQpJmfIjkIP9XALX6J3HEEzfhqEV8L8nPDn9EqhUrCTQd5585kayzbr7 UcRlyyPX9j0ejj0aTSPp5Hok6HtOKTH/MW4x8Qlu/5J15ZE2z1FUOzJ2qyv8ysAoxe3S HiEOdKPZEegGG6LHsqDmQALpAD0mAnZ0MQ3wHHCyIfgWOgblRU1J0KGKZPihnyuG+trU RCrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787660; x=1738392460; 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=/mUFZ8Fx8Uy3QqB/hbqxnrTn1Tk9spmVb/f/WA3FR9Q=; b=nyftqFlEzmGFS8ap8UAEiZIyM9YC9yYu0YbfZy6L2QA+sLtIRgX/Fq9S3kVPGsWiPF z+FWBd8FHNxQ4JBGmDpQZvwlM+0U05XVgwwcaB4LiiTGUL4KsGcrnyNX9FjMQck4+qhj pOdWEyr4LRzGDQQKCycSs/jHvBGkQXUd9OTJzGFIOtNI8+i1XbQBb9vOL2kVEW6mUOrI Ssb6FrP3fKKBHYKwwCSypYS52ZUdsBGjOJTDhap3N9GqrXgqyMmPTXInSLjLKodTlZhb 2KmV+EjR4w3idLx3slPAbjQ6OOffWqzzzhs66DdcPv1pXDO1LETeKms76B+Pnp8o/xLi zygQ== X-Gm-Message-State: AOJu0YyVwk9LXzxKtaH8mIXzPscHwBiOq3sopxhCy8jYp3FBKzQmQZLV VMKOGWKPUpLPJfnqasEoV0N67tGuVA43ig8SMXbDZVCDHFrmSoM5JllhUA== X-Gm-Gg: ASbGnct96Zh5Yob47FhTzE6oxwHA1vGG8NmgmWuW61PppVbqWA9y9TMGWSVIRQ+x5Bx zQ9HaWowm6YXkbgXazHZzasF5xnSB3BxXCj3o0ImhU/zNxsV8dbKJMcZ5x9X6afnGj5QTyQPmiZ FA/DuMFrXuO/grRfh0XbAnWRaSvLUHuCh2RNPBbckBsy3uUMQ6ou8k0+Zy3pa6ZNy4hbdLLRLaj MB9sHJWf7lAiqhpGrImVLOQ5/sKA4eaK0XM2BSpbbghbpEQd6FasXHVIabrwOiZrlC8x1uKoWeL sxNFUt4n+rznaDt3Aa7ZSkXa/K8DjvZmK3augA== X-Google-Smtp-Source: AGHT+IE5SydaMohjo2fPiL9Eo34PldUnXG2CByWM5igrHsaDbtwNWE8E1i65BN9D+ZF5lfplsXjZ9w== X-Received: by 2002:a05:6602:4186:b0:807:f0fb:1192 with SMTP id ca18e2360f4ac-851b6169a31mr2832582039f.1.1737787660094; Fri, 24 Jan 2025 22:47:40 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:39 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 59/63] drm-dyndbg: add DRM_CLASSMAP_USE to mgag200 driver Date: Fri, 24 Jan 2025 23:46:13 -0700 Message-ID: <20250125064619.8305-60-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The mgag200 driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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/mgag20= 0/mgag200_drv.c index 97fd7eb765b4..c6000692b5ce 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.c +++ b/drivers/gpu/drm/mgag200/mgag200_drv.c @@ -27,6 +27,8 @@ static int mgag200_modeset =3D -1; MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); module_param_named(modeset, mgag200_modeset, int, 0400); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + int mgag200_init_pci_options(struct pci_dev *pdev, u32 option, u32 option2) { struct device *dev =3D &pdev->dev; --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA888224B14 for ; Sat, 25 Jan 2025 06:47:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787664; cv=none; b=tPZdaaR7j10cofC37fKAdLjK0YTSjeHyDjKqiHMxQPk3aWx+PcZLtEseKYvRiEyh54vskNofvjRhTxgPOzmQef6WDELLLqRWp6U99aRh1Pi3TRq9+whhqgcfXNm8Aix/ZH+2z4ozpaJ7c15Y7gyWO7tzijYTQS+GNj0Z61KwpJs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787664; c=relaxed/simple; bh=j4xuQgsx462Y5P/UvLiY2g2YiEy9jl9/pZDoRL3r4h0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D+oKVfvfRF2NJXXp0QdnyL7MDqA+jo0mcNDS+k/84xT5dapwsXs3KvMuEh85rbqPc4CkkJFyi1n3S9Y2YQ2II2J8mDjqMbX8X69cn2SuvCaoZhGtoJBF9+lnurMuVr0lhiwO5vr4cWzilAdALi8I4YW8lhG713VSQnFIOPc39qI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BvHlh5rx; arc=none smtp.client-ip=209.85.166.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BvHlh5rx" Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-844e6d1283aso105645839f.1 for ; Fri, 24 Jan 2025 22:47:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787661; x=1738392461; darn=vger.kernel.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=+bbcbstf8Ee+MxLJpu3h+uVTQLGeXiuyn2e5gcDq12M=; b=BvHlh5rxv+EgpjRICKxToUjEZAId9l9i/tPrkxtuc52YvZxLgc2tPidTQCrU2i6WmL 4AYrbR7pJUyzInrAj6ugnqjwv4zNJGL4/C/hE6ivvpdnoLOvYMjhxG/tMC2EtKhKaozb L7anZo4R6AfMEink8ZcSciPRAA0GWErzv4ZbiyvS3fAAUqQMzqm4W/VIjuD4OY34tJEg VSyPRIjWqhQp5HtMyzKXOhTIAenCmmtmxaY1SSvLeov+SJvjzhDlWp2CCVcyDhNJcTTb ex5fecFc9YRy3bnmFMat21OjlbXYYgsGQwZVnS279snuR/XlUmUNsKYtLyCbQbhHtj3L jnRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787661; x=1738392461; 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=+bbcbstf8Ee+MxLJpu3h+uVTQLGeXiuyn2e5gcDq12M=; b=qe3FH3OtEUG9LTEmLL/ZOPo80H9cE5XOB6g6tt9nPAAH3qREFo4Ki3wpsyHiKa+V9q QrcPoNS4Y/vrGJhSj2HLpvLLeRVRpGOG53s7DI0jvo1sj5SP1BaltX4ULuqHodRXhucz 0ua6hPsDSFPgYWJOA0uhQsAyY00fAFG4e0V/b85TBdw5LzdaGPnaheGpIgSaA1LRd7gv yI4t2uzHSWlpE1pWIOGBx7yrMBb759Efx1lyPwnu9jZ8iQZzIQhgeF7k1cBOud6WDbQI uETG4ColEP3fYw5modGGSlFsgply48JjsHHzA098Ugeqwt4ffN7f6KwpGFoUE5H/rZxO Xsbg== X-Gm-Message-State: AOJu0Yz1UkATYZxgk33xsKz3jpnIzYKHC8q5Vt/dBVra2LMIfxHYukrd G9bY0ljbQ5em94nNvlOPb5bVa4EbiEOWuaIeFfqpuC4MYXGKKW92/RnuRg== X-Gm-Gg: ASbGncsZ6e/ZV6x+P4xYo9oLq5XMn3RYFBwKFLSaqmb1Dij14xnnZatnOKDHhKWaK9N rBXDMM4qHI/5E0i/tUyjkyWlFIAFxciIOhw3yMB+SkIu27OVG7i5R4+gu14QvfVpj3MJdRrbuty Ti85Pp2XbcZmjCeJeudX616/EyoZZ+vrtk43OkRP0iC4BXRKbseKgdyxswZj0bVOMXhSPI5LcqH 8JlWBGOJGG8KxaCy4mb/326j2IbDGW54RdLcP56ihGBzsmKmq9dJhqho/e85bG3VmYsnbhu/mp+ W7QG9hGFF7AsLWDCDPM/QVESRA00gD1ozPJbig== X-Google-Smtp-Source: AGHT+IEYJEfd8pDXzuBkvGlPdRY1WjVugZUcIO5koXeqdz2TVEIoZMex7iC8QoXTB4/lAL5ptLR8YA== X-Received: by 2002:a5d:9649:0:b0:841:9225:1f56 with SMTP id ca18e2360f4ac-8521e32b3camr488498839f.3.1737787661025; Fri, 24 Jan 2025 22:47:41 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:40 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 60/63] drm-dyndbg: add DRM_CLASSMAP_USE to the gud driver Date: Fri, 24 Jan 2025 23:46:14 -0700 Message-ID: <20250125064619.8305-61-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The gud driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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 09ccdc1dc1a2..20b526c39392 100644 --- a/drivers/gpu/drm/gud/gud_drv.c +++ b/drivers/gpu/drm/gud/gud_drv.c @@ -32,6 +32,8 @@ =20 #include "gud_internal.h" =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /* Only used internally */ static const struct drm_format_info gud_drm_format_r1 =3D { .format =3D GUD_DRM_FORMAT_R1, --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E56A7224B0E for ; Sat, 25 Jan 2025 06:47:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787665; cv=none; b=l8m8I+bc9ynFBmEqa8DWh/TE8gkFywjNN4iIDWFLhafnbzq5BcqyHdnmgbKdfWilt8ZFEUc7GkYQklasARRW2jIyzdjlLh35On2ZqJ7DNXinV6TrE/jrVFkRd60ixns0VlTs7zeHeh+Z8r8CRIEsha8oIp3/xJgP0/eNMto7IUE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787665; c=relaxed/simple; bh=Ss8hxnlWAa/2wcWCOeL6tw8L6onHu0Gx4vqrgj2Ui9o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f77NuDnkc8vAvEIZfhp0ES2Wi9srw2r+Vd7lBcCmKmWThsVYZpqmZKRfJnrfzHPvXKDV3A6Uw2x7m+DN00rORQYNzm07HrThXCWdPYZ8q45Z9R6QLpezvnDPQHPvTh6xAaZoHy3Eay7DVltFyOlviw21dYn6D0QBF6k7kGxfEQE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mKWe3lfA; arc=none smtp.client-ip=209.85.166.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mKWe3lfA" Received: by mail-il1-f181.google.com with SMTP id e9e14a558f8ab-3cfb0ed6ef8so11168715ab.0 for ; Fri, 24 Jan 2025 22:47:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787662; x=1738392462; darn=vger.kernel.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=p0Zd3BfiY3W2vF0LG5AZgUdYISO6p26vGoDy33af8qg=; b=mKWe3lfAuSMLUvaTnedVQeCQ1X1L7MP1DR6IiWEx1nOotx8i0MjXxoV2OQJwhG7euQ ReAIhdP+NHqYJWyjrlodB0YnRbxhu/5WEmtKE681v2/Y95hG9dsK40cpEyFAqt+3TMsn nEGemqjx5QczlQV6TXzQQosi3Vs2Tuubo6NcfCPl4/huYCByejRQ6B1O3z7tBpgsfV4v JcvePFZwJcVDlglTop8pdRZXJUUFpd7yZgTrWmHk/1jz/JlApZxcL7k6lgruLpRHhG/+ Yb6sl+jBLPD5QGZV/ZKeEvHfXRmRTcErAHkK1+QvEimAhl3jem5wrzBf71ww7xn7YG7Q 763A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787662; x=1738392462; 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=p0Zd3BfiY3W2vF0LG5AZgUdYISO6p26vGoDy33af8qg=; b=jD67FBJI7bqp2qcnb5uF86k1MR849elsZVJpS5O5T/0BNdN8jF1VOa7rP5rPXU8nIP ry95xeYRSifYFkyaIVFyCsYQtZiXjBeMHtQdZU6aD+m7dIDvT73bMAmjnhC2gZqpQgJZ 4YjH20shA9aL2Rw0r6tx+3gtViSR48nGrsZdBiSbMuNR6qOqqUJVIg8OUojyq24JbLag YLCcnlgAvs63cBw0SQCMam6HGWfjL9N4uGaWc+beLaLhJFZ30wdLBD2UfzmNa45qRrMo LqVj7d6cOjXMEibCibavBwzYtAjmdEmgSUHUMZ/5LA02H2I5FBoslDqDAvrGhnJ7TaK9 wVGA== X-Gm-Message-State: AOJu0Yz0BO4Wy7ii7wWwICyHDe/5AY6lapHbtp+WdTTDA78a+yItt12S D0K+Ywh54efC/JP7PTktSa4RqdqUMzijTVZt1G2XLQ9QslPU+IbArsvT9A== X-Gm-Gg: ASbGnctuR/u0iBU1EP6Kh0aXhcnfQH/+q0t/pfGwActnuaUG3a0UKazCNPT0uUBPw1u +18+KnKADznsrjzyF1D2/kOSqr93KFGqCtsH2d33ryu5d0yCORWTDNIYCTsM161fKNnGi4DpOea gpLeTzP6KnTqjqG61d5BX4N0TrAffF0A5ALOGxUvxmrmSM7MSjM8i5t5LW31feOpjG6WDmd3dti evecrxI5LHaU/8z9K2jyrwCuvlspKazC5i4wFeTO1CejxmcDT7+DUtYXPRz3DArCSmFpbFBUCwY 4JpYd1ZcjFTspDYu7efM7swF+muPv35C2djyQA== X-Google-Smtp-Source: AGHT+IF1zMmq3tsjDiYaBlPDj34+isgHT03SW+yXHV8H8+MqeBVAiaiWzp3yJjk7UYIGJ79lbI6G2A== X-Received: by 2002:a92:d4c9:0:b0:3cf:b059:9dd9 with SMTP id e9e14a558f8ab-3cfc7a564ccmr37732475ab.9.1737787661907; Fri, 24 Jan 2025 22:47:41 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:41 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 61/63] drm-dyndbg: add DRM_CLASSMAP_USE to the qxl driver Date: Fri, 24 Jan 2025 23:46:15 -0700 Message-ID: <20250125064619.8305-62-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The qxl driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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 21f752644242..4b72ad1ac72e 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.c +++ b/drivers/gpu/drm/qxl/qxl_drv.c @@ -66,6 +66,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); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + static struct drm_driver qxl_driver; static struct pci_driver qxl_pci_driver; =20 --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EFF5B2253EC for ; Sat, 25 Jan 2025 06:47:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787665; cv=none; b=gyMvWsMCnrishX6AMcbvZ82Fp7ICxjwZZpk8Ef435sxGDib2OOrVcrpYc0nnDnxdyf8KtCAxWpAvlTz8Jbt9D8LrwrpF+h6J3k2/LINZf5CVh+hjwxwqqJYXXapV4pGVG3Wh/vca+UcAefX+h6OGDbQjKKMg+aELfmT4ScX7Ar8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787665; c=relaxed/simple; bh=cv9sxXue69p+4SdZpAJCh2tV+kf2p+hpvmhf8wpxVho=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D1dY/kBc9LMDPTxDcua/ji9X2vb0l/04TJJCoJu66YZ5GWcTpBGEjr5viAWxH/F8ya/uJOC8x9I63bqq1cn2BhrnB/rbz10OTixUajq5AHXFv+OHIha10Fl4MV/lQNNjrNd04OiX8/kdOIQGX+6FLPEAI0PYVAaDTs2TbuaoXjQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VYOqjxNZ; arc=none smtp.client-ip=209.85.166.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VYOqjxNZ" Received: by mail-il1-f181.google.com with SMTP id e9e14a558f8ab-3a7dd54af4bso7026995ab.2 for ; Fri, 24 Jan 2025 22:47:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787663; x=1738392463; darn=vger.kernel.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=zMxBeI+ZLf9yVYG2cFYc0qaCJ8NkAf6XlTFRcgZVjQg=; b=VYOqjxNZxnil932WOdtZDJw4Xev84KJsyZ9tD6cjLSaT0NQFwF6W5FzEExSMrgsxby 7D/Fjlp96Hakx/W9FlTv18njL91gqNqrt1Wj229j8A17GjWoFG5HFVH5+hZN5sklDov9 hPUgEphh42zQ1c//HdJSxQ7D2sJWbdpiYDc+QzoVDoNmRybo9nEsbTKreIEUC/6RLE4d wcQDgDR0HhSqv35+gONdcToXVCA99WW3YEuSzRoS5MBT18qck3OtcnKGnqFpi2KUxdDa Q8cCuAMZxZc1mx8/recQnZMggOrl6x1FMoeHfVDrIuLxQnQJ9hwkyirxHHQ/5A9rl9AD YCBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787663; x=1738392463; 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=zMxBeI+ZLf9yVYG2cFYc0qaCJ8NkAf6XlTFRcgZVjQg=; b=MPb7AvRzSYJglqGomD9Ep0vMOsuhOCzX/7gQzE6KEGMG0P94IVsauLGMzrQKTEnqVO 3e71cvCLpbvHcmUsgJOpMCbiVji9ukPqZC7Gf6Vzc+ijPH+J1U/LjUvVNCcHGcBokDUg zKQkzdN7WNq0E/ZJrn6lpCNW/1OuJGPN0pUc4yhnR4QD3eAX1hxv3LcnHHPsSSJ1B0Br I95pkddWfrLl7y6UCzHXLfLZj4IuBtt4T0kMjTAPX+lJlK4cXWDMjdlIbpza+mQ9nmZY pQ81dXvO799d7lcnMctf45BMn37RMElxbY0aA+x713VsKQVRoSL6U7rGWBXkLGU+286c JTsg== X-Gm-Message-State: AOJu0Yx1Jhiq9c0B+ACsghVAuAxfElOH23nxjxdYpjSUTCUHQXL96H5F 9GeyEVEEcv0dEWTOTIOG9VGfZz51AyowHWpR/Jlqug+CsctmWV3S9pLalQ== X-Gm-Gg: ASbGncvVvYC4q5s86Wbz8a+0ONWhDgXM4Mu7i5cH1+jlZO30N0M6Pjs4JE4aB3PHxay +WNDuBFhZ+cS86y1RuzH6K110pI2+acVPReuTa3XfDDByX4NPJVKkIeAuUoeGIqB9dOsOXp10jd Kplh3MqopXlWh2WqDjiP8taHTVt2g5CO2O0sOck4/M2yqDW9zNeRtDM4CRXD+exhCE4tkXUD8EO L7RjlsdGeVM7eGrhKsl4GU8mSnBTKMzgyjG3YUGM4Utks2iFPN3asUQ+HKC26RRgpMpemNeYI9h 7wcag0SDrq7Su3Tl+dLCgBH7qFP8r6O2uqIc/g== X-Google-Smtp-Source: AGHT+IFb1IYAOoDwrPX5oAD1/5R309ZYSOIrwtBkiFdBX9WxKJLvt5wVK1HYP6ZV250VsZiGsSrO6w== X-Received: by 2002:a05:6602:2dc6:b0:843:ea9a:acc4 with SMTP id ca18e2360f4ac-851b61cacc9mr2996533339f.8.1737787663036; Fri, 24 Jan 2025 22:47:43 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:42 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 62/63] drm-dyndbg: add DRM_CLASSMAP_USE to the drm_gem_shmem_helper driver Date: Fri, 24 Jan 2025 23:46:16 -0700 Message-ID: <20250125064619.8305-63-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The drm_gem_shmem_helper driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- drivers/gpu/drm/drm_gem_shmem_helper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_g= em_shmem_helper.c index 5ab351409312..481d18561688 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -23,6 +23,7 @@ #include =20 MODULE_IMPORT_NS("DMA_BUF"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 /** * DOC: overview --=20 2.48.1 From nobody Mon Feb 9 16:32:42 2026 Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E63222540B for ; Sat, 25 Jan 2025 06:47:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787666; cv=none; b=bJzevtfuyGqGsvVRyurz2dmAHJuv3sutKNLasWp5GV1Yw6hjLKVv5Cex2NKuZe64418SoOBkpEVinjez9vS/HJlgpLeTpNlqs0fRgzQdPiTgpOm0piGeTGsuT3KEMXKEJAfSDwMhJYBkPjr13JYAQmhq2YY27PRa1dQ991mZC6o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787666; c=relaxed/simple; bh=JKGrftfxYSR1XihzvNk2ygE2HqQmkgq107TfBL+zU0Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bvNgsQDtGkTmgRFMlrcfwYhp9NxzDDhCHcIfQy2IS3F6sylPsTUQCd8qlWZEQhJeW7Mi2XysdiLIfMvGq6abr0YSx1HqMHM1RQGnBqEXe0yU8TFyzJmYrBH8N+sNpbGQ+GdPH092Xw93+UnYXWHfMPuq57GROHhyI1Ru46VbB0g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=F5yiZDpj; arc=none smtp.client-ip=209.85.166.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F5yiZDpj" Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-844e1eb50e2so75459539f.0 for ; Fri, 24 Jan 2025 22:47:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787664; x=1738392464; darn=vger.kernel.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=fouGDaKOIh0ynQt2BoYSXSSrIxHSbFED02bH/Ai9Jxw=; b=F5yiZDpjaKlT4PNZ4v9sslhyBwgS3mEdfgkrnumzC7CNs2j2HiS6SCDvGPgbzK+wqM u0NkCHsyrimMTOR8EhgXB4hRY9PW2lKrPd0TrxDybu17+duqyJO6be1ehbI8t+4Rbmfv 5ZCbGEwQy4Q8oViy9TGzEt/0IT2mluUv4jYmm7zFWmxMRwQ5uxuTWNQQ0fdugvXK0yaB +DzrLWlcucdXPPV/wJsuVspb5jhFSlovf+PAMKOA5EhgXs6jHke4OSyP7vZPgepBcWR6 PFjkc8b5CPseal+CBncBGJRuQjhteYTzwJqlKU+fcQxqPFYpkz8tuDyydNAnYymkpk2C Zx0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787664; x=1738392464; 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=fouGDaKOIh0ynQt2BoYSXSSrIxHSbFED02bH/Ai9Jxw=; b=WBVIYjhOQts+cWV0z9DODNIlxUyxaJmfsWJzAMJiqvLqEyBrilpHAZ3RtkDdT3xf+O BENJMFaXHM5CumqCia9vSqLW6SBuq+hXPXQabvHZf43EPEyeQYeSeEJuFOYaeZzk8qJQ IWoGkhxfqc1ErewcXk7PLV95boHtcqYNcnc1TH/2BxOyleGaV6vM/2eH8MbafhlD4x4B NYnTg03OhKnuZjjoTRCA72+kVPHpFZuifsGg/7Y75CIq9RpSgOri1OmCJTAP99OqyElp 5qpMvS06LOK6zpdk7Min2hvrD9HghuFokdZjUCxSSfeD05gxg8cA9qQZrUaO1cWqBj2v mztQ== X-Gm-Message-State: AOJu0YyOlKPMY49CKEPxlnpWSyERJXmlJfv1YkKx2uueBqkZtuSEt9Q3 B76aE1zgmA3NENg5UJ+2fim5zZHwTwp7l4ODEZTsVOyljD+UQJsDhOVoGA== X-Gm-Gg: ASbGncuPM0UmSxb8D3vv+mmnYe139B1mCOWUJ/o7FL+7eBDWQZ/ke73NpPZPul61K7G WOjyvdrg70xE1r/ObRO66uAWMZggRF5/2862lcZ/BV3nTtgFpD4yoAEohMKrvVfmdQ3dRDTmFoT /RlYAw7dHn1QUuclTYCw3w4QkwbECwhh7CYlrOyAjQfTOVFDmy4TkkSyT/d5CRAhAF40DxtDlDR gQS1lXJcbCWb/fbiGeWR4gF+o98b+j8vPOlukngvBHsRR9twSAXhb/mJFPDNQI7cJZ0etbgD4jv Xz6oFX3ucuLYmDY+Iwm+033kbkAMHyTmJIfAMg== X-Google-Smtp-Source: AGHT+IHe/VBH/Ym8KO8omBNYUPHpPaX/1NrJiiHCIRpffb4uvJC3io6oEswUJV0nSwe5qmSt+gVTSg== X-Received: by 2002:a05:6602:6d1a:b0:83e:5860:5189 with SMTP id ca18e2360f4ac-851b6284084mr2527651839f.10.1737787664021; Fri, 24 Jan 2025 22:47:44 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:43 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 63/63] drm: restore CONFIG_DRM_USE_DYNAMIC_DEBUG un-BROKEN Date: Fri, 24 Jan 2025 23:46:17 -0700 Message-ID: <20250125064619.8305-64-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Time for some thorough CI. Also, the previous 18 patches could perhaps be replaced by a single invocation of DYNDBG_CLASSMAP_USE, from a C-file linked into all drm drivers & helpers. I didn't find such a file, nor a drm-client linkage item in the Makefile. Signed-off-by: Jim Cromie Tested-by: Louis Chauvet --- 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 772fc7625639..dde5a5e37680 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -53,8 +53,7 @@ config DRM_DEBUG_MM =20 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 --=20 2.48.1