aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/prog.c
diff options
context:
space:
mode:
authorQuentin Monnet <quentin.monnet@netronome.com>2017-10-19 18:46:19 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-21 21:11:31 -0400
commit9cbe1f581d17baff7e93936feb041c90b29eb6a8 (patch)
tree340bf4f384d93493c7e618f600a0706221a17db9 /tools/bpf/bpftool/prog.c
parentf3ae608edb3be2e9a3f668d47aced3553eaf6c14 (diff)
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.c4
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)
224 printf("name %s ", info.name); 224 printf("name %s ", info.name);
225 225
226 printf("tag "); 226 printf("tag ");
227 print_hex(info.tag, BPF_TAG_SIZE, ""); 227 fprint_hex(stdout, info.tag, BPF_TAG_SIZE, "");
228 printf("\n"); 228 printf("\n");
229 229
230 if (info.load_time) { 230 if (info.load_time) {
@@ -319,7 +319,7 @@ static void dump_xlated(void *buf, unsigned int len, bool opcodes)
319 319
320 if (opcodes) { 320 if (opcodes) {
321 printf(" "); 321 printf(" ");
322 print_hex(insn + i, 8, " "); 322 fprint_hex(stdout, insn + i, 8, " ");
323 printf("\n"); 323 printf("\n");
324 } 324 }
325 325