Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2600412rdh; Mon, 30 Oct 2023 02:03:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFgvtjaEbv0jRMpkL9of5vYXpS2kr2y5XTJZ77WSn1J1afP2dEPndHj76dFlk3QXJI4X9H7 X-Received: by 2002:a05:6870:b14e:b0:1e9:e268:ab6f with SMTP id a14-20020a056870b14e00b001e9e268ab6fmr12758753oal.17.1698656609272; Mon, 30 Oct 2023 02:03:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698656609; cv=none; d=google.com; s=arc-20160816; b=TR6FN7nYocj3bkMy/vzEy1/4rBOu3Z7tCdFEzkKMVqVBKRDPhN4ZpADhqrkZ3FOdfl tTDUFJHJkHn5sUB4jpBAV1QBEbuVqO2BiHUcCXtahfJ/tiULvLJ5/Twr4krEOVOOpw2S 2Ef0NkC4ojEZ3Jti2zmhS87JyYbsI1LFKW36isZCeNX33tq1kgr+s+aXt3mKP3p35U/C IWIE9Jw/oLqiNOJ/SpB+tzG4ypVx+0cQ0xgpPP0XeRjNlq4hU68SNJDWOk0MasHobKSH kTWBZ80OJ27ijnlbwubAnzbVbAlQ7981jSxJtMf/V2/eDvmVLIa404JMW/WHSuT+FJBk ft2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=y5DNReJrJjqC3ApxSGU7LvngHjOHwZujFq9jNZRCwZ0=; fh=vKqzGOufYusig3Fd8I1I/ezaJ/Jr5UwTXdQHo7/JRNQ=; b=X4tbBR1YjDTzyx86ouSdh1vTXoO7/bWMdE6HaIKc1VCxgkRliz9TwpbgRvTNiRZNMc OqjpMh16MDi1hj6RAHaTR5b2Fw2pHuFUGglbPzbyg0zASB3M7/ZKqV97r1R7PZvS9XWq /rz6duBfp6hzGgSQmW1fvB4ljPo5vGdieNRHBxREuokCaYrRoG6wYvNkNO6qXx0COvIO bWkXouwS6V7tfpjXPmYz3SWmUpJpApqGjZkx0yMiNC8dQfIZlDFEUW5w7c8Ml9wVcGNp TvANXTPxA15sSje7gqncKamGWFU4H7d4gWfWgMiH6gnLlglHXskFwrd051I3Ty+iP9/5 ADzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Knd5/ZgA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id f27-20020a63555b000000b0056a36f9eb0esi4771287pgm.15.2023.10.30.02.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 02:03:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Knd5/ZgA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id DD21180984AF; Mon, 30 Oct 2023 02:03:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232319AbjJ3JDT (ORCPT + 99 others); Mon, 30 Oct 2023 05:03:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232320AbjJ3JDS (ORCPT ); Mon, 30 Oct 2023 05:03:18 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0EC6B7 for ; Mon, 30 Oct 2023 02:03:15 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-32f70391608so1738550f8f.2 for ; Mon, 30 Oct 2023 02:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698656594; x=1699261394; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=y5DNReJrJjqC3ApxSGU7LvngHjOHwZujFq9jNZRCwZ0=; b=Knd5/ZgAFGenFoFuAX7lFdY109eZxtGViHvleFy7dLLDhOiLL79k0FB1rSBURa9pH7 TB/q2FvPRvQSiV+BzeM7IcaaIqZpJDtxX+t6+VDxjcPpu8XxDlWm2SbOJ9QP2myufPzi etgcWbbODMVYhY1R5EXonoHqiyDmaBp0xmeUNmIR0cONhDDr7tr/MVsaE66Qt/BLqfsy CzBIbiY7AWA4JHeMthpQLCqvonXWIP5qYT2++wa4+6gFtXjdVHBQg3bbIWWtNc8O0IUM qrxXCsSFz55cHalcAySHn15CkVNRJ3AR1ORGdxDOWFnuBjLcHT+/rloVhGptMwvlaSbV m4Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698656594; x=1699261394; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=y5DNReJrJjqC3ApxSGU7LvngHjOHwZujFq9jNZRCwZ0=; b=wNXQQ4AhapgeKvnfSEB7ZEKiRGGicQiehcsitIQz9/Ydyw17we/4QC0/eqKXPkAN+z qsbmdAR2QAbsZ2dub8AKE8SirZELaTLjmJmoUepzHTM7JabJKcsg7VVJTaVTXvAnzZkh FX0GedfzcYg9EPXtshKYRYGVbUao7efsYNV/uOMs/dp5gwr5Y+VkxFJ5X/kucxlZx4Er NQJReWpRadv6WgQPQ40GEKJIGi68pK4wuKHq9SAfGtBra1U/g7IzCeiEYFkmwClo5Tsz pS4mXscgoElpigoz3FXwHv1JeKwIJqt60Kme1rwOPAtqtk1kNXGz9ydeP0iLwzSACvoy llzA== X-Gm-Message-State: AOJu0YxBzeaaXPZY1Kr90U6Z+J5EWZtRDdRmNQ2tG1/lZ8b7cyyZmaGC JuDcSXjCXeNWxh5CaYrnlOcKBw== X-Received: by 2002:adf:f18a:0:b0:32d:ac49:2bb1 with SMTP id h10-20020adff18a000000b0032dac492bb1mr7477941wro.63.1698656593914; Mon, 30 Oct 2023 02:03:13 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id u9-20020a5d6ac9000000b0032d687fd9d0sm7701427wrw.19.2023.10.30.02.03.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 02:03:13 -0700 (PDT) Date: Mon, 30 Oct 2023 12:01:33 +0300 From: Dan Carpenter To: Maarten Lankhorst , Kees Cook , Daniel =?iso-8859-1?Q?D=EDaz?= Cc: Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Brendan Higgins , David Gow , =?iso-8859-1?Q?Ma=EDra?= Canal , Arthur Grillo , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, kernel-janitors@vger.kernel.org, Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Naresh Kamboju , kv-team Subject: [RFC] drm/tests: annotate intentional stack trace in drm_test_rect_calc_hscale() Message-ID: <02546e59-1afe-4b08-ba81-d94f3b691c9a@moroto.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 30 Oct 2023 02:03:27 -0700 (PDT) We have started printing more and more intentional stack traces. Whether it's testing KASAN is able to detect use after frees or it's part of a kunit test. These stack traces can be problematic. They suddenly show up as a new failure. Now the test team has to contact the developers. A bunch of people have to investigate the bug. We finally decide that it's intentional so now the test team has to update their filter scripts to mark it as intentional. These filters are ad-hoc because there is no standard format for warnings. A better way would be to mark it as intentional from the start. Here, I have marked the beginning and the end of the trace. It's more tricky for things like lkdtm_FORTIFY_MEM_MEMBER() where the flow doesn't reach the end of the function. I guess I would print a different warning for stack traces that can't have a "Intentional warning finished\n" message at the end. I haven't actually tested this patch... Daniel, do you have a list of intentional stack traces we could annotate? Signed-off-by: Dan Carpenter --- drivers/gpu/drm/tests/drm_rect_test.c | 2 ++ include/kunit/test.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_rect_test.c b/drivers/gpu/drm/tests/drm_rect_test.c index 76332cd2ead8..367738254493 100644 --- a/drivers/gpu/drm/tests/drm_rect_test.c +++ b/drivers/gpu/drm/tests/drm_rect_test.c @@ -409,8 +409,10 @@ static void drm_test_rect_calc_hscale(struct kunit *test) const struct drm_rect_scale_case *params = test->param_value; int scaling_factor; + START_INTENTIONAL_WARNING(); scaling_factor = drm_rect_calc_hscale(¶ms->src, ¶ms->dst, params->min_range, params->max_range); + END_INTENTIONAL_WARNING(); KUNIT_EXPECT_EQ(test, scaling_factor, params->expected_scaling_factor); } diff --git a/include/kunit/test.h b/include/kunit/test.h index 20ed9f9275c9..1f01d4c81055 100644 --- a/include/kunit/test.h +++ b/include/kunit/test.h @@ -337,6 +337,9 @@ void __kunit_test_suites_exit(struct kunit_suite **suites, int num_suites); void kunit_exec_run_tests(struct kunit_suite_set *suite_set, bool builtin); void kunit_exec_list_tests(struct kunit_suite_set *suite_set, bool include_attr); +#define START_INTENTIONAL_WARNING() pr_info("Triggering a stack trace\n") +#define END_INTENTIONAL_WARNING() pr_info("Intentional warning finished\n") + #if IS_BUILTIN(CONFIG_KUNIT) int kunit_run_all_tests(void); #else -- 2.42.0