Message ID | 20231012172137.3286566-2-jim.cromie@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1388225vqb; Thu, 12 Oct 2023 10:22:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkSfRoE4RWX2QgewjyWXxWsoNS5q/ilB+FPUuHXLvfS/qaqM9ntvPVPgUOFEJn33/DomE+ X-Received: by 2002:a05:6a20:431e:b0:13d:fff1:c672 with SMTP id h30-20020a056a20431e00b0013dfff1c672mr28037428pzk.4.1697131345419; Thu, 12 Oct 2023 10:22:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697131345; cv=none; d=google.com; s=arc-20160816; b=eoqWZATVUO3GLYYysbpbPV0Ka7KYmlVZk3XEsvWZ9r8HlxnQ9o2McGBcAo6gh412zx 5rm5HPsGYhpTpyhqZG0g8Wmrq1rlc/Fx9EBBqblshAh7nI50vLW5cbfn3gzMJ7egrGQ+ WP5LJLOg8YbIL7/EuPiH2oDPRVzR/wenIXlZg+PgV5u4s4m013IMxsnLFihgaMT/3hFH drqMa8072/1BbovJzFvSFN6u96nOhlhkdBO12sYgOGtvEbLMXVhOk4g4A99+1AMXbETB Ro87cMU1OWXaGO7q+3rkI0F+1/+kSk8d7zR+0rxDm5Yh2bDNoeMGdqReJcPiL5KQ69aJ YSow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=e6NIZdlLmgRQPJbwwmBZ102ypc9HsrQnlZpRMUUA7Yk=; fh=iMt9mR7tPHpILUTScbdc/cv5Bu8Y4MLmy8xlWClXVSw=; b=D90/QsVbMXh395zgeEXFqFMvhphQha7nDbdt3iPmHFokjsAvl/ke0O2XLkSqXx+T5L cC3fYsW889Vy4jtJzO0klK3GfOxEBouSCquXuw1N0waox3hBBoxGaSMbNAj4qrqupdf0 Tig7qW3ql1dDNL8NCRNOzMsTRxorrBgxuvl/w6CQUXUMmh58xRoQQNpMkyHZ9dZsech7 zPIMUaAT7WRky6u3GucvgqgAbF53YbFkt7WNkJH3Ncgkyn2DUkm+Lbo2MjxEHL9j+btt iASTsUsjQq9fH3M92ykE3TobV4IZFWbSP7rW4dcWIVx6RYsiLwvYJqsHjVUD4Kl7aEg2 y4cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BanMCks8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id nn13-20020a17090b38cd00b00276671731e3si2791679pjb.136.2023.10.12.10.22.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 10:22:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BanMCks8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id ADB9580295BA; Thu, 12 Oct 2023 10:22:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379610AbjJLRV4 (ORCPT <rfc822;rua109.linux@gmail.com> + 19 others); Thu, 12 Oct 2023 13:21:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347338AbjJLRVs (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 12 Oct 2023 13:21:48 -0400 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69BCCBB; Thu, 12 Oct 2023 10:21:47 -0700 (PDT) Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-79fe87cd74eso48018039f.3; Thu, 12 Oct 2023 10:21:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697131306; x=1697736106; 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=e6NIZdlLmgRQPJbwwmBZ102ypc9HsrQnlZpRMUUA7Yk=; b=BanMCks8p3R9OoEdecVNYrXI64PnbEUVb01iwgSkl7Nim4i30j6dvjNZacV4p4eK2K AYmOuCIp6XrINIMexpPOli29mp2XVojp4M/sHrYE+RjscIYOFZn57By7DXWAprYU5cnY IeMxU32uz+Z/BFo+Fuvwi1dE4vqrHl9aTRsKeL7OocmXgVTxGVTDqZRVh5cug2YFYiDz o5ugx2UlsZ59HvYZPNeQA7lMyhffIAwvDeIN+93ysSGqaVWPv9McvKe8zPP+KV9j0zj1 YHnGKknd8z1ozUflltSZlegwATkMkkYBnzcm5BOq+cYAqCdNPX9WwFTPPfM06EwregCl xGBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697131306; x=1697736106; 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=e6NIZdlLmgRQPJbwwmBZ102ypc9HsrQnlZpRMUUA7Yk=; b=WT3VTziltyZc/U7GkzwX5+u9r/NgLXkUri8AEG+xhcWemK7GpMJyKHHN4Shb7CPElS 2nv593utE8Y4t3nQvWlhk9cXvVNUKRzOs9YeyMmFNjgG7lll0WhgMjEyxsd+6lzpepxN R8jGAl1/oHHY8yzM3iomRR6pW6lKU5T1Ojt8Vj7CckEAZVSgaqniByKyw58mb4RSvtzG AT0dVy5k9VV+cfw5mo/UBw0931zHGDV5DXP2GGL+9xqWgyO3Sxf5U51Wg4whRozKWBnB Q1j8GCaoa8HkiZg51VngiKPHJ/QjARX7pO/HmkRVQK0mEl+y32EiIzGTCHv1fzd+Q4qe 1cQQ== X-Gm-Message-State: AOJu0YzlFPoWWzn9JCWMPVdsdsIgeYGW8FeBfK2FSxXiJUQugu+8w9O+ TVCAtHx+7yUTpc9Dy9ZEARYXSTl7LwUJWQ== X-Received: by 2002:a5e:8809:0:b0:79a:b53c:d758 with SMTP id l9-20020a5e8809000000b0079ab53cd758mr29001536ioj.1.1697131306392; Thu, 12 Oct 2023 10:21:46 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id r25-20020a028819000000b0043cef0711c1sm3992211jai.158.2023.10.12.10.21.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 10:21:46 -0700 (PDT) From: Jim Cromie <jim.cromie@gmail.com> To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: daniel.vetter@ffwll.ch, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, Jim Cromie <jim.cromie@gmail.com> Subject: [PATCH v7 01/25] test-dyndbg: fixup CLASSMAP usage error Date: Thu, 12 Oct 2023 11:21:12 -0600 Message-ID: <20231012172137.3286566-2-jim.cromie@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231012172137.3286566-1-jim.cromie@gmail.com> References: <20231012172137.3286566-1-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 12 Oct 2023 10:22:22 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779571197288883610 X-GMAIL-MSGID: 1779571197288883610 |
Series |
fix DRM_USE_DYNAMIC_DEBUG=y regression
|
|
Commit Message
Jim Cromie
Oct. 12, 2023, 5:21 p.m. UTC
more careful reading of test output reveals:
lib/test_dynamic_debug.c:103 [test_dynamic_debug]do_cats =pmf "doing categories\n"
lib/test_dynamic_debug.c:105 [test_dynamic_debug]do_cats =p "LOW msg\n" class:MID
lib/test_dynamic_debug.c:106 [test_dynamic_debug]do_cats =p "MID msg\n" class:HI
lib/test_dynamic_debug.c:107 [test_dynamic_debug]do_cats =_ "HI msg\n" class unknown, _id:13
That last line is wrong, the HI class is declared.
But the enum's 1st val (explicitly initialized) was wrong; it must be
_base, not _base+1 (a DECLARE_DYNDBG_CLASSMAP[1] param). So the last
enumeration exceeded the range of mapped class-id's, which triggered
the "class unknown" report. I intentionally coded in an error, but
forgot to verify its detection and remove it.
RFC:
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 !!
* (build-bug-on tips welcome)
Those shortcomings could largely be fixed with a __stringify_list
(which doesn't exist,) used in DECLARE_DYNDBG_CLASSMAP to stringify
__VA_ARGS__. Then, API would accept DRM_UT_* values literally; all
the categories, in order, and not their stringifications, which
created all the usage complications above.
[1] name changes later to DYNDBG_CLASSMAP_DEFINE
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
lib/test_dynamic_debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 8dd250ad022b..a01f0193a419 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -75,7 +75,7 @@ DD_SYS_WRAP(disjoint_bits, p); DD_SYS_WRAP(disjoint_bits, T); /* symbolic input, independent bits */ -enum cat_disjoint_names { LOW = 11, MID, HI }; +enum cat_disjoint_names { LOW = 10, MID, HI }; DECLARE_DYNDBG_CLASSMAP(map_disjoint_names, DD_CLASS_TYPE_DISJOINT_NAMES, 10, "LOW", "MID", "HI"); DD_SYS_WRAP(disjoint_names, p);