diff options
author | Jiri Olsa <jolsa@kernel.org> | 2018-08-17 05:48:07 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-08-20 07:54:59 -0400 |
commit | 2af5247530e073f4146d74ecd96cf64c953c001c (patch) | |
tree | f20b283d29fcbdfe2a69ecdfae4e1885c5c12f02 /tools | |
parent | 4b838b0db4e9cb3892b181ea9adc13cefb90d210 (diff) |
perf tools: Store compression id into struct dso
Add comp to 'struct dso' to hold the compression index. It will be used
in the following patches.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180817094813.15086-8-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/dso.c | 5 | ||||
-rw-r--r-- | tools/perf/util/dso.h | 1 | ||||
-rw-r--r-- | tools/perf/util/machine.c | 4 |
3 files changed, 8 insertions, 2 deletions
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index d34e47bb09d9..d875e6956a3e 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c | |||
@@ -417,8 +417,10 @@ void dso__set_module_info(struct dso *dso, struct kmod_path *m, | |||
417 | dso->symtab_type = DSO_BINARY_TYPE__GUEST_KMODULE; | 417 | dso->symtab_type = DSO_BINARY_TYPE__GUEST_KMODULE; |
418 | 418 | ||
419 | /* _KMODULE_COMP should be next to _KMODULE */ | 419 | /* _KMODULE_COMP should be next to _KMODULE */ |
420 | if (m->kmod && m->comp) | 420 | if (m->kmod && m->comp) { |
421 | dso->symtab_type++; | 421 | dso->symtab_type++; |
422 | dso->comp = m->comp; | ||
423 | } | ||
422 | 424 | ||
423 | dso__set_short_name(dso, strdup(m->name), true); | 425 | dso__set_short_name(dso, strdup(m->name), true); |
424 | } | 426 | } |
@@ -1224,6 +1226,7 @@ struct dso *dso__new(const char *name) | |||
1224 | dso->a2l_fails = 1; | 1226 | dso->a2l_fails = 1; |
1225 | dso->kernel = DSO_TYPE_USER; | 1227 | dso->kernel = DSO_TYPE_USER; |
1226 | dso->needs_swap = DSO_SWAP__UNSET; | 1228 | dso->needs_swap = DSO_SWAP__UNSET; |
1229 | dso->comp = COMP_ID__NONE; | ||
1227 | RB_CLEAR_NODE(&dso->rb_node); | 1230 | RB_CLEAR_NODE(&dso->rb_node); |
1228 | dso->root = NULL; | 1231 | dso->root = NULL; |
1229 | INIT_LIST_HEAD(&dso->node); | 1232 | INIT_LIST_HEAD(&dso->node); |
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h index 7bde23f6e5a9..a6c7af52115f 100644 --- a/tools/perf/util/dso.h +++ b/tools/perf/util/dso.h | |||
@@ -175,6 +175,7 @@ struct dso { | |||
175 | u16 short_name_len; | 175 | u16 short_name_len; |
176 | void *dwfl; /* DWARF debug info */ | 176 | void *dwfl; /* DWARF debug info */ |
177 | struct auxtrace_cache *auxtrace_cache; | 177 | struct auxtrace_cache *auxtrace_cache; |
178 | int comp; | ||
178 | 179 | ||
179 | /* dso data file */ | 180 | /* dso data file */ |
180 | struct { | 181 | struct { |
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index b300a3973448..c4acd2001db0 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -1212,8 +1212,10 @@ static int map_groups__set_module_path(struct map_groups *mg, const char *path, | |||
1212 | * Full name could reveal us kmod compression, so | 1212 | * Full name could reveal us kmod compression, so |
1213 | * we need to update the symtab_type if needed. | 1213 | * we need to update the symtab_type if needed. |
1214 | */ | 1214 | */ |
1215 | if (m->comp && is_kmod_dso(map->dso)) | 1215 | if (m->comp && is_kmod_dso(map->dso)) { |
1216 | map->dso->symtab_type++; | 1216 | map->dso->symtab_type++; |
1217 | map->dso->comp = m->comp; | ||
1218 | } | ||
1217 | 1219 | ||
1218 | return 0; | 1220 | return 0; |
1219 | } | 1221 | } |