]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - tools/perf/util/dso.c
perf symbols: Set module info when build-id event found
[karo-tx-linux.git] / tools / perf / util / dso.c
index a96a99d2369f800634025bcdfa9838d1d6bc9d97..b27d127cdf68f996ee4f96ce24aa51044e31bf9f 100644 (file)
@@ -335,6 +335,21 @@ int __kmod_path__parse(struct kmod_path *m, const char *path,
        return 0;
 }
 
+void dso__set_module_info(struct dso *dso, struct kmod_path *m,
+                         struct machine *machine)
+{
+       if (machine__is_host(machine))
+               dso->symtab_type = DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE;
+       else
+               dso->symtab_type = DSO_BINARY_TYPE__GUEST_KMODULE;
+
+       /* _KMODULE_COMP should be next to _KMODULE */
+       if (m->kmod && m->comp)
+               dso->symtab_type++;
+
+       dso__set_short_name(dso, strdup(m->name), true);
+}
+
 /*
  * Global list of open DSOs and the counter.
  */