summaryrefslogtreecommitdiff
path: root/tools/bpf/bpftool/xlated_dumper.h
diff options
context:
space:
mode:
authorSandipan Das <sandipan@linux.vnet.ibm.com>2018-05-24 12:26:50 +0530
committerDaniel Borkmann <daniel@iogearbox.net>2018-05-24 09:20:49 +0200
commitf84192ee00b7d8b3c38545d3a61d4191f80cc81a (patch)
tree236e1f0dada1768797eafacdb707fcce1b59ceb9 /tools/bpf/bpftool/xlated_dumper.h
parentdd0c5f072e650458feb307fe3a8602cc2ec369d4 (diff)
tools: bpftool: resolve calls without using imm field
Currently, we resolve the callee's address for a JITed function call by using the imm field of the call instruction as an offset from __bpf_call_base. If bpf_jit_kallsyms is enabled, we further use this address to get the callee's kernel symbol's name. For some architectures, such as powerpc64, the imm field is not large enough to hold this offset. So, instead of assigning this offset to the imm field, the verifier now assigns the subprog id. Also, a list of kernel symbol addresses for all the JITed functions is provided in the program info. We now use the imm field as an index for this list to lookup a callee's symbol's address and resolve its name. Suggested-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Sandipan Das <sandipan@linux.vnet.ibm.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/bpf/bpftool/xlated_dumper.h')
-rw-r--r--tools/bpf/bpftool/xlated_dumper.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/bpf/bpftool/xlated_dumper.h b/tools/bpf/bpftool/xlated_dumper.h
index b34affa7ef2d..eafbb49c8d0b 100644
--- a/tools/bpf/bpftool/xlated_dumper.h
+++ b/tools/bpf/bpftool/xlated_dumper.h
@@ -49,6 +49,8 @@ struct dump_data {
unsigned long address_call_base;
struct kernel_sym *sym_mapping;
__u32 sym_count;
+ __u64 *jited_ksyms;
+ __u32 nr_jited_ksyms;
char scratch_buff[SYM_MAX_NAME + 8];
};