aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuentin Monnet <quentin.monnet@netronome.com>2018-10-20 23:01:49 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2018-10-21 20:45:14 +0200
commit06ee9da6a8b49e0e12b7a825dbe6ad243d5463e2 (patch)
treed714e70ea5dd259054e7d1691eccf91a78c4c9b3 /tools
parenttools: bpftool: document restriction on '.' in names to pin in bpffs (diff)
downloadlinux-dev-06ee9da6a8b49e0e12b7a825dbe6ad243d5463e2.tar.xz
linux-dev-06ee9da6a8b49e0e12b7a825dbe6ad243d5463e2.zip
tools: bpftool: print nb of cmds to stdout (not stderr) for batch mode
When batch mode is used and all commands succeeds, bpftool prints the number of commands processed to stderr. There is no particular reason to use stderr for this, we could as well use stdout. It would avoid getting unnecessary output on stderr if the standard ouptut is redirected, for example. Reported-by: David Beckett <david.beckett@netronome.com> Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/bpf/bpftool/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/bpf/bpftool/main.c b/tools/bpf/bpftool/main.c
index 828dde30e9ec..75a3296dc0bc 100644
--- a/tools/bpf/bpftool/main.c
+++ b/tools/bpf/bpftool/main.c
@@ -321,7 +321,8 @@ static int do_batch(int argc, char **argv)
p_err("reading batch file failed: %s", strerror(errno));
err = -1;
} else {
- p_info("processed %d commands", lines);
+ if (!json_output)
+ printf("processed %d commands\n", lines);
err = 0;
}
err_close: