From nobody Mon Feb 9 16:45:33 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