perf tools: Store compression id into struct dso
authorJiri Olsa <jolsa@kernel.org>
Fri, 17 Aug 2018 09:48:07 +0000 (11:48 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 20 Aug 2018 11:54:59 +0000 (08:54 -0300)
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>
tools/perf/util/dso.c
tools/perf/util/dso.h
tools/perf/util/machine.c

index d34e47bb09d93f072710f35c1226dbcef4a9e265..d875e6956a3eb7acb437f5658bc2a3607a9f782c 100644 (file)
@@ -417,8 +417,10 @@ void dso__set_module_info(struct dso *dso, struct kmod_path *m,
                dso->symtab_type = DSO_BINARY_TYPE__GUEST_KMODULE;
 
        /* _KMODULE_COMP should be next to _KMODULE */
-       if (m->kmod && m->comp)
+       if (m->kmod && m->comp) {
                dso->symtab_type++;
+               dso->comp = m->comp;
+       }
 
        dso__set_short_name(dso, strdup(m->name), true);
 }
@@ -1224,6 +1226,7 @@ struct dso *dso__new(const char *name)
                dso->a2l_fails = 1;
                dso->kernel = DSO_TYPE_USER;
                dso->needs_swap = DSO_SWAP__UNSET;
+               dso->comp = COMP_ID__NONE;
                RB_CLEAR_NODE(&dso->rb_node);
                dso->root = NULL;
                INIT_LIST_HEAD(&dso->node);
index 7bde23f6e5a948d50a6f1a14f000f0edb1c8308e..a6c7af52115f397fbaf35d8a26db9ff6dc32205e 100644 (file)
@@ -175,6 +175,7 @@ struct dso {
        u16              short_name_len;
        void            *dwfl;                  /* DWARF debug info */
        struct auxtrace_cache *auxtrace_cache;
+       int              comp;
 
        /* dso data file */
        struct {
index b300a3973448a91fd4286af12605fd653fc2a74a..c4acd2001db0d054fd3c39f328f7fbf57aa0e8ea 100644 (file)
@@ -1212,8 +1212,10 @@ static int map_groups__set_module_path(struct map_groups *mg, const char *path,
         * Full name could reveal us kmod compression, so
         * we need to update the symtab_type if needed.
         */
-       if (m->comp && is_kmod_dso(map->dso))
+       if (m->comp && is_kmod_dso(map->dso)) {
                map->dso->symtab_type++;
+               map->dso->comp = m->comp;
+       }
 
        return 0;
 }