Skip to content

Commit

Permalink
selftests/seccomp: Flush benchmark output
Browse files Browse the repository at this point in the history
When running the seccomp benchmark under a test runner, it wouldn't
provide any feedback on progress. Set stdout unbuffered.

Suggested-by: Will Drewry <wad@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
  • Loading branch information
Kees Cook committed Jun 28, 2021
1 parent 93e720d commit 62ddb91
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/testing/selftests/seccomp/seccomp_benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ int main(int argc, char *argv[])
unsigned long long native, filter1, filter2, bitmap1, bitmap2;
unsigned long long entry, per_filter1, per_filter2;

setbuf(stdout, NULL);

printf("Current BPF sysctl settings:\n");
system("sysctl net.core.bpf_jit_enable");
system("sysctl net.core.bpf_jit_harden");
Expand Down

0 comments on commit 62ddb91

Please sign in to comment.