1 /* SPDX-License-Identifier: GPL-2.0 */
7 #include <linux/list.h>
8 #include <linux/rbtree.h>
14 * DSOs are put into both a list for fast iteration and rbtree for fast
18 struct list_head head;
19 struct rb_root root; /* rbtree root sorted by long name */
20 struct rw_semaphore lock;
23 void __dsos__add(struct dsos *dsos, struct dso *dso);
24 void dsos__add(struct dsos *dsos, struct dso *dso);
25 struct dso *__dsos__addnew(struct dsos *dsos, const char *name);
26 struct dso *__dsos__find(struct dsos *dsos, const char *name, bool cmp_short);
27 struct dso *dsos__find(struct dsos *dsos, const char *name, bool cmp_short);
28 struct dso *__dsos__findnew(struct dsos *dsos, const char *name);
29 struct dso *dsos__findnew(struct dsos *dsos, const char *name);
31 struct dso *__dsos__findnew_link_by_longname(struct rb_root *root, struct dso *dso, const char *name);
33 static inline struct dso *__dsos__findnew_by_longname(struct rb_root *root, const char *name)
35 return __dsos__findnew_link_by_longname(root, NULL, name);
38 bool __dsos__read_build_ids(struct list_head *head, bool with_hits);
40 size_t __dsos__fprintf_buildid(struct list_head *head, FILE *fp,
41 bool (skip)(struct dso *dso, int parm), int parm);
42 size_t __dsos__fprintf(struct list_head *head, FILE *fp);
44 #endif /* __PERF_DSOS */