All of lore.kernel.org
 help / color / mirror / Atom feed
From: Naresh Kamboju <naresh.kamboju@linaro.org>
To: frowand.list@gmail.com
Cc: Rob Herring <robh+dt@kernel.org>,
	Brendan Higgins <brendanhiggins@google.com>,
	Anders Roxell <anders.roxell@linaro.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] of: unittest: print pass messages at same loglevel as fail
Date: Fri, 4 Feb 2022 13:18:25 +0530	[thread overview]
Message-ID: <CA+G9fYsdpm+PwSkLF5qkfnL_jY7HEh5cDapQXteWa7Og+WgoVA@mail.gmail.com> (raw)
In-Reply-To: <20220203211150.2912192-1-frowand.list@gmail.com>

On Fri, 4 Feb 2022 at 02:42, <frowand.list@gmail.com> wrote:
>
> From: Frank Rowand <frank.rowand@sony.com>
>
> 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.
>
> Change default to print the pass messages at the same loglevel as
> the fail messages.
>
> 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.
>
> Suppressing printing the pass message for each individual test is
> available via the kernel command line parameter unittest.hide_pass.
>
> Signed-off-by: Frank Rowand <frank.rowand@sony.com>

Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>

After this patch applied I see the change in test output log
from the dmesg,

It would be great if you could add fail and skip cases.
When we find failures / regressions or when tests change from pass to fail
we will report those on the mailing list.

output:
-------
[    3.290336] ### dt-test ### start of unittest - you will see error messages
[    3.298352] ### dt-test ### EXPECT \ : Duplicate name in
testcase-data, renamed to \"duplicate-name#1\"
[    3.298535] Duplicate name in testcase-data, renamed to \"duplicate-name#1\"
[    3.318485] ### dt-test ### EXPECT / : Duplicate name in
testcase-data, renamed to \"duplicate-name#1\"
[    3.319418] ### dt-test ### pass of_unittest_check_tree_linkage():278
[    3.335123] ### dt-test ### pass of_unittest_check_tree_linkage():279
[    3.341662] ### dt-test ### pass of_unittest_check_phandles():387

Test job:
https://lkft.validation.linaro.org/scheduler/job/4473059#L1019

> ---
>  Documentation/admin-guide/kernel-parameters.txt |  4 ++++
>  drivers/of/unittest.c                           | 17 ++++++++++++++++-
>  2 files changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index f5a27f067db9..045455f9b7e1 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -5997,6 +5997,10 @@
>                         Note that genuine overcurrent events won't be
>                         reported either.
>
> +       unittest.hide_pass
> +                       Disable printing individual drivers/of/unittest test
> +                       pass messages.
> +
>         unknown_nmi_panic
>                         [X86] Cause panic on unknown NMI.
>
> diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
> index 70992103c07d..2cfbdc6b29ac 100644
> --- a/drivers/of/unittest.c
> +++ b/drivers/of/unittest.c
> @@ -12,6 +12,7 @@
>  #include <linux/errno.h>
>  #include <linux/hashtable.h>
>  #include <linux/libfdt.h>
> +#include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/of_address.h>
>  #include <linux/of_fdt.h>
> @@ -32,6 +33,19 @@
>
>  #include "of_private.h"
>
> +MODULE_LICENSE("GPL v2");
> +static bool hide_pass;
> +
> +static int __init hide_pass_setup(char *str)
> +{
> +       hide_pass = true;
> +       return 0;
> +}
> +
> +early_param("hide_pass", hide_pass_setup);
> +module_param(hide_pass, bool, 0);
> +MODULE_PARM_DESC(hide_pass, "Disable printing individual of unittest pass messages");
> +
>  static struct unittest_results {
>         int passed;
>         int failed;
> @@ -44,7 +58,8 @@ 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 (!hide_pass) \
> +                       pr_err("pass %s():%i\n", __func__, __LINE__); \
>         } \
>         failed; \
>  })
> --
> Frank Rowand <frank.rowand@sony.com>


--
Linaro LKFT
https://lkft.linaro.org

      parent reply	other threads:[~2022-02-04  7:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03 21:11 [PATCH 1/1] of: unittest: print pass messages at same loglevel as fail frowand.list
2022-02-03 21:40 ` Rob Herring
2022-02-04  3:41   ` Frank Rowand
2022-02-10  0:34     ` Rob Herring
2022-02-10  2:57       ` Frank Rowand
2022-02-04  7:48 ` Naresh Kamboju [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+G9fYsdpm+PwSkLF5qkfnL_jY7HEh5cDapQXteWa7Og+WgoVA@mail.gmail.com \
    --to=naresh.kamboju@linaro.org \
    --cc=anders.roxell@linaro.org \
    --cc=brendanhiggins@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.