Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
53 lines
1.4 KiB
C
53 lines
1.4 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __PERF_DSOS
|
|
#define __PERF_DSOS
|
|
|
|
#include <stdbool.h>
|
|
#include <stdio.h>
|
|
#include <linux/list.h>
|
|
#include <linux/rbtree.h>
|
|
#include "rwsem.h"
|
|
|
|
struct dso;
|
|
struct dso_id;
|
|
struct kmod_path;
|
|
struct machine;
|
|
|
|
/*
|
|
* Collection of DSOs as an array for iteration speed, but sorted for O(n)
|
|
* lookup.
|
|
*/
|
|
struct dsos {
|
|
struct rw_semaphore lock;
|
|
struct dso **dsos;
|
|
unsigned int cnt;
|
|
unsigned int allocated;
|
|
bool sorted;
|
|
};
|
|
|
|
void dsos__init(struct dsos *dsos);
|
|
void dsos__exit(struct dsos *dsos);
|
|
|
|
int __dsos__add(struct dsos *dsos, struct dso *dso);
|
|
int dsos__add(struct dsos *dsos, struct dso *dso);
|
|
struct dso *dsos__find(struct dsos *dsos, const char *name, bool cmp_short);
|
|
|
|
struct dso *dsos__findnew_id(struct dsos *dsos, const char *name, const struct dso_id *id);
|
|
|
|
bool dsos__read_build_ids(struct dsos *dsos, bool with_hits);
|
|
|
|
size_t dsos__fprintf_buildid(struct dsos *dsos, FILE *fp,
|
|
bool (skip)(struct dso *dso, int parm), int parm);
|
|
size_t dsos__fprintf(struct dsos *dsos, FILE *fp);
|
|
|
|
int dsos__hit_all(struct dsos *dsos);
|
|
|
|
struct dso *dsos__findnew_module_dso(struct dsos *dsos, struct machine *machine,
|
|
struct kmod_path *m, const char *filename);
|
|
|
|
struct dso *dsos__find_kernel_dso(struct dsos *dsos);
|
|
|
|
int dsos__for_each_dso(struct dsos *dsos, int (*cb)(struct dso *dso, void *data), void *data);
|
|
|
|
#endif /* __PERF_DSOS */
|