From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 CC1CE1384AC; Tue, 12 Mar 2024 17:03:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710263001; cv=none; b=EqjzEHlAY2ynA/h+8qUQGDTN2XgJUjnsZNvsGoHulAmgVARm+Wd1xDhO5PL+yRC4i4KBjVtI/71yI+FBp1ON69+5yEprx1nVfu2xo+ieyOmKF5psKpZ7clULXe5ggdpMTwfoZDgcw6khDIo1vtzOiPli/L8EakG8JbNQTCfeEdU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710263001; c=relaxed/simple; bh=Xkzz7frE9nvSTNzSTAYavYlAajmFMh+XRJNWZiXH5+4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NNhQmGWo89gMWNj/QUs2aauGIvcmyQiLADRQ4tdv7Z9m18VYTtxPJcX1BsdIghafgZQFhZyf/pK9TE5jXVoDdVK/XqzMq1HKZrT42u+Iihy8oOIe31Ks5iy6InowoAo0FVHNY3+nPYqMWXwzCzZVjUQ3xi/irBwPh+WQUS3PLwk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GA/0s7SR; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net 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="GA/0s7SR" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1dc5d0162bcso33490385ad.0; Tue, 12 Mar 2024 10:03:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710262999; x=1710867799; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=R3Kc+Yh+XQ4llosDDGAwX/2k1FGi6g14GWlRJRORANM=; b=GA/0s7SRT36z2jQRgwBg2/AKRMucGj4NPaEITfEX9DpHpZQqkK57TpbQ3I1bd7jcbL biEMUXVpdMdzOy7KvzvRLRP4dxAbzb5dMjV9X8oiyxfGnX1zKH0lRkOdgfG1cicmGTnE GrRRIuLWWWoRgSlGp+B0P2tCNSWoxUM9M3fn/xbpZMKuiblHkHZMbPuxppUq7tv8LuW/ 6o+e7ert3ZI/7AQPvxg3fkm4bAzie3uEL7YUIxaKBNhe/Tl+gi6RQcZ8P+1iA6wTkjrU BymQNohWv8XnPNISncitpiZUmAlbJtYexeP9UCYwxTJyW7bhXGpCHMW6PFvLnHtXfcbG NaVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710262999; x=1710867799; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=R3Kc+Yh+XQ4llosDDGAwX/2k1FGi6g14GWlRJRORANM=; b=Df3LZsYmn9N75di3xgLXmatD0OcyP4ATqUYhImgYfi4t1VBDK6wjoFj3faInSgoXbQ sKwf6hG1R+3/cPtFPcC7O4/fYIIEwKRpbI2MzukwN56QUBr7YcriKy/ulwaihIPOKcA6 pNnYpotZLy8UrPhhfJKcIWHowxrxz1RIf+bzWYB1WG/wFiRpOEfFl7vhmJLD2x03fgqK C619oajhCl5KIN9+5XLfesVVvXYYZIhvioxaZPK/zys6tGqHqYvn507fdSAKgAGcCUD1 tf92t8WuvDadVa0eh6RS6AVTC7b7fHNpWFu2xqN6aDkaHlTItdMv9kpcd5LaYQ1oHd3h sn1A== X-Forwarded-Encrypted: i=1; AJvYcCUH+KC8RvdLRv+TeUVIIaJ1bIwZOevo5jbWONGntdL7LycleS2UnAcn1uE7cypkiVr38gyba7eJ+R9yr0RxTPd/Zhisuo03bIJ7HKxxhGNdjHw+WWFe+MkSN35jmOsGcJ/LsCtgqa4TrESai7VJGxorMLONH++vQanALZUbV5I41AaDieMpt5ZeDdArxqSOkUw+VIYrAMmQF2YHsPvn3/wnUuw70vfec9bmbWw62zm6NJXI/LK8CUy1mnGU3u0YIbjdttKf/T2dkmb+ByPsK8Ify7yvcOtzgQ== X-Gm-Message-State: AOJu0YxbwBfSC6Enj6+1h1T7/Tx9TwckrroP3l74gO+Z7YzmifVab0rG s0tDR+bz7ltbbzQBlaXXPkD7LbPk7y305PVolCgGtkVeP+LEQabfs/mCXPta X-Google-Smtp-Source: AGHT+IEtMqO0igDV/OJPl9l/q0X7vf8EgJ9VbKv7ARIuPeUFcb0gEvMyJN5DQCEgr2SoDMnFKNIL1A== X-Received: by 2002:a17:902:7b95:b0:1dc:418f:890b with SMTP id w21-20020a1709027b9500b001dc418f890bmr8936395pll.40.1710262998624; Tue, 12 Mar 2024 10:03:18 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id e4-20020a170902b78400b001dcc3a46a6bsm6883069pls.262.2024.03.12.10.03.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 10:03:18 -0700 (PDT) Sender: Guenter Roeck From: Guenter Roeck To: linux-kselftest@vger.kernel.org Cc: David Airlie , Arnd Bergmann , =?UTF-8?q?Ma=C3=ADra=20Canal?= , Dan Carpenter , Kees Cook , Daniel Diaz , David Gow , Arthur Grillo , Brendan Higgins , Naresh Kamboju , Maarten Lankhorst , Andrew Morton , Maxime Ripard , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Daniel Vetter , Thomas Zimmermann , dri-devel@lists.freedesktop.org, kunit-dev@googlegroups.com, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, loongarch@lists.linux.dev, netdev@lists.linux.dev, Guenter Roeck Subject: [PATCH 02/14] kunit: bug: Count suppressed warning backtraces Date: Tue, 12 Mar 2024 10:02:57 -0700 Message-Id: <20240312170309.2546362-3-linux@roeck-us.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240312170309.2546362-1-linux@roeck-us.net> References: <20240312170309.2546362-1-linux@roeck-us.net> Precedence: bulk X-Mailing-List: linux-arch@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Count suppressed warning backtraces to enable code which suppresses warning backtraces to check if the expected backtrace(s) have been observed. Using atomics for the backtrace count resulted in build errors on some architectures due to include file recursion, so use a plain integer for now. Signed-off-by: Guenter Roeck --- include/kunit/bug.h | 7 ++++++- lib/kunit/bug.c | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/kunit/bug.h b/include/kunit/bug.h index 1e34da961599..2097a854ac8c 100644 --- a/include/kunit/bug.h +++ b/include/kunit/bug.h @@ -20,6 +20,7 @@ struct __suppressed_warning { struct list_head node; const char *function; + int counter; }; void __start_suppress_warning(struct __suppressed_warning *warning); @@ -28,7 +29,7 @@ bool __is_suppressed_warning(const char *function); #define DEFINE_SUPPRESSED_WARNING(func) \ struct __suppressed_warning __kunit_suppress_##func = \ - { .function = __stringify(func) } + { .function = __stringify(func), .counter = 0 } #define START_SUPPRESSED_WARNING(func) \ __start_suppress_warning(&__kunit_suppress_##func) @@ -39,12 +40,16 @@ bool __is_suppressed_warning(const char *function); #define IS_SUPPRESSED_WARNING(func) \ __is_suppressed_warning(func) +#define SUPPRESSED_WARNING_COUNT(func) \ + (__kunit_suppress_##func.counter) + #else /* CONFIG_KUNIT */ #define DEFINE_SUPPRESSED_WARNING(func) #define START_SUPPRESSED_WARNING(func) #define END_SUPPRESSED_WARNING(func) #define IS_SUPPRESSED_WARNING(func) (false) +#define SUPPRESSED_WARNING_COUNT(func) (0) #endif /* CONFIG_KUNIT */ #endif /* __ASSEMBLY__ */ diff --git a/lib/kunit/bug.c b/lib/kunit/bug.c index f93544d7a9d1..13b3d896c114 100644 --- a/lib/kunit/bug.c +++ b/lib/kunit/bug.c @@ -32,8 +32,10 @@ bool __is_suppressed_warning(const char *function) return false; list_for_each_entry(warning, &suppressed_warnings, node) { - if (!strcmp(function, warning->function)) + if (!strcmp(function, warning->function)) { + warning->counter++; return true; + } } return false; } -- 2.39.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 16BAAC54E66 for ; Tue, 12 Mar 2024 19:31:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QwDkCmjZ9Y27CU2RDEs8bFe5+2pjbZczcddpXs7dNFE=; b=G+jfiXxdIkr6vX URoLbnCpOeZV/zG9MWI3Rbfll0NrZxioAcmPoilIWuGWLnyVUE6XHRhBf3iG4PbitSpcMXrUSdip6 ag2yChl7w2SvOgMQsx5YRHTsSKGMKHt8HznJvcgj17DsZ5/guxFsK/XmcuRvzdhDjyvv5Sp5PkBmU IfW3ikKXBFV/VmnmPFkzmeVfDFFiMBo8kG5K0BDa2QLqjWbWA+V21/EvPPhpCjxa0kYWD7rqvZXRm FtglMkWtR6IJQsu/FX5tbXmLir/LfeCz7M2kftmiIdz7wTPZm9vAhN23eWNn9vMSvG1Lmi2Og26Ip /6z7gxBHdC6L80epvEMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rk7qQ-00000007IBf-2TLu; Tue, 12 Mar 2024 19:31:26 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rk5X5-00000006iac-3WsT; Tue, 12 Mar 2024 17:03:21 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1dc49b00bdbso34336775ad.3; Tue, 12 Mar 2024 10:03:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710262999; x=1710867799; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=R3Kc+Yh+XQ4llosDDGAwX/2k1FGi6g14GWlRJRORANM=; b=mUkelREQqLvN8BVawZEUf7EbtBBW3ePLGSKJVVNjP2ez66BiL/hHHZYuy2Jq/f9gKU Dgp2+yYWlRnqpLdOhEhu0qOYD7lLywaA3HavUmVK1aj/nUuFaE9txaRvpCKfQX1DbxXP ymvYsqMm1oPn6jolsEMZKUKqr82GPpPaXDdyGCeix02gB5b3Zxa4j3ZAaxjasz3rgzfJ rD85Xb8jjP67Mcuzhxeu6qqdGzIf6RwiUvuUOBT9HFsjeh2vTmU4q39RxVo+2y4cYQXh Ty++hhw2VvuL+wi+CqkmvSRIzRC/VQhZe90YuG6+ssayX7+xcmPO5a5O37Hukg11iRHX 3yRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710262999; x=1710867799; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=R3Kc+Yh+XQ4llosDDGAwX/2k1FGi6g14GWlRJRORANM=; b=IAphAlI4ejzgUQ/iuJRaoQ0NB4zipi7h25IQUUuuGdGEdmfdPXr5EUg5w+MNfazIAd 6jkszv57piAnUNRH6usGZhORv7qeLfgXmp9nWhGlnuER2Q96iB5DHr8p8LbSJMs8JD11 A3yH9WwMwQBgV5v83/ZFRJCGFCyuexeD7emx8uqLj7j6OccGhpP5V8tVTbnSSZ16z8IX +L+u8dT260n/PNxGCclE0305zfNYUeCuVZvIdxLnzNuLWfk8AtwzfbqE024vktb7dqOY Ilyeukd+oUwriYGQqCfPuB5ebA4nn++t2yZdJrrVQzToxBmxlYwGru8r+Cz2ta0+b4bw i4Lg== X-Forwarded-Encrypted: i=1; AJvYcCVGd6sAiGe3qZ4SnaszWqY9VqmD4K5IV3m5o9E0ElhS9A4X8J+rvUWm6jtiP/zkHRPkGDz95ib34xbELv9/ZLN22yzpThtsxYy2mL0YDD9jdzOiXvveuUNfS+B6Snw1qa1xLa2l34ApIPIj0/V3U/4FbZwY4eA= X-Gm-Message-State: AOJu0Yx15JSY3NjqKYdC05C4fqwR+p5F8f1s5Qacpim0NFFRZY7pa2E5 TmJkPR9Nl2btuyu2Ci4/yizX2YEH5nvkpvvqvJgsZRVjBrL4vss4 X-Google-Smtp-Source: AGHT+IEtMqO0igDV/OJPl9l/q0X7vf8EgJ9VbKv7ARIuPeUFcb0gEvMyJN5DQCEgr2SoDMnFKNIL1A== X-Received: by 2002:a17:902:7b95:b0:1dc:418f:890b with SMTP id w21-20020a1709027b9500b001dc418f890bmr8936395pll.40.1710262998624; Tue, 12 Mar 2024 10:03:18 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id e4-20020a170902b78400b001dcc3a46a6bsm6883069pls.262.2024.03.12.10.03.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 10:03:18 -0700 (PDT) From: Guenter Roeck To: linux-kselftest@vger.kernel.org Cc: David Airlie , Arnd Bergmann , =?UTF-8?q?Ma=C3=ADra=20Canal?= , Dan Carpenter , Kees Cook , Daniel Diaz , David Gow , Arthur Grillo , Brendan Higgins , Naresh Kamboju , Maarten Lankhorst , Andrew Morton , Maxime Ripard , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Daniel Vetter , Thomas Zimmermann , dri-devel@lists.freedesktop.org, kunit-dev@googlegroups.com, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, loongarch@lists.linux.dev, netdev@lists.linux.dev, Guenter Roeck Subject: [PATCH 02/14] kunit: bug: Count suppressed warning backtraces Date: Tue, 12 Mar 2024 10:02:57 -0700 Message-Id: <20240312170309.2546362-3-linux@roeck-us.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240312170309.2546362-1-linux@roeck-us.net> References: <20240312170309.2546362-1-linux@roeck-us.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240312_100319_918818_0F4C550B X-CRM114-Status: GOOD ( 13.82 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Count suppressed warning backtraces to enable code which suppresses warning backtraces to check if the expected backtrace(s) have been observed. Using atomics for the backtrace count resulted in build errors on some architectures due to include file recursion, so use a plain integer for now. Signed-off-by: Guenter Roeck --- include/kunit/bug.h | 7 ++++++- lib/kunit/bug.c | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/kunit/bug.h b/include/kunit/bug.h index 1e34da961599..2097a854ac8c 100644 --- a/include/kunit/bug.h +++ b/include/kunit/bug.h @@ -20,6 +20,7 @@ struct __suppressed_warning { struct list_head node; const char *function; + int counter; }; void __start_suppress_warning(struct __suppressed_warning *warning); @@ -28,7 +29,7 @@ bool __is_suppressed_warning(const char *function); #define DEFINE_SUPPRESSED_WARNING(func) \ struct __suppressed_warning __kunit_suppress_##func = \ - { .function = __stringify(func) } + { .function = __stringify(func), .counter = 0 } #define START_SUPPRESSED_WARNING(func) \ __start_suppress_warning(&__kunit_suppress_##func) @@ -39,12 +40,16 @@ bool __is_suppressed_warning(const char *function); #define IS_SUPPRESSED_WARNING(func) \ __is_suppressed_warning(func) +#define SUPPRESSED_WARNING_COUNT(func) \ + (__kunit_suppress_##func.counter) + #else /* CONFIG_KUNIT */ #define DEFINE_SUPPRESSED_WARNING(func) #define START_SUPPRESSED_WARNING(func) #define END_SUPPRESSED_WARNING(func) #define IS_SUPPRESSED_WARNING(func) (false) +#define SUPPRESSED_WARNING_COUNT(func) (0) #endif /* CONFIG_KUNIT */ #endif /* __ASSEMBLY__ */ diff --git a/lib/kunit/bug.c b/lib/kunit/bug.c index f93544d7a9d1..13b3d896c114 100644 --- a/lib/kunit/bug.c +++ b/lib/kunit/bug.c @@ -32,8 +32,10 @@ bool __is_suppressed_warning(const char *function) return false; list_for_each_entry(warning, &suppressed_warnings, node) { - if (!strcmp(function, warning->function)) + if (!strcmp(function, warning->function)) { + warning->counter++; return true; + } } return false; } -- 2.39.2 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 629DCC54E58 for ; Tue, 12 Mar 2024 17:05:26 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=K5hlEGxY; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4TvKlT0cpmz3dVm for ; Wed, 13 Mar 2024 04:05:25 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=K5hlEGxY; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::62d; helo=mail-pl1-x62d.google.com; envelope-from=groeck7@gmail.com; receiver=lists.ozlabs.org) Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4TvKj53bhVz3d2n for ; Wed, 13 Mar 2024 04:03:21 +1100 (AEDT) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1dd955753edso23090325ad.1 for ; Tue, 12 Mar 2024 10:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710262999; x=1710867799; darn=lists.ozlabs.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=R3Kc+Yh+XQ4llosDDGAwX/2k1FGi6g14GWlRJRORANM=; b=K5hlEGxYciy+RkT+/23XTGL8AwNlsA38+nOdBMJIQFnqhJ0tTAqwvWLkE2m+CAgtc2 GXCA3J3H1to7zrJ1Sih8asqCKvV7dP+k6if/NtMHEBNhZSkAg5bQr2klSakJ8YEy5NIM 0uzzfS/jQEhUUdx0PuoBOL1OqGUiiNiQccABAmqk/mBKU0TOjSIPBym8rNyKX2xBp+y9 JzuAcSukhYKnybIUGklfBTlcc9QHl6uaFj11uK3w7Dumasc3KOt4GP7+cHRV8TUUGUWW ixNwKg2DLcat3udVFJqMVgEStKBXjdA8GvZrjwVKCNghaYVKyldC6pbhpXX65TEm5on3 tIKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710262999; x=1710867799; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=R3Kc+Yh+XQ4llosDDGAwX/2k1FGi6g14GWlRJRORANM=; b=A+Ry64RxPPb6GxV2W0yt7zStkf9WgXZva/My9Cn4j0e89LtT4FD0dR0McA6h1T/CM9 JNfKWtUMTxUEtYQzr0xp7V+r1OWLqzDAltCOFXHbkG6cwES0sG6JzZJyRXP6XQ+zia9/ MgJc6NY9PbcyUEIl/mma0VCY4wXLxfOXTUjP58gdqrUX2sqdpCEtpr6OLqNsRByNDKC3 sVlZqm2m+4hRZYXDUSPgqiZ3H+ddtFh3+/mYlu8FTcKv15smqVP6855me7w8TdN2bRes 3uc8kyd4wl/28PA6IOEGjkme63ywKgZzUJVq2V7ISlimROjOgtadWgzgPySRcAfG8wuI Iyaw== X-Forwarded-Encrypted: i=1; AJvYcCXhn9Bsjv6hKWAWifVH1lTMnRa95bL2hHR/x7bE46rTo05qKGu6u+yQT9qTGuQgHOhyR6A24H8wdL+iNz49u8L1en5xxpx5ryod7MKu+A== X-Gm-Message-State: AOJu0YxmOApQgXQI2PSyUZU0fAbGhicTVQH6NlX2pj4nwhA9+7n81HCf G6iqWPhZvKwIEW/WEBvJxlsc2HWLYkc8FlQfH3xwR9k6ca9qIZsB X-Google-Smtp-Source: AGHT+IEtMqO0igDV/OJPl9l/q0X7vf8EgJ9VbKv7ARIuPeUFcb0gEvMyJN5DQCEgr2SoDMnFKNIL1A== X-Received: by 2002:a17:902:7b95:b0:1dc:418f:890b with SMTP id w21-20020a1709027b9500b001dc418f890bmr8936395pll.40.1710262998624; Tue, 12 Mar 2024 10:03:18 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id e4-20020a170902b78400b001dcc3a46a6bsm6883069pls.262.2024.03.12.10.03.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 10:03:18 -0700 (PDT) From: Guenter Roeck To: linux-kselftest@vger.kernel.org Subject: [PATCH 02/14] kunit: bug: Count suppressed warning backtraces Date: Tue, 12 Mar 2024 10:02:57 -0700 Message-Id: <20240312170309.2546362-3-linux@roeck-us.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240312170309.2546362-1-linux@roeck-us.net> References: <20240312170309.2546362-1-linux@roeck-us.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: loongarch@lists.linux.dev, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, Brendan Higgins , linux-riscv@lists.infradead.org, David Airlie , Arthur Grillo , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Daniel Diaz , linux-sh@vger.kernel.org, Naresh Kamboju , =?UTF-8?q?Ma=C3=ADra=20Canal?= , Dan Carpenter , Guenter Roeck , netdev@lists.linux.dev, Kees Cook , Arnd Bergmann , Maarten Lankhorst , Maxime Ripard , David Gow , Daniel Vetter , linux-arm-kernel@lists.infradead.org, kunit-dev@googlegroups.com, linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Zimmerman n , Andrew Morton , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Count suppressed warning backtraces to enable code which suppresses warning backtraces to check if the expected backtrace(s) have been observed. Using atomics for the backtrace count resulted in build errors on some architectures due to include file recursion, so use a plain integer for now. Signed-off-by: Guenter Roeck --- include/kunit/bug.h | 7 ++++++- lib/kunit/bug.c | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/kunit/bug.h b/include/kunit/bug.h index 1e34da961599..2097a854ac8c 100644 --- a/include/kunit/bug.h +++ b/include/kunit/bug.h @@ -20,6 +20,7 @@ struct __suppressed_warning { struct list_head node; const char *function; + int counter; }; void __start_suppress_warning(struct __suppressed_warning *warning); @@ -28,7 +29,7 @@ bool __is_suppressed_warning(const char *function); #define DEFINE_SUPPRESSED_WARNING(func) \ struct __suppressed_warning __kunit_suppress_##func = \ - { .function = __stringify(func) } + { .function = __stringify(func), .counter = 0 } #define START_SUPPRESSED_WARNING(func) \ __start_suppress_warning(&__kunit_suppress_##func) @@ -39,12 +40,16 @@ bool __is_suppressed_warning(const char *function); #define IS_SUPPRESSED_WARNING(func) \ __is_suppressed_warning(func) +#define SUPPRESSED_WARNING_COUNT(func) \ + (__kunit_suppress_##func.counter) + #else /* CONFIG_KUNIT */ #define DEFINE_SUPPRESSED_WARNING(func) #define START_SUPPRESSED_WARNING(func) #define END_SUPPRESSED_WARNING(func) #define IS_SUPPRESSED_WARNING(func) (false) +#define SUPPRESSED_WARNING_COUNT(func) (0) #endif /* CONFIG_KUNIT */ #endif /* __ASSEMBLY__ */ diff --git a/lib/kunit/bug.c b/lib/kunit/bug.c index f93544d7a9d1..13b3d896c114 100644 --- a/lib/kunit/bug.c +++ b/lib/kunit/bug.c @@ -32,8 +32,10 @@ bool __is_suppressed_warning(const char *function) return false; list_for_each_entry(warning, &suppressed_warnings, node) { - if (!strcmp(function, warning->function)) + if (!strcmp(function, warning->function)) { + warning->counter++; return true; + } } return false; } -- 2.39.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2C1B4C54E69 for ; Tue, 12 Mar 2024 17:03:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=N3FXq3nWX1iu2j8V+uJhL3hRzjQ26eC/+tqhyaJHG8E=; b=ThJKrD2FKdYmPT IZAJgYhNctRSvIuuY4QaN28QPf6vX6erV8Z+TkWtHekK+PfAMYlB7w7ZuRotiGD8IuyIfrenXQMPz bwJz/lURm3cWH1wWHM1LDTzF5qUw95gmPNGFSCLPDBhlbxU54KtcfKGFIDoe29kfVvgX7BMxaqaMx TF/4Vg8O9naSK306k4GwRAJPI/YQLN2r7w66iWwfRcEwXVVBtj2iwj/uiSUKUZOMPeioGGvYInQU3 pqUIe10l09xM2DtlQ0RSQW/S/bFKlGB3SWLAxNZEGMJ2NOxTO8QHUL48/K0uX0ho4Onrd66F8DLlG TcMFXaEjYYgCuRLn9w5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rk5XJ-00000006im6-3nZq; Tue, 12 Mar 2024 17:03:33 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rk5X5-00000006iac-3WsT; Tue, 12 Mar 2024 17:03:21 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1dc49b00bdbso34336775ad.3; Tue, 12 Mar 2024 10:03:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710262999; x=1710867799; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=R3Kc+Yh+XQ4llosDDGAwX/2k1FGi6g14GWlRJRORANM=; b=mUkelREQqLvN8BVawZEUf7EbtBBW3ePLGSKJVVNjP2ez66BiL/hHHZYuy2Jq/f9gKU Dgp2+yYWlRnqpLdOhEhu0qOYD7lLywaA3HavUmVK1aj/nUuFaE9txaRvpCKfQX1DbxXP ymvYsqMm1oPn6jolsEMZKUKqr82GPpPaXDdyGCeix02gB5b3Zxa4j3ZAaxjasz3rgzfJ rD85Xb8jjP67Mcuzhxeu6qqdGzIf6RwiUvuUOBT9HFsjeh2vTmU4q39RxVo+2y4cYQXh Ty++hhw2VvuL+wi+CqkmvSRIzRC/VQhZe90YuG6+ssayX7+xcmPO5a5O37Hukg11iRHX 3yRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710262999; x=1710867799; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=R3Kc+Yh+XQ4llosDDGAwX/2k1FGi6g14GWlRJRORANM=; b=IAphAlI4ejzgUQ/iuJRaoQ0NB4zipi7h25IQUUuuGdGEdmfdPXr5EUg5w+MNfazIAd 6jkszv57piAnUNRH6usGZhORv7qeLfgXmp9nWhGlnuER2Q96iB5DHr8p8LbSJMs8JD11 A3yH9WwMwQBgV5v83/ZFRJCGFCyuexeD7emx8uqLj7j6OccGhpP5V8tVTbnSSZ16z8IX +L+u8dT260n/PNxGCclE0305zfNYUeCuVZvIdxLnzNuLWfk8AtwzfbqE024vktb7dqOY Ilyeukd+oUwriYGQqCfPuB5ebA4nn++t2yZdJrrVQzToxBmxlYwGru8r+Cz2ta0+b4bw i4Lg== X-Forwarded-Encrypted: i=1; AJvYcCVGd6sAiGe3qZ4SnaszWqY9VqmD4K5IV3m5o9E0ElhS9A4X8J+rvUWm6jtiP/zkHRPkGDz95ib34xbELv9/ZLN22yzpThtsxYy2mL0YDD9jdzOiXvveuUNfS+B6Snw1qa1xLa2l34ApIPIj0/V3U/4FbZwY4eA= X-Gm-Message-State: AOJu0Yx15JSY3NjqKYdC05C4fqwR+p5F8f1s5Qacpim0NFFRZY7pa2E5 TmJkPR9Nl2btuyu2Ci4/yizX2YEH5nvkpvvqvJgsZRVjBrL4vss4 X-Google-Smtp-Source: AGHT+IEtMqO0igDV/OJPl9l/q0X7vf8EgJ9VbKv7ARIuPeUFcb0gEvMyJN5DQCEgr2SoDMnFKNIL1A== X-Received: by 2002:a17:902:7b95:b0:1dc:418f:890b with SMTP id w21-20020a1709027b9500b001dc418f890bmr8936395pll.40.1710262998624; Tue, 12 Mar 2024 10:03:18 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id e4-20020a170902b78400b001dcc3a46a6bsm6883069pls.262.2024.03.12.10.03.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 10:03:18 -0700 (PDT) From: Guenter Roeck To: linux-kselftest@vger.kernel.org Cc: David Airlie , Arnd Bergmann , =?UTF-8?q?Ma=C3=ADra=20Canal?= , Dan Carpenter , Kees Cook , Daniel Diaz , David Gow , Arthur Grillo , Brendan Higgins , Naresh Kamboju , Maarten Lankhorst , Andrew Morton , Maxime Ripard , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Daniel Vetter , Thomas Zimmermann , dri-devel@lists.freedesktop.org, kunit-dev@googlegroups.com, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, loongarch@lists.linux.dev, netdev@lists.linux.dev, Guenter Roeck Subject: [PATCH 02/14] kunit: bug: Count suppressed warning backtraces Date: Tue, 12 Mar 2024 10:02:57 -0700 Message-Id: <20240312170309.2546362-3-linux@roeck-us.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240312170309.2546362-1-linux@roeck-us.net> References: <20240312170309.2546362-1-linux@roeck-us.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240312_100319_918818_0F4C550B X-CRM114-Status: GOOD ( 13.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Count suppressed warning backtraces to enable code which suppresses warning backtraces to check if the expected backtrace(s) have been observed. Using atomics for the backtrace count resulted in build errors on some architectures due to include file recursion, so use a plain integer for now. Signed-off-by: Guenter Roeck --- include/kunit/bug.h | 7 ++++++- lib/kunit/bug.c | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/kunit/bug.h b/include/kunit/bug.h index 1e34da961599..2097a854ac8c 100644 --- a/include/kunit/bug.h +++ b/include/kunit/bug.h @@ -20,6 +20,7 @@ struct __suppressed_warning { struct list_head node; const char *function; + int counter; }; void __start_suppress_warning(struct __suppressed_warning *warning); @@ -28,7 +29,7 @@ bool __is_suppressed_warning(const char *function); #define DEFINE_SUPPRESSED_WARNING(func) \ struct __suppressed_warning __kunit_suppress_##func = \ - { .function = __stringify(func) } + { .function = __stringify(func), .counter = 0 } #define START_SUPPRESSED_WARNING(func) \ __start_suppress_warning(&__kunit_suppress_##func) @@ -39,12 +40,16 @@ bool __is_suppressed_warning(const char *function); #define IS_SUPPRESSED_WARNING(func) \ __is_suppressed_warning(func) +#define SUPPRESSED_WARNING_COUNT(func) \ + (__kunit_suppress_##func.counter) + #else /* CONFIG_KUNIT */ #define DEFINE_SUPPRESSED_WARNING(func) #define START_SUPPRESSED_WARNING(func) #define END_SUPPRESSED_WARNING(func) #define IS_SUPPRESSED_WARNING(func) (false) +#define SUPPRESSED_WARNING_COUNT(func) (0) #endif /* CONFIG_KUNIT */ #endif /* __ASSEMBLY__ */ diff --git a/lib/kunit/bug.c b/lib/kunit/bug.c index f93544d7a9d1..13b3d896c114 100644 --- a/lib/kunit/bug.c +++ b/lib/kunit/bug.c @@ -32,8 +32,10 @@ bool __is_suppressed_warning(const char *function) return false; list_for_each_entry(warning, &suppressed_warnings, node) { - if (!strcmp(function, warning->function)) + if (!strcmp(function, warning->function)) { + warning->counter++; return true; + } } return false; } -- 2.39.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel