perf symbols: Simplify symbol machinery setup
And also express its configuration toggles via a struct. Now all one has to do is to call symbol__init(NULL) if the defaults are OK, or pass a struct symbol_conf pointer with the desired configuration. If a tool uses kernel_maps__find_symbol() to look at the kernel and modules mappings for a symbol but didn't call symbol__init() first, that will generate a one time warning too, alerting the subcommand developer that symbol__init() must be called. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1259071517-3242-2-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
committed by
Ingo Molnar
parent
7cc017edb9
commit
b32d133aec
@@ -101,8 +101,6 @@ out:
|
||||
|
||||
int mmap_dispatch_perf_file(struct perf_header **pheader,
|
||||
const char *input_name,
|
||||
const char *vmlinux_name,
|
||||
bool try_vmlinux_path,
|
||||
int force,
|
||||
int full_paths,
|
||||
int *cwdlen,
|
||||
@@ -172,12 +170,6 @@ int mmap_dispatch_perf_file(struct perf_header **pheader,
|
||||
curr_handler->sample_type_check(sample_type) < 0)
|
||||
goto out_delete;
|
||||
|
||||
err = -ENOMEM;
|
||||
if (kernel_maps__init(vmlinux_name, try_vmlinux_path, true) < 0) {
|
||||
pr_err("failed to setup the kernel maps to resolve symbols\n");
|
||||
goto out_delete;
|
||||
}
|
||||
|
||||
if (!full_paths) {
|
||||
if (getcwd(__cwd, sizeof(__cwd)) == NULL) {
|
||||
pr_err("failed to get the current directory\n");
|
||||
|
Reference in New Issue
Block a user