aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/prog.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
-rw-r--r--tools/bpf/bpftool/prog.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
index 335028968dfb..5302ee282409 100644
--- a/tools/bpf/bpftool/prog.c
+++ b/tools/bpf/bpftool/prog.c
@@ -449,6 +449,7 @@ static int do_dump(int argc, char **argv)
449 unsigned long *func_ksyms = NULL; 449 unsigned long *func_ksyms = NULL;
450 struct bpf_prog_info info = {}; 450 struct bpf_prog_info info = {};
451 unsigned int *func_lens = NULL; 451 unsigned int *func_lens = NULL;
452 const char *disasm_opt = NULL;
452 unsigned int nr_func_ksyms; 453 unsigned int nr_func_ksyms;
453 unsigned int nr_func_lens; 454 unsigned int nr_func_lens;
454 struct dump_data dd = {}; 455 struct dump_data dd = {};
@@ -607,9 +608,10 @@ static int do_dump(int argc, char **argv)
607 const char *name = NULL; 608 const char *name = NULL;
608 609
609 if (info.ifindex) { 610 if (info.ifindex) {
610 name = ifindex_to_bfd_name_ns(info.ifindex, 611 name = ifindex_to_bfd_params(info.ifindex,
611 info.netns_dev, 612 info.netns_dev,
612 info.netns_ino); 613 info.netns_ino,
614 &disasm_opt);
613 if (!name) 615 if (!name)
614 goto err_free; 616 goto err_free;
615 } 617 }
@@ -651,7 +653,8 @@ static int do_dump(int argc, char **argv)
651 printf("%s:\n", sym_name); 653 printf("%s:\n", sym_name);
652 } 654 }
653 655
654 disasm_print_insn(img, lens[i], opcodes, name); 656 disasm_print_insn(img, lens[i], opcodes, name,
657 disasm_opt);
655 img += lens[i]; 658 img += lens[i];
656 659
657 if (json_output) 660 if (json_output)
@@ -663,7 +666,8 @@ static int do_dump(int argc, char **argv)
663 if (json_output) 666 if (json_output)
664 jsonw_end_array(json_wtr); 667 jsonw_end_array(json_wtr);
665 } else { 668 } else {
666 disasm_print_insn(buf, *member_len, opcodes, name); 669 disasm_print_insn(buf, *member_len, opcodes, name,
670 disasm_opt);
667 } 671 }
668 } else if (visual) { 672 } else if (visual) {
669 if (json_output) 673 if (json_output)