if (kernel_dso == NULL)
return -1;
- if (dso__load_kernel(kernel_dso, NULL, symbol_filter, 1) != 0)
+ if (dso__load_kernel(kernel_dso, NULL, symbol_filter, 1) <= 0)
goto out_delete_dso;
node = rb_first(&kernel_dso->syms);
char *line = NULL;
size_t n;
FILE *file = fopen("/proc/kallsyms", "r");
+ int count = 0;
if (file == NULL)
goto out_failure;
if (filter && filter(self, sym))
symbol__delete(sym, self->sym_priv_size);
- else
+ else {
dso__insert_symbol(self, sym);
+ count++;
+ }
}
/*
free(line);
fclose(file);
- return 0;
+ return count;
out_delete_line:
free(line);
if (vmlinux)
err = dso__load_vmlinux(self, vmlinux, filter, verbose);
- if (err < 0)
+ if (err <= 0)
err = dso__load_kallsyms(self, filter, verbose);
return err;