diff options
author | Andrii Nakryiko <andriin@fb.com> | 2019-07-27 20:25:28 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-07-27 22:36:19 -0700 |
commit | 0ff97e56c0986ea6633083c3487d9231bbbd881b (patch) | |
tree | 5e07c2f43f18292f7298a9afd34cb7410181eab1 /tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c | |
parent | 329e38f76cc2a77085264ce6e0dbe902c33fd7a3 (diff) | |
download | linux-0ff97e56c0986ea6633083c3487d9231bbbd881b.tar.gz linux-0ff97e56c0986ea6633083c3487d9231bbbd881b.tar.bz2 linux-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 <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c')
-rw-r--r-- | tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c b/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c index 9d73a8f932ac..3d59b3c841fe 100644 --- a/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c +++ b/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c @@ -41,7 +41,7 @@ static void get_stack_print_output(void *ctx, int cpu, void *data, __u32 size) * just assume it is good if the stack is not empty. * This could be improved in the future. */ - if (jit_enabled) { + if (env.jit_enabled) { found = num_stack > 0; } else { for (i = 0; i < num_stack; i++) { @@ -58,7 +58,7 @@ static void get_stack_print_output(void *ctx, int cpu, void *data, __u32 size) } } else { num_stack = e->kern_stack_size / sizeof(__u64); - if (jit_enabled) { + if (env.jit_enabled) { good_kern_stack = num_stack > 0; } else { for (i = 0; i < num_stack; i++) { |