diff options
author | Quentin Monnet <quentin.monnet@netronome.com> | 2017-10-20 00:46:19 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-22 03:11:31 +0200 |
commit | 9cbe1f581d17baff7e93936feb041c90b29eb6a8 (patch) | |
tree | 340bf4f384d93493c7e618f600a0706221a17db9 /tools/bpf/bpftool/prog.c | |
parent | net: sched: mark expected switch fall-throughs (diff) | |
download | linux-9cbe1f581d17baff7e93936feb041c90b29eb6a8.tar.xz linux-9cbe1f581d17baff7e93936feb041c90b29eb6a8.zip |
tools: bpftool: add pointer to file argument to print_hex()
Make print_hex() able to print to any file instead of standard output
only, and rename it to fprint_hex(). The function can now be called with
the info() macro, for example, without splitting the output between
standard and error outputs.
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
-rw-r--r-- | tools/bpf/bpftool/prog.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c index d60f5307b6e2..aa6d72ea3807 100644 --- a/tools/bpf/bpftool/prog.c +++ b/tools/bpf/bpftool/prog.c @@ -224,7 +224,7 @@ static int show_prog(int fd) printf("name %s ", info.name); printf("tag "); - print_hex(info.tag, BPF_TAG_SIZE, ""); + fprint_hex(stdout, info.tag, BPF_TAG_SIZE, ""); printf("\n"); if (info.load_time) { @@ -319,7 +319,7 @@ static void dump_xlated(void *buf, unsigned int len, bool opcodes) if (opcodes) { printf(" "); - print_hex(insn + i, 8, " "); + fprint_hex(stdout, insn + i, 8, " "); printf("\n"); } |