perf symbols: When not using modules, discard its symbols
[deliverable/linux.git] / tools / perf / util / symbol.c
index b6a2941e7786dff577c7b07ae5ba3a9781b78ef1..b788c2f5d672d8c69e075b9548f881b4ea086ef1 100644 (file)
@@ -381,6 +381,9 @@ static int dso__split_kallsyms(struct dso *self, struct map *map, struct thread
 
                module = strchr(pos->name, '\t');
                if (module) {
+                       if (!thread->use_modules)
+                               goto discard_symbol;
+
                        *module++ = '\0';
 
                        if (strcmp(self->name, module)) {
@@ -420,7 +423,7 @@ static int dso__split_kallsyms(struct dso *self, struct map *map, struct thread
                }
 
                if (filter && filter(curr_map, pos)) {
-                       rb_erase(&pos->rb_node, root);
+discard_symbol:                rb_erase(&pos->rb_node, root);
                        symbol__delete(pos);
                } else {
                        if (curr_map != map) {
@@ -1635,6 +1638,7 @@ int symbol__init(struct symbol_conf *conf)
                return -1;
        }
 
+       kthread->use_modules = pconf->use_modules;
        if (pconf->use_modules && thread__create_module_maps(kthread) < 0)
                pr_debug("Failed to load list of modules in use, "
                         "continuing...\n");
This page took 0.027049 seconds and 5 git commands to generate.