Skip to content

Commit ca40e2a

Browse files
committed
perf tools: Separate dso data related variables
Add separated structure/namespace for data related variables. We are going to add mode of them, so this way they will be clearly separated. Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jean Pihet <jean.pihet@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1401892622-30848-3-git-send-email-jolsa@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
1 parent 0c4e774 commit ca40e2a

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

‎tools/perf/util/dso.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ dso_cache__read(struct dso *dso, struct machine *machine,
292292

293293
cache->offset = cache_offset;
294294
cache->size = ret;
295-
dso_cache__insert(&dso->cache, cache);
295+
dso_cache__insert(&dso->data.cache, cache);
296296

297297
ret = dso_cache__memcpy(cache, offset, data, size);
298298

@@ -310,7 +310,7 @@ static ssize_t dso_cache_read(struct dso *dso, struct machine *machine,
310310
{
311311
struct dso_cache *cache;
312312

313-
cache = dso_cache__find(&dso->cache, offset);
313+
cache = dso_cache__find(&dso->data.cache, offset);
314314
if (cache)
315315
return dso_cache__memcpy(cache, offset, data, size);
316316
else
@@ -473,7 +473,7 @@ struct dso *dso__new(const char *name)
473473
dso__set_short_name(dso, dso->name, false);
474474
for (i = 0; i < MAP__NR_TYPES; ++i)
475475
dso->symbols[i] = dso->symbol_names[i] = RB_ROOT;
476-
dso->cache = RB_ROOT;
476+
dso->data.cache = RB_ROOT;
477477
dso->symtab_type = DSO_BINARY_TYPE__NOT_FOUND;
478478
dso->binary_type = DSO_BINARY_TYPE__NOT_FOUND;
479479
dso->loaded = 0;
@@ -506,7 +506,7 @@ void dso__delete(struct dso *dso)
506506
dso->long_name_allocated = false;
507507
}
508508

509-
dso_cache__free(&dso->cache);
509+
dso_cache__free(&dso->data.cache);
510510
dso__free_a2l(dso);
511511
zfree(&dso->symsrc_filename);
512512
free(dso);

‎tools/perf/util/dso.h‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ struct dso {
7676
struct list_head node;
7777
struct rb_root symbols[MAP__NR_TYPES];
7878
struct rb_root symbol_names[MAP__NR_TYPES];
79-
struct rb_root cache;
8079
void *a2l;
8180
char *symsrc_filename;
8281
unsigned int a2l_fails;
@@ -99,6 +98,12 @@ struct dso {
9998
const char *long_name;
10099
u16 long_name_len;
101100
u16 short_name_len;
101+
102+
/* dso data file */
103+
struct {
104+
struct rb_root cache;
105+
} data;
106+
102107
char name[0];
103108
};
104109

0 commit comments

Comments
 (0)