~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/perf/util/disasm.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0
  2 #ifndef __PERF_UTIL_DISASM_H
  3 #define __PERF_UTIL_DISASM_H
  4 
  5 #include "map_symbol.h"
  6 
  7 struct annotation_options;
  8 struct disasm_line;
  9 struct ins;
 10 struct evsel;
 11 struct symbol;
 12 
 13 struct arch {
 14         const char      *name;
 15         struct ins      *instructions;
 16         size_t          nr_instructions;
 17         size_t          nr_instructions_allocated;
 18         struct ins_ops  *(*associate_instruction_ops)(struct arch *arch, const char *name);
 19         bool            sorted_instructions;
 20         bool            initialized;
 21         const char      *insn_suffix;
 22         void            *priv;
 23         unsigned int    model;
 24         unsigned int    family;
 25         int             (*init)(struct arch *arch, char *cpuid);
 26         bool            (*ins_is_fused)(struct arch *arch, const char *ins1,
 27                                         const char *ins2);
 28         struct          {
 29                 char comment_char;
 30                 char skip_functions_char;
 31                 char register_char;
 32                 char memory_ref_char;
 33                 char imm_char;
 34         } objdump;
 35 };
 36 
 37 struct ins {
 38         const char     *name;
 39         struct ins_ops *ops;
 40 };
 41 
 42 struct ins_operands {
 43         char    *raw;
 44         struct {
 45                 char    *raw;
 46                 char    *name;
 47                 struct symbol *sym;
 48                 u64     addr;
 49                 s64     offset;
 50                 bool    offset_avail;
 51                 bool    outside;
 52                 bool    multi_regs;
 53         } target;
 54         union {
 55                 struct {
 56                         char    *raw;
 57                         char    *name;
 58                         u64     addr;
 59                         bool    multi_regs;
 60                 } source;
 61                 struct {
 62                         struct ins          ins;
 63                         struct ins_operands *ops;
 64                 } locked;
 65                 struct {
 66                         char    *raw_comment;
 67                         char    *raw_func_start;
 68                 } jump;
 69         };
 70 };
 71 
 72 struct ins_ops {
 73         void (*free)(struct ins_operands *ops);
 74         int (*parse)(struct arch *arch, struct ins_operands *ops, struct map_symbol *ms);
 75         int (*scnprintf)(struct ins *ins, char *bf, size_t size,
 76                          struct ins_operands *ops, int max_ins_name);
 77 };
 78 
 79 struct annotate_args {
 80         struct arch               *arch;
 81         struct map_symbol         ms;
 82         struct evsel              *evsel;
 83         struct annotation_options *options;
 84         s64                       offset;
 85         char                      *line;
 86         int                       line_nr;
 87         char                      *fileloc;
 88 };
 89 
 90 struct arch *arch__find(const char *name);
 91 bool arch__is(struct arch *arch, const char *name);
 92 
 93 struct ins_ops *ins__find(struct arch *arch, const char *name);
 94 int ins__scnprintf(struct ins *ins, char *bf, size_t size,
 95                    struct ins_operands *ops, int max_ins_name);
 96 
 97 bool ins__is_call(const struct ins *ins);
 98 bool ins__is_jump(const struct ins *ins);
 99 bool ins__is_fused(struct arch *arch, const char *ins1, const char *ins2);
100 bool ins__is_nop(const struct ins *ins);
101 bool ins__is_ret(const struct ins *ins);
102 bool ins__is_lock(const struct ins *ins);
103 
104 struct disasm_line *disasm_line__new(struct annotate_args *args);
105 void disasm_line__free(struct disasm_line *dl);
106 
107 int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size,
108                            bool raw, int max_ins_name);
109 
110 int symbol__disassemble(struct symbol *sym, struct annotate_args *args);
111 
112 #endif /* __PERF_UTIL_DISASM_H */
113 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php