Patch "perf tests record: Fail the test if the 'errs' counter is not zero" has been added to the 5.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    perf tests record: Fail the test if the 'errs' counter is not zero

to the 5.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     perf-tests-record-fail-the-test-if-the-errs-counter-.patch
and it can be found in the queue-5.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2be3625fcc4a3d9d7344f652fc1fd435f27e7e20
Author: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Date:   Wed Sep 28 12:55:43 2022 -0300

    perf tests record: Fail the test if the 'errs' counter is not zero
    
    [ Upstream commit 25c5e67cdf744cbb93fd06647611d3036218debe ]
    
    We were just checking for the 'err' variable, when we should really see
    if there was some of the many checked errors that don't stop the test
    right away.
    
    Detected with clang 15.0.0:
    
      44    75.23 fedora:37       : FAIL clang version 15.0.0 (Fedora 15.0.0-2.fc37)
    
        tests/perf-record.c:68:16: error: variable 'errs' set but not used [-Werror,-Wunused-but-set-variable]
                int err = -1, errs = 0, i, wakeups = 0;
                              ^
        1 error generated.
    
    The patch introducing this 'perf test' entry had that check:
    
      +       return (err < 0 || errs > 0) ? -1 : 0;
    
    But at some point we lost that:
    
      -       return (err < 0 || errs > 0) ? -1 : 0;
      +       if (err == -EACCES)
      +               return TEST_SKIP;
      +       if (err < 0)
      +               return TEST_FAIL;
      +       return TEST_OK
    
    Put it back.
    
    Fixes: 2cf88f4614c996e5 ("perf test: Use skip in PERF_RECORD_*")
    Acked-by: Ian Rogers <irogers@xxxxxxxxxx>
    Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
    Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
    Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
    Link: https://lore.kernel.org/lkml/YzR0n5QhsH9VyYB0@xxxxxxxxxx
    Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c
index 6a001fcfed68..4952abe716f3 100644
--- a/tools/perf/tests/perf-record.c
+++ b/tools/perf/tests/perf-record.c
@@ -332,7 +332,7 @@ static int test__PERF_RECORD(struct test_suite *test __maybe_unused, int subtest
 out:
 	if (err == -EACCES)
 		return TEST_SKIP;
-	if (err < 0)
+	if (err < 0 || errs != 0)
 		return TEST_FAIL;
 	return TEST_OK;
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux