bpftool: Enable line buffering for stdout
authorPaul Chaignon <paul@isovalent.com>
Mon, 20 Dec 2021 21:45:28 +0000 (22:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 09:53:59 +0000 (10:53 +0100)
commite668ac6506d3f45bf36b1f8463f62ce5e2776732
tree7f6e09afc4b5f3dfb6c92c1f5f98fe05286c9135
parent009bb7ee15779b70726c12ecdac6450bc1a4b47b
bpftool: Enable line buffering for stdout

[ Upstream commit 1a1a0b0364ad291bd8e509da104ac8b5b1afec5d ]

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: 30da46b5dc3a ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/bpf/bpftool/main.c