]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Fix massive output from test_maps
authorJesper Dangaard Brouer <brouer@redhat.com>
Wed, 26 Aug 2020 08:17:36 +0000 (10:17 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 28 Aug 2020 11:58:19 +0000 (13:58 +0200)
commita8b53b0963f2a17d25751871b57ead577d429f01
treebddd75fbe80efe818d4d2ada27ba2823095bcd2b
parent0f165dd102eb31971e3bc7aeb1c048f663ffd69b
selftests/bpf: Fix massive output from test_maps

When stdout output from the selftests tool 'test_maps' gets redirected
into e.g file or pipe, then the output lines increase a lot (from 21
to 33949 lines).  This is caused by the printf that happens before the
fork() call, and there are user-space buffered printf data that seems
to be duplicated into the forked process.

To fix this fflush() stdout before the fork loop in __run_parallel().

Fixes: 03c4bb0da379 ("selftests/bpf: speedup test_maps")
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/159842985651.1050885.2154399297503372406.stgit@firesoul
tools/testing/selftests/bpf/test_maps.c