1 #ifndef __PERF_ANNOTATE_H
2 #define __PERF_ANNOTATE_H
7 #include <linux/list.h>
8 #include <linux/rbtree.h>
11 struct list_head node
;
16 void objdump_line__free(struct objdump_line
*self
);
17 struct objdump_line
*objdump__get_next_ip_line(struct list_head
*head
,
18 struct objdump_line
*pos
);
31 /** struct annotated_source - symbols with hits have this attached as in sannotation
33 * @histogram: Array of addr hit histograms per event being monitored
34 * @lines: If 'print_lines' is specified, per source code line percentages
35 * @source: source parsed from objdump -dS
37 * lines is allocated, percentages calculated and all sorted by percentage
38 * when the annotation is about to be presented, so the percentages are for
39 * one of the entries in the histogram array, i.e. for the event/counter being
40 * presented. It is deallocated right after symbol__{tui,tty,etc}_annotate
43 struct annotated_source
{
44 struct list_head source
;
45 struct source_line
*lines
;
48 struct sym_hist histograms
[0];
53 struct annotated_source
*src
;
57 struct annotation annotation
;
61 static inline struct sym_hist
*annotation__histogram(struct annotation
*notes
, int idx
)
63 return (((void *)¬es
->src
->histograms
) +
64 (notes
->src
->sizeof_sym_hist
* idx
));
67 static inline struct annotation
*symbol__annotation(struct symbol
*sym
)
69 struct sannotation
*a
= container_of(sym
, struct sannotation
, symbol
);
70 return &a
->annotation
;
73 int symbol__inc_addr_samples(struct symbol
*sym
, struct map
*map
,
75 int symbol__alloc_hist(struct symbol
*sym
, int nevents
);
76 void symbol__annotate_zero_histograms(struct symbol
*sym
);
78 int symbol__annotate(struct symbol
*sym
, struct map
*map
, size_t privsize
);
79 int symbol__annotate_init(struct map
*map __used
, struct symbol
*sym
);
80 int symbol__annotate_printf(struct symbol
*sym
, struct map
*map
, int evidx
,
81 bool full_paths
, int min_pcnt
, int max_lines
,
83 void symbol__annotate_zero_histogram(struct symbol
*sym
, int evidx
);
84 void symbol__annotate_decay_histogram(struct symbol
*sym
, int evidx
);
85 void objdump_line_list__purge(struct list_head
*head
);
87 int symbol__tty_annotate(struct symbol
*sym
, struct map
*map
, int evidx
,
88 bool print_lines
, bool full_paths
, int min_pcnt
,
91 #ifdef NO_NEWT_SUPPORT
92 static inline int symbol__tui_annotate(struct symbol
*sym __used
,
93 struct map
*map __used
,
94 int evidx __used
, int refresh __used
)
99 int symbol__tui_annotate(struct symbol
*sym
, struct map
*map
, int evidx
,
103 #endif /* __PERF_ANNOTATE_H */