Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a259c73d authored by Paul Chaignon's avatar Paul Chaignon Committed by Greg Kroah-Hartman
Browse files

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: 30da46b5 ("tools: bpftool: add a command to dump the trace pipe")
Signed-off-by: default avatarQuentin Monnet <quentin@isovalent.com>
Signed-off-by: default avatarPaul Chaignon <paul@isovalent.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20211220214528.GA11706@Mem


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent eb599bf3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -362,6 +362,8 @@ int main(int argc, char **argv)
	};
	int opt, ret;

	setlinebuf(stdout);

	last_do_help = do_help;
	pretty_output = false;
	json_output = false;