diff options
| author | Quentin Monnet <[email protected]> | 2017-10-19 22:46:19 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2017-10-22 01:11:31 +0000 |
| commit | 9cbe1f581d17baff7e93936feb041c90b29eb6a8 (patch) | |
| tree | 340bf4f384d93493c7e618f600a0706221a17db9 /tools/bpf/bpftool/prog.c | |
| parent | net: sched: mark expected switch fall-throughs (diff) | |
| download | kernel-9cbe1f581d17baff7e93936feb041c90b29eb6a8.tar.gz kernel-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 <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
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"); } |
