Re: [PATCH bpf-next v2 2/4] selftests/bpf: add --no-error-summary to skip end-of-run error log dump

[email protected]
Newsgroups org.kernel.vger.bpf
Message-ID <7a72e7c20020f3470a22de6ac06e51ce44e24fb2b65cee70528cec4de56ed7cf@mail.kernel.org>
> diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
> index aa06bab30966..b274d98faac4 100644
> --- a/tools/testing/selftests/bpf/test_progs.c
> +++ b/tools/testing/selftests/bpf/test_progs.c

[ ... ]

> @@ -424,10 +424,12 @@ static void jsonw_write_log_message(json_writer_t *w, char *log_buf, size_t log_
>  	}
>  }
>
> +/* @quiet elides the human readable output, the JSON report is unaffected */
>  static void dump_test_log(const struct prog_test_def *test,
>  			  const struct test_state *test_state,
>  			  bool skip_ok_subtests,
>  			  bool par_exec_result,
> +			  bool quiet,
>  			  json_writer_t *w)
>  {

[ ... ]

> @@ -1462,7 +1472,7 @@ static void run_one_test(int test_num)
>
>  	free(stop_libbpf_log_capture());
>
> -	dump_test_log(test, state, false, false, NULL);
> +	dump_test_log(test, state, false, false, false, NULL);
>  }

This isn't a bug, but with the new @quiet parameter, dump_test_log()
now takes three consecutive bool parameters (skip_ok_subtests,
par_exec_result, quiet), so the call sites read as a row of anonymous
literals: false, false, false. The other call sites have similar
patterns:

In dump_crash_log():
    dump_test_log(env.test, env.test_state, true, false, false, NULL);

In dispatch_thread():
    dump_test_log(test, state, false, true, false, NULL);

In calculate_summary_and_print_errors():
    dump_test_log(test, state, true, true, !env->error_summary, w);

Would a small flags parameter (or naming the arguments at the call
sites) make these invocations more readable?


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/31218024081
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.