Merge tag 'powerpc-5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[linux/fpc-iii.git] / tools / perf / util / dsos.h
blob5dbec2bc6966d49d873958dcbfc1272699ed790d
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __PERF_DSOS
3 #define __PERF_DSOS
5 #include <stdbool.h>
6 #include <stdio.h>
7 #include <linux/list.h>
8 #include <linux/rbtree.h>
9 #include "rwsem.h"
11 struct dso;
12 struct dso_id;
15 * DSOs are put into both a list for fast iteration and rbtree for fast
16 * long name lookup.
18 struct dsos {
19 struct list_head head;
20 struct rb_root root; /* rbtree root sorted by long name */
21 struct rw_semaphore lock;
24 void __dsos__add(struct dsos *dsos, struct dso *dso);
25 void dsos__add(struct dsos *dsos, struct dso *dso);
26 struct dso *__dsos__addnew(struct dsos *dsos, const char *name);
27 struct dso *__dsos__find(struct dsos *dsos, const char *name, bool cmp_short);
29 struct dso *dsos__findnew_id(struct dsos *dsos, const char *name, struct dso_id *id);
31 struct dso *__dsos__findnew_link_by_longname_id(struct rb_root *root, struct dso *dso,
32 const char *name, struct dso_id *id);
34 bool __dsos__read_build_ids(struct list_head *head, bool with_hits);
36 size_t __dsos__fprintf_buildid(struct list_head *head, FILE *fp,
37 bool (skip)(struct dso *dso, int parm), int parm);
38 size_t __dsos__fprintf(struct list_head *head, FILE *fp);
40 #endif /* __PERF_DSOS */