]> git.baikalelectronics.ru Git - kernel.git/commit
bpftool: Enable line buffering for stdout
authorPaul Chaignon <paul@isovalent.com>
Mon, 20 Dec 2021 21:45:28 +0000 (22:45 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 21 Dec 2021 23:44:51 +0000 (15:44 -0800)
commita977b0f1c7a59b60543f22c3bffb7074edad5c7d
tree2a33bb0a3dcba47642b729a064c56134c2035053
parentd1e411c03549dcc3c715be08e3755c22b3400408
bpftool: Enable line buffering for stdout

The output of bpftool prog tracelog is currently buffered, which is
inconvenient when piping the output into other commands. A simple
tracelog | grep will typically not display anything. This patch fixes it
by enabling line buffering on stdout for the whole bpftool binary.

Fixes: 1248b7ea7252 ("tools: bpftool: add a command to dump the trace pipe")
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Signed-off-by: Paul Chaignon <paul@isovalent.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20211220214528.GA11706@Mem
tools/bpf/bpftool/main.c