Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 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

authored by

Paul Chaignon and committed by
Andrii Nakryiko
1a1a0b03 0dd668d2

+2
+2
tools/bpf/bpftool/main.c
··· 408 408 bool version_requested = false; 409 409 int opt, ret; 410 410 411 + setlinebuf(stdout); 412 + 411 413 last_do_help = do_help; 412 414 pretty_output = false; 413 415 json_output = false;