Skip to contentSkip to conversation

selftests/seccomp: Flush benchmark output

PATCH New Kees Cook 1 participant 1 message May 27, 2021

Subsystems (2)
lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH v2 1/1 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.

---
 tools/testing/selftests/seccomp/seccomp_benchmark.c | 2 ++
 1 file changed, 2 insertions(+)
tools/testing/selftests/seccomp/seccomp_benchmark.c +2 -0
index fcc806585266..363cad755042 100644
@@ -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");
Signature · 1 line
2.25.1