dsos.h (1205B)
1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef __PERF_DSOS 3#define __PERF_DSOS 4 5#include <stdbool.h> 6#include <stdio.h> 7#include <linux/list.h> 8#include <linux/rbtree.h> 9#include "rwsem.h" 10 11struct dso; 12struct dso_id; 13 14/* 15 * DSOs are put into both a list for fast iteration and rbtree for fast 16 * long name lookup. 17 */ 18struct dsos { 19 struct list_head head; 20 struct rb_root root; /* rbtree root sorted by long name */ 21 struct rw_semaphore lock; 22}; 23 24void __dsos__add(struct dsos *dsos, struct dso *dso); 25void dsos__add(struct dsos *dsos, struct dso *dso); 26struct dso *__dsos__addnew(struct dsos *dsos, const char *name); 27struct dso *__dsos__find(struct dsos *dsos, const char *name, bool cmp_short); 28 29struct dso *dsos__findnew_id(struct dsos *dsos, const char *name, struct dso_id *id); 30 31struct dso *__dsos__findnew_link_by_longname_id(struct rb_root *root, struct dso *dso, 32 const char *name, struct dso_id *id); 33 34bool __dsos__read_build_ids(struct list_head *head, bool with_hits); 35 36size_t __dsos__fprintf_buildid(struct list_head *head, FILE *fp, 37 bool (skip)(struct dso *dso, int parm), int parm); 38size_t __dsos__fprintf(struct list_head *head, FILE *fp); 39 40#endif /* __PERF_DSOS */