Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2857758pxb; Thu, 3 Feb 2022 16:37:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHBeGk+rZ9DJaAr2tjAEziY3Z5J8vfkRv6V+LU5uy6sNC/UAwkHwHnsj8HAb4dRhJpmvjb X-Received: by 2002:a17:90a:1549:: with SMTP id y9mr334497pja.134.1643935035196; Thu, 03 Feb 2022 16:37:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643935035; cv=none; d=google.com; s=arc-20160816; b=fuHSQ5a7oIP41+ytk1U5sKqbL4oXMJ7yCfocJB2oujNOjJ4okIccr4NSxyC3THLoa6 vU7K4AyJEsV/b/dJocRmy4njEHMXimrJYjZEz24qECPkyBzKqWifAk5Al5iqfLf9ZdGo N+HBcalJgCFkbtzhkWBqc4s3tKQoe/tbLsbO1FHe0pGcCnYV7Mac0WZs/kKeVMT6Oqzv SJjt7rna4WtjJbRSJ9o5YIdsraJ/tor7AGU4jhKcF4Uw4nFyOSqSsq+XiVf39TL6c48/ qHEZjsEHp7P4H8pwetfHcY4PKdxTghR+o/8ZJo2FvMdRC6YWddqMyc4GBI1RcbZAGLzM jv5w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=zvZjFpyIkbMZ/ze0qgMESQH0VN7MsTwLvLVU0S1wAiQ=; b=NjTGXAa9T3T9+tJTouCMAT3ZQ7Xiz9WrzbZRwweTYNTBO8lUvUcdqwu7/M1+oEqgx2 HUfl0eXJdmUH6f2EtXu81SKFJztrwLw+rSe7Li31jZJxaRHFetuIGhBAn/AuWCw9SpE6 8JbcCcqJWRtpmQYZggnt2ozqe3i27NPhJqm/EN1PCjlsOLPqA9NoQth+vdCvaxmcHpb4 vDq6UT1Kr/h1Mtl822KYC0+1b6TPP7sSWAHig6lNgk7i9yd0Ual5MWCo8TtI1PN6uLk9 Phk8mgNcZFdM3fqlE4+LqIXeglPtc4P/7fwkUg0JvDElQX30GoPadFsq0Lyumqozny+r lOeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZjZZWUpb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7si390414plk.448.2022.02.03.16.36.53; Thu, 03 Feb 2022 16:37:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZjZZWUpb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244318AbiBBTp0 (ORCPT + 99 others); Wed, 2 Feb 2022 14:45:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229889AbiBBTpY (ORCPT ); Wed, 2 Feb 2022 14:45:24 -0500 Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09F1BC061714; Wed, 2 Feb 2022 11:45:24 -0800 (PST) Received: by mail-qv1-xf35.google.com with SMTP id e20so571351qvu.7; Wed, 02 Feb 2022 11:45:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zvZjFpyIkbMZ/ze0qgMESQH0VN7MsTwLvLVU0S1wAiQ=; b=ZjZZWUpbJ4YlRq/+yUqkwRremL1orcOhbUOfoJdo7VKeZOMKKWQ3Eqcb0mTxCFyyf+ /dSoFi0zX1Rx1vZqWcFPY9e/e0ev9Q6dFxZU3xdLqx+sa2JPG6kQBkZPLzIn7PlU7TDK 4VsQgIf7xkNz39RjWwKafCd9nrKUbF+X/wbCP2vGJca07c/ATZ+vkPk7ri0s7Oge2a4Z bSiqTc6Zg0KlzAdDZW5jUyvXthTFS+B/Rng63lb2hsNOonWe0hxBEb21/pZRR7TUUdIs T64s5Fff6ypHmpevHkE2zfZQu3w6i8eWoTTJ2B20fvlW93RubBS+JdvUCvJ2+xh2uGOf eqpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zvZjFpyIkbMZ/ze0qgMESQH0VN7MsTwLvLVU0S1wAiQ=; b=O/Em12WM07dvlNxgAa6aLyGLEJU/dPwlHSpcO2/FXri9urrfttQ3tx0YAsYSyFrST4 o69B7dJBXQ0B5BGh/L2dBGdy9fFqCpo13ygXCI4Nv6urrvG7TFpMMhEeNngZh2Q6yTr/ rfwiBThKtmSDhad+sbLtiFuv04aHD7CYBu/ctW2gCWYSoA8oGYnotOQMjBm1ddch5vYn 9NH93+7eVN+NHreWCrjSNWb8rtuRQDYQJXXFxid8gdRYCGvSS1SiOklrisqitlYbRuhU cETxFhgFEHSXelUv7Q+wR3aGwlc07Fdz31Thklmiq/Ub94beJ+ZGf+c88iVa/dFD45lm OSzQ== X-Gm-Message-State: AOAM531znMMkDkI7BGzwuWGqvxPtQzm4EAInbrfOUNY39zAm29pdm9Gn AhCRLCAUiNH89eiuypf9ATUt5CEO8F4= X-Received: by 2002:ad4:5bae:: with SMTP id 14mr27585672qvq.69.1643831123186; Wed, 02 Feb 2022 11:45:23 -0800 (PST) Received: from localhost.localdomain (c-67-187-90-124.hsd1.tn.comcast.net. [67.187.90.124]) by smtp.gmail.com with ESMTPSA id y16sm1907888qta.11.2022.02.02.11.45.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 11:45:22 -0800 (PST) From: frowand.list@gmail.com To: Rob Herring Cc: Naresh Kamboju , Brendan Higgins , Anders Roxell , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] of: unittest: config option - print pass message at same level as fail Date: Wed, 2 Feb 2022 13:45:13 -0600 Message-Id: <20220202194513.2840070-1-frowand.list@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Frank Rowand Printing the devicetree unittest pass message for each passed test creates much console verbosity. The existing pass messages are printed at loglevel KERN_DEBUG so they will not print by default. The test community expects either a pass or a fail message for each test in a test suite. The messages are typically post-processed to report pass/fail results. The pass messages can currently be reported by enabling KERN_DEBUG loglevel for the console, but this also results in other additional messages. Create OF_UNITTEST_SHOW_PASS to enable printing the pass messages at the same loglevel as the fail messages. Signed-off-by: Frank Rowand --- drivers/of/Kconfig | 10 ++++++++++ drivers/of/unittest.c | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig index 80b5fd44ab1c..6ad05df4f7d4 100644 --- a/drivers/of/Kconfig +++ b/drivers/of/Kconfig @@ -25,6 +25,16 @@ config OF_UNITTEST If unsure, say N here, but this option is safe to enable. +config OF_UNITTEST_SHOW_PASS + bool "Device Tree runtime unit tests, report each pass" + depends on OF_UNITTEST + help + The messages reporting an individual test pass are normally + printed at loglevel KERN_DEBUG. Enable this option to print + the PASS messages at the same loglevel as the FAIL messages. + + If unsure, say N here, but this option is safe to enable. + config OF_ALL_DTBS bool "Build all Device Tree Blobs" depends on COMPILE_TEST diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 70992103c07d..efcec1c6c895 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -44,7 +44,10 @@ static struct unittest_results { pr_err("FAIL %s():%i " fmt, __func__, __LINE__, ##__VA_ARGS__); \ } else { \ unittest_results.passed++; \ - pr_debug("pass %s():%i\n", __func__, __LINE__); \ + if (IS_ENABLED(CONFIG_OF_UNITTEST_SHOW_PASS)) \ + pr_err("pass %s():%i\n", __func__, __LINE__); \ + else \ + pr_debug("pass %s():%i\n", __func__, __LINE__); \ } \ failed; \ }) -- Frank Rowand