Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef PERF_SRCLINE_H
0003 #define PERF_SRCLINE_H
0004 
0005 #include <linux/list.h>
0006 #include <linux/rbtree.h>
0007 #include <linux/types.h>
0008 
0009 struct dso;
0010 struct symbol;
0011 
0012 extern bool srcline_full_filename;
0013 char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
0014           bool show_sym, bool show_addr, u64 ip);
0015 char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
0016           bool show_sym, bool show_addr, bool unwind_inlines,
0017           u64 ip);
0018 void free_srcline(char *srcline);
0019 char *get_srcline_split(struct dso *dso, u64 addr, unsigned *line);
0020 
0021 /* insert the srcline into the DSO, which will take ownership */
0022 void srcline__tree_insert(struct rb_root_cached *tree, u64 addr, char *srcline);
0023 /* find previously inserted srcline */
0024 char *srcline__tree_find(struct rb_root_cached *tree, u64 addr);
0025 /* delete all srclines within the tree */
0026 void srcline__tree_delete(struct rb_root_cached *tree);
0027 
0028 #define SRCLINE_UNKNOWN  ((char *) "??:0")
0029 
0030 struct inline_list {
0031     struct symbol       *symbol;
0032     char            *srcline;
0033     struct list_head    list;
0034 };
0035 
0036 struct inline_node {
0037     u64         addr;
0038     struct list_head    val;
0039     struct rb_node      rb_node;
0040 };
0041 
0042 /* parse inlined frames for the given address */
0043 struct inline_node *dso__parse_addr_inlines(struct dso *dso, u64 addr,
0044                         struct symbol *sym);
0045 /* free resources associated to the inline node list */
0046 void inline_node__delete(struct inline_node *node);
0047 
0048 /* insert the inline node list into the DSO, which will take ownership */
0049 void inlines__tree_insert(struct rb_root_cached *tree,
0050               struct inline_node *inlines);
0051 /* find previously inserted inline node list */
0052 struct inline_node *inlines__tree_find(struct rb_root_cached *tree, u64 addr);
0053 /* delete all nodes within the tree of inline_node s */
0054 void inlines__tree_delete(struct rb_root_cached *tree);
0055 
0056 #endif /* PERF_SRCLINE_H */