From: Kees Cook Date: Thu, 27 May 2021 02:46:30 +0000 (-0700) Subject: selftests/seccomp: Flush benchmark output X-Git-Tag: v5.14-rc1~157^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62ddb91b7771626658c382c2b849a058f1586123;p=thirdparty%2Flinux.git 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 Signed-off-by: Kees Cook --- diff --git a/tools/testing/selftests/seccomp/seccomp_benchmark.c b/tools/testing/selftests/seccomp/seccomp_benchmark.c index fcc8065852665..363cad7550420 100644 --- a/tools/testing/selftests/seccomp/seccomp_benchmark.c +++ b/tools/testing/selftests/seccomp/seccomp_benchmark.c @@ -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");