selftests/seccomp: Flush benchmark output

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>
This commit is contained in:
Kees Cook 2021-05-26 19:46:30 -07:00
parent 93e720d710
commit 62ddb91b77
1 changed files with 2 additions and 0 deletions

View File

@ -143,6 +143,8 @@ int main(int argc, char *argv[])
unsigned long long native, filter1, filter2, bitmap1, bitmap2; unsigned long long native, filter1, filter2, bitmap1, bitmap2;
unsigned long long entry, per_filter1, per_filter2; unsigned long long entry, per_filter1, per_filter2;
setbuf(stdout, NULL);
printf("Current BPF sysctl settings:\n"); printf("Current BPF sysctl settings:\n");
system("sysctl net.core.bpf_jit_enable"); system("sysctl net.core.bpf_jit_enable");
system("sysctl net.core.bpf_jit_harden"); system("sysctl net.core.bpf_jit_harden");