xlated_dumper.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
  2. /* Copyright (C) 2018 Netronome Systems, Inc. */
  3. #ifndef __BPF_TOOL_XLATED_DUMPER_H
  4. #define __BPF_TOOL_XLATED_DUMPER_H
  5. #define SYM_MAX_NAME 256
  6. struct bpf_prog_linfo;
  7. struct kernel_sym {
  8. unsigned long address;
  9. char name[SYM_MAX_NAME];
  10. };
  11. struct dump_data {
  12. unsigned long address_call_base;
  13. struct kernel_sym *sym_mapping;
  14. __u32 sym_count;
  15. __u64 *jited_ksyms;
  16. __u32 nr_jited_ksyms;
  17. struct btf *btf;
  18. void *func_info;
  19. __u32 finfo_rec_size;
  20. const struct bpf_prog_linfo *prog_linfo;
  21. char scratch_buff[SYM_MAX_NAME + 8];
  22. };
  23. void kernel_syms_load(struct dump_data *dd);
  24. void kernel_syms_destroy(struct dump_data *dd);
  25. struct kernel_sym *kernel_syms_search(struct dump_data *dd, unsigned long key);
  26. void dump_xlated_json(struct dump_data *dd, void *buf, unsigned int len,
  27. bool opcodes, bool linum);
  28. void dump_xlated_plain(struct dump_data *dd, void *buf, unsigned int len,
  29. bool opcodes, bool linum);
  30. void dump_xlated_for_graph(struct dump_data *dd, void *buf, void *buf_end,
  31. unsigned int start_index);
  32. #endif