diff options
| author | Andrii Nakryiko <[email protected]> | 2019-07-28 03:25:28 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2019-07-28 05:36:19 +0000 |
| commit | 0ff97e56c0986ea6633083c3487d9231bbbd881b (patch) | |
| tree | 5e07c2f43f18292f7298a9afd34cb7410181eab1 /tools/testing/selftests/bpf/prog_tests/stacktrace_build_id.c | |
| parent | selftest/bpf: centralize libbpf logging management for test_progs (diff) | |
| download | kernel-0ff97e56c0986ea6633083c3487d9231bbbd881b.tar.gz kernel-0ff97e56c0986ea6633083c3487d9231bbbd881b.zip | |
selftests/bpf: abstract away test log output
This patch changes how test output is printed out. By default, if test
had no errors, the only output will be a single line with test number,
name, and verdict at the end, e.g.:
#31 xdp:OK
If test had any errors, all log output captured during test execution
will be output after test completes.
It's possible to force output of log with `-v` (`--verbose`) option, in
which case output won't be buffered and will be output immediately.
To support this, individual tests are required to use helper methods for
logging: `test__printf()` and `test__vprintf()`.
Signed-off-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/stacktrace_build_id.c')
| -rw-r--r-- | tools/testing/selftests/bpf/prog_tests/stacktrace_build_id.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/stacktrace_build_id.c b/tools/testing/selftests/bpf/prog_tests/stacktrace_build_id.c index ac44fda84833..356d2c017a9c 100644 --- a/tools/testing/selftests/bpf/prog_tests/stacktrace_build_id.c +++ b/tools/testing/selftests/bpf/prog_tests/stacktrace_build_id.c @@ -109,8 +109,8 @@ retry: if (build_id_matches < 1 && retry--) { bpf_link__destroy(link); bpf_object__close(obj); - printf("%s:WARN:Didn't find expected build ID from the map, retrying\n", - __func__); + test__printf("%s:WARN:Didn't find expected build ID from the map, retrying\n", + __func__); goto retry; } |
