diff options
author | Waiman Long <Waiman.Long@hp.com> | 2014-09-29 16:07:28 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-09-30 12:11:49 -0300 |
commit | 8fa7d87f91479f7124142ca4ad93a37b80f8c1c0 (patch) | |
tree | 7ec17d252a3a55636abf4542e7d944e41345c8e1 /tools/perf/util/dso.h | |
parent | e19685ed24b518440c0717719ff02e74c0e6d2cb (diff) | |
download | op-kernel-dev-8fa7d87f91479f7124142ca4ad93a37b80f8c1c0.zip op-kernel-dev-8fa7d87f91479f7124142ca4ad93a37b80f8c1c0.tar.gz |
perf symbols: Encapsulate dsos list head into struct dsos
This is a precursor patch to enable long name searching of DSOs using
a rbtree.
In this patch, a new dsos structure is created which contains only a
list head structure for the moment.
The new dsos structure is used, in turn, in the machine structure for
the user_dsos and kernel_dsos fields.
Only the following 3 dsos functions are modified to accept the new dsos
structure parameter instead of list_head:
- dsos__add()
- dsos__find()
- __dsos__findnew()
Signed-off-by: Waiman Long <Waiman.Long@hp.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Douglas Hatch <doug.hatch@hp.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Scott J Norton <scott.norton@hp.com>
Link: http://lkml.kernel.org/r/1412021249-19201-2-git-send-email-Waiman.Long@hp.com
[ Move struct dsos to dso.h to reduce the dso methods depends on machine.h ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/dso.h')
-rw-r--r-- | tools/perf/util/dso.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h index 5e463c0..b63dc98 100644 --- a/tools/perf/util/dso.h +++ b/tools/perf/util/dso.h @@ -90,6 +90,13 @@ struct dso_cache { char data[0]; }; +/* + * DSOs are put into a list for fast iteration. + */ +struct dsos { + struct list_head head; +}; + struct dso { struct list_head node; struct rb_root symbols[MAP__NR_TYPES]; @@ -224,10 +231,10 @@ struct map *dso__new_map(const char *name); struct dso *dso__kernel_findnew(struct machine *machine, const char *name, const char *short_name, int dso_type); -void dsos__add(struct list_head *head, struct dso *dso); -struct dso *dsos__find(const struct list_head *head, const char *name, +void dsos__add(struct dsos *dsos, struct dso *dso); +struct dso *dsos__find(const struct dsos *dsos, const char *name, bool cmp_short); -struct dso *__dsos__findnew(struct list_head *head, const char *name); +struct dso *__dsos__findnew(struct dsos *dsos, const char *name); bool __dsos__read_build_ids(struct list_head *head, bool with_hits); size_t __dsos__fprintf_buildid(struct list_head *head, FILE *fp, |