module = strchr(pos->name, '\t');
                if (module) {
+                       if (!thread->use_modules)
+                               goto discard_symbol;
+
                        *module++ = '\0';
 
                        if (strcmp(self->name, module)) {
                }
 
                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) {
                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");