Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
0002 /* Copyright (C) 2018 Netronome Systems, Inc. */
0003 
0004 #ifndef __BPF_TOOL_XLATED_DUMPER_H
0005 #define __BPF_TOOL_XLATED_DUMPER_H
0006 
0007 #define SYM_MAX_NAME    256
0008 
0009 struct bpf_prog_linfo;
0010 
0011 struct kernel_sym {
0012     unsigned long address;
0013     char name[SYM_MAX_NAME];
0014 };
0015 
0016 struct dump_data {
0017     unsigned long address_call_base;
0018     struct kernel_sym *sym_mapping;
0019     __u32 sym_count;
0020     __u64 *jited_ksyms;
0021     __u32 nr_jited_ksyms;
0022     struct btf *btf;
0023     void *func_info;
0024     __u32 finfo_rec_size;
0025     const struct bpf_prog_linfo *prog_linfo;
0026     char scratch_buff[SYM_MAX_NAME + 8];
0027 };
0028 
0029 void kernel_syms_load(struct dump_data *dd);
0030 void kernel_syms_destroy(struct dump_data *dd);
0031 struct kernel_sym *kernel_syms_search(struct dump_data *dd, unsigned long key);
0032 void dump_xlated_json(struct dump_data *dd, void *buf, unsigned int len,
0033                bool opcodes, bool linum);
0034 void dump_xlated_plain(struct dump_data *dd, void *buf, unsigned int len,
0035                bool opcodes, bool linum);
0036 void dump_xlated_for_graph(struct dump_data *dd, void *buf, void *buf_end,
0037                unsigned int start_index);
0038 
0039 #endif