mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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: 30da46b5dc
("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
This commit is contained in:
parent
0dd668d208
commit
1a1a0b0364
1 changed files with 2 additions and 0 deletions
|
@ -408,6 +408,8 @@ int main(int argc, char **argv)
|
||||||
bool version_requested = false;
|
bool version_requested = false;
|
||||||
int opt, ret;
|
int opt, ret;
|
||||||
|
|
||||||
|
setlinebuf(stdout);
|
||||||
|
|
||||||
last_do_help = do_help;
|
last_do_help = do_help;
|
||||||
pretty_output = false;
|
pretty_output = false;
|
||||||
json_output = false;
|
json_output = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue