Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp75647lqi; Wed, 6 Mar 2024 10:24:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXtCVfXE2d4bkh7gvaktpaInonNY5o2Uqjx4lyvS8fBfCRYc68ZvTY+q3v/UBr8WdBUOX4F9/xjk2u+LMG8cx6nobBBqtZgFpFVwgqLzQ== X-Google-Smtp-Source: AGHT+IEzYDDDMul6WTXcd3YZatLh2HAcFwTUOy72RcNSK9leMRFiVxVpovBMo+kI9sETxW1B14rf X-Received: by 2002:a50:8d89:0:b0:565:cbba:b7a1 with SMTP id r9-20020a508d89000000b00565cbbab7a1mr10186792edh.1.1709749468069; Wed, 06 Mar 2024 10:24:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709749468; cv=pass; d=google.com; s=arc-20160816; b=RGqVOlju4k8HPQHvYJg14NENR3c+6BFv0fx/AciMuHVwaMkiC4X3ShfnzDsun5rA1A 7FptYKXMrKAiExIoHjatKs0BVFUq4FG3t1ZwvHfldygvBf8ja7hnRKZ156rBxpyuj14C bONqWXXEspmnGXJaPtFx2MVJMYTIQTvgXBRflpS44sMfLBELt9Cz1CtyP7yGpLUOqNb6 oOIVQ/vgeGJ/fPIBNMyIZAhpOZGgmUo9mMjsTM6wH+y3r/XXg1gxIEQnRpp7tX1n+mrT 4CERiB7Aw9veKdOjUWmiI4e4pD7yj3/kh9JYF3q2RUjhRlQhgXC0B+rF29zVGyjSKXyB xDBA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=RWWS4LnVP/asDNzm/6wkKWnD1LdXMDQVgVaviFZ4aPg=; fh=PFpjOaAnK9eiMEU6fQiKqPLKr/3PycZnHAFXgPn5Utg=; b=IYAIopwaWfDMgU2sBTTofWReimigKA0l7Bq4V8Af+G1mXOMPFYaj3DSsIq9qRGEVHi +TJsg9dfimXt+vgLxV7vI6qrqduoqO4YANvcy4pwNxNoMEXEniSun62R2QOdXaMlugsM hsfHE6FKzIEg479dkWwJAPPbiO6uSViyheYDT/I/n1Ia9ToZW93XKbas5e10ffeW1vho wtiODWptBfz5lVfe3cCzipfLdkvCDlXfC3tBMYf7nHULgGaJuS+46uV9iVd3OrEzEhjo c2o+FU8AjWvC3jUaUN/MhDB/3ZHOWfZhW+Y98u5deRofhP2nX000/Ibg4npBdmFvbgDo MDWg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xSDSt4M9; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-94389-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94389-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z94-20020a509e67000000b005662fd4afb5si6000518ede.381.2024.03.06.10.24.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 10:24:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94389-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xSDSt4M9; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-94389-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94389-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9C5811F22763 for ; Wed, 6 Mar 2024 18:24:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E835713E7C0; Wed, 6 Mar 2024 18:24:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="xSDSt4M9" Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.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 394755D8F0 for ; Wed, 6 Mar 2024 18:24:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709749462; cv=none; b=A2u65ggKxHvCbeTDDlHKEpxRHE/68t267bXBf40ylSB2FNp9JwHQn5BPfT7HIzMA77OAbYLf0H7rPTgWA4Nzc7UnLeZYeT/k+QDVbNxLcablZ/oQHxuUCS0MdQOV61qN3pj2Fa6+XN2Msrz9WeThIHL5S9kjYjGU4r8rJs/dOvE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709749462; c=relaxed/simple; bh=WytS40ZdmsM5zwjaJMMr9w3erghzLSkCQiyje+s3eGY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=YW0O1Arhptz82WL1gZsc25qzKtD2T4me9Y3DgsApT5bBIzvrzEx6HqIecfRZbA3fr7ySnWqYMduCpc5SlRs17+bbmZoyBiYigC4atCtLOoqwFEjc0BDSnxsYKA97gxgrUjFhLNG0gNEJhSl0MHSrPplsTwEfS31lReDEdG9qLAE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=xSDSt4M9; arc=none smtp.client-ip=209.85.215.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-5d81b08d6f2so6415486a12.0 for ; Wed, 06 Mar 2024 10:24:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709749456; x=1710354256; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=RWWS4LnVP/asDNzm/6wkKWnD1LdXMDQVgVaviFZ4aPg=; b=xSDSt4M9UoLeDP7OmunKwSARN+zE8oqO+Vx00xIodsni+Jai1c6Oo1sgafAF+ggn6q FjeR+7UjMDREMOatQi7cqH0B7Ae4eXdLJCD45B7kxTVv+ZozK6sG3NsyJgxYik7t23Uo I0ekengU3Gg3M2aWWBhsUO/sdc7TYx2rKXZQ0pMH7BE87AKqmZucvGmabW7HZHTfBQ+J 60lJ/k6QKlIWfT5zhsXpqs4xz6SQKfIa2X6FzIJ0/QzGacD0Yq5s/JGxxasW4KQ5gwyk +Ua95cMya9C8VrcfWP42WOvMQt2T9fHpseneaFXvE8I/EE5FeO3YmUh7cSLt2O8p6vSG ZBXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709749456; x=1710354256; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RWWS4LnVP/asDNzm/6wkKWnD1LdXMDQVgVaviFZ4aPg=; b=r+l3YabmpbhxLGNpTzgOD7t5BhSgWtFYDoC/oIKuqURlSeYFjtLfx471jb/wp7ZovI G9/ocmujDz5jAt+21RuKwXZ+Xi+WWYSeHOJkSQOyRt+f6tNhBpY42hCUk9Cl2mlKYQix I0TUxioQNaKEfS9QtjsrSgv46KJmXLvAjrv9HeYeDA4Rd9ao5+7d+st3NyUk48GWsdrL tSelwzWjZST9OJM6wYvMrsx5Y9uJbFtGCsvD509i8RkIUfmIL7smA5CeY5pEaLyPyJo7 uMFO6wTC6Narx/Jdl4PZiR04UwZT3CuZaOg43q+YsOf5UAVBCAGAMGw8R3ta07ULx1gL FFjg== X-Forwarded-Encrypted: i=1; AJvYcCXKHuNv1r1Ij1xeWAXpU2t7Ctta/b9sj81F9cadudyYR7IjlpmJSp+lorA0zT9rVj5Nrerr4h90OFd/CFwT43KjePBavTzWf0mgI8kP X-Gm-Message-State: AOJu0YxOq/pgeazwABx3CFZwyayBWzJK7M7dTH0ZLzekA4h4ktK6vwUQ hZpjDcJN490+lit/VKlJ64sMNi/ckRp9WqA2sknx4wG88mrHNuFdj1RBRGgI4QVoH4lD66laJsQ pQIoXyOQw31EZ/M/P182TLLSpkTmEH0LNrwMQ7A== X-Received: by 2002:a17:90a:8986:b0:29a:c886:243e with SMTP id v6-20020a17090a898600b0029ac886243emr14404213pjn.39.1709749456443; Wed, 06 Mar 2024 10:24:16 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240305184033.425294-1-linux@roeck-us.net> In-Reply-To: <20240305184033.425294-1-linux@roeck-us.net> From: =?UTF-8?B?RGFuaWVsIETDrWF6?= Date: Wed, 6 Mar 2024 12:24:05 -0600 Message-ID: Subject: Re: [RFC PATCH 0/5] Add support for suppressing warning backtraces To: Guenter Roeck Cc: linux-kselftest@vger.kernel.org, David Airlie , Arnd Bergmann , =?UTF-8?B?TWHDrXJhIENhbmFs?= , Dan Carpenter , Kees Cook , David Gow , Arthur Grillo , Brendan Higgins , Naresh Kamboju , Maarten Lankhorst , Andrew Morton , Maxime Ripard , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , Daniel Vetter , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kunit-dev@googlegroups.com, linux-arch@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello! On Tue, 5 Mar 2024 at 12:40, Guenter Roeck wrote: > Some unit tests intentionally trigger warning backtraces by passing bad > parameters to kernel API functions. Such unit tests typically check the > return value from such calls, not the existence of the warning backtrace. > > Such intentionally generated warning backtraces are neither desirable > nor useful for a number of reasons. > - They can result in overlooked real problems. > - A warning that suddenly starts to show up in unit tests needs to be > investigated and has to be marked to be ignored, for example by > adjusting filter scripts. Such filters are ad-hoc because there is > no real standard format for warnings. On top of that, such filter > scripts would require constant maintenance. > > One option to address problem would be to add messages such as "expected > warning backtraces start / end here" to the kernel log. However, that > would again require filter scripts, it might result in missing real > problematic warning backtraces triggered while the test is running, and > the irrelevant backtrace(s) would still clog the kernel log. > > Solve the problem by providing a means to identify and suppress specific > warning backtraces while executing test code. Support suppressing multipl= e > backtraces while at the same time limiting changes to generic code to the > absolute minimum. Architecture specific changes are kept at minimum by > retaining function names only if both CONFIG_DEBUG_BUGVERBOSE and > CONFIG_KUNIT are enabled. > > The first patch of the series introduces the necessary infrastructure. > The second patch marks the warning message in drm_calc_scale() in the DRM > subsystem as intentional where warranted. This patch is intended to serve > as an example for the use of the functionality introduced with this serie= s. > The last three patches in the series introduce the necessary architecture > specific changes for x86, arm64, and loongarch. > > This series is based on the RFC patch and subsequent discussion at > https://patchwork.kernel.org/project/linux-kselftest/patch/02546e59-1afe-= 4b08-ba81-d94f3b691c9a@moroto.mountain/ > and offers a more comprehensive solution of the problem discussed there. > > Checkpatch note: > Remaining checkpatch errors and warnings were deliberately ignored. > Some are triggered by matching coding style or by comments interpreted > as code, others by assembler macros which are disliked by checkpatch. > Suggestions for improvements are welcome. > > Some questions: > > - Is the general approach promising ? If not, are there other possible > solutions ? > - Function pointers are only added to the __bug_table section if both > CONFIG_KUNIT and CONFIG_DEBUG_BUGVERBOSE are enabled. This avoids image > size increases if CONFIG_KUNIT=3Dn. Downside is slightly more complex > architecture specific assembler code. If function pointers were always > added to the __bug_table section, vmlinux image size would increase by > approximately 0.6-0.7%. Is the increased complexity in assembler code > worth the reduced image size ? I think so, but I would like to hear > other opinions. > - There are additional possibilities associated with storing the bug > function name in the __bug_table section. It could be independent of > KUNIT, it could be a configuration flag, and/or it could be used to > display the name of the offending function in BUG/WARN messages. > Is any of those of interest ? Thank you SO very much for this work! This is very much appreciated! We run into these warnings at LKFT all the time, and making sure that the noise doesn't drown the relevant signal is very important. Greetings! Daniel D=C3=ADaz daniel.diaz@linaro.org