]>
git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - tools/perf/util/annotate.h
1 #ifndef __PERF_ANNOTATE_H
2 #define __PERF_ANNOTATE_H
7 #include <linux/list.h>
8 #include <linux/rbtree.h>
18 int (*parse
)(struct ins_operands
*ops
);
19 int (*scnprintf
)(struct ins
*ins
, char *bf
, size_t size
,
20 struct ins_operands
*ops
, bool addrs
);
28 bool ins__is_jump(const struct ins
*ins
);
29 bool ins__is_call(const struct ins
*ins
);
32 struct list_head node
;
37 struct ins_operands ops
;
40 void disasm_line__free(struct disasm_line
*dl
);
41 struct disasm_line
*disasm__get_next_ip_line(struct list_head
*head
, struct disasm_line
*pos
);
42 size_t disasm__fprintf(struct list_head
*head
, FILE *fp
);
55 /** struct annotated_source - symbols with hits have this attached as in sannotation
57 * @histogram: Array of addr hit histograms per event being monitored
58 * @lines: If 'print_lines' is specified, per source code line percentages
59 * @source: source parsed from a disassembler like objdump -dS
61 * lines is allocated, percentages calculated and all sorted by percentage
62 * when the annotation is about to be presented, so the percentages are for
63 * one of the entries in the histogram array, i.e. for the event/counter being
64 * presented. It is deallocated right after symbol__{tui,tty,etc}_annotate
67 struct annotated_source
{
68 struct list_head source
;
69 struct source_line
*lines
;
72 struct sym_hist histograms
[0];
77 struct annotated_source
*src
;
81 struct annotation annotation
;
85 static inline struct sym_hist
*annotation__histogram(struct annotation
*notes
, int idx
)
87 return (((void *)¬es
->src
->histograms
) +
88 (notes
->src
->sizeof_sym_hist
* idx
));
91 static inline struct annotation
*symbol__annotation(struct symbol
*sym
)
93 struct sannotation
*a
= container_of(sym
, struct sannotation
, symbol
);
94 return &a
->annotation
;
97 int symbol__inc_addr_samples(struct symbol
*sym
, struct map
*map
,
99 int symbol__alloc_hist(struct symbol
*sym
);
100 void symbol__annotate_zero_histograms(struct symbol
*sym
);
102 int symbol__annotate(struct symbol
*sym
, struct map
*map
, size_t privsize
);
103 int symbol__annotate_init(struct map
*map __used
, struct symbol
*sym
);
104 int symbol__annotate_printf(struct symbol
*sym
, struct map
*map
, int evidx
,
105 bool full_paths
, int min_pcnt
, int max_lines
,
107 void symbol__annotate_zero_histogram(struct symbol
*sym
, int evidx
);
108 void symbol__annotate_decay_histogram(struct symbol
*sym
, int evidx
);
109 void disasm__purge(struct list_head
*head
);
111 int symbol__tty_annotate(struct symbol
*sym
, struct map
*map
, int evidx
,
112 bool print_lines
, bool full_paths
, int min_pcnt
,
115 #ifdef NO_NEWT_SUPPORT
116 static inline int symbol__tui_annotate(struct symbol
*sym __used
,
117 struct map
*map __used
,
119 void(*timer
)(void *arg
) __used
,
120 void *arg __used
, int delay_secs __used
)
125 int symbol__tui_annotate(struct symbol
*sym
, struct map
*map
, int evidx
,
126 void(*timer
)(void *arg
), void *arg
, int delay_secs
);
129 extern const char *disassembler_style
;
131 #endif /* __PERF_ANNOTATE_H */