Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: less spam in the log for message matching

When running test_loader based tests in the verbose mode each matched
message leaves a trace in the stderr, e.g.:

./test_progs -vvv -t ...
validate_msgs:PASS:expect_msg 0 nsec
validate_msgs:PASS:expect_msg 0 nsec
validate_msgs:PASS:expect_msg 0 nsec
validate_msgs:PASS:expect_msg 0 nsec
validate_msgs:PASS:expect_msg 0 nsec

This is not very helpful when debugging such tests and clobbers the
log a lot.

Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20240820102357.3372779-2-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Eduard Zingerman and committed by
Alexei Starovoitov
7d41dad1 ffc41ce5

+2 -1
+2 -1
tools/testing/selftests/bpf/test_loader.c
··· 531 531 } 532 532 } 533 533 534 - if (!ASSERT_OK_PTR(match, "expect_msg")) { 534 + if (!match) { 535 + PRINT_FAIL("expect_msg\n"); 535 536 if (env.verbosity == VERBOSE_NONE) 536 537 emit_fn(log_buf, true /*force*/); 537 538 for (j = 0; j <= i; j++) {