diff options
author | Willy Tarreau <w@1wt.eu> | 2013-09-14 04:32:59 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-10-09 10:42:20 -0400 |
commit | fc2be6968e99b5314f20e938a547d44dcb1c40eb (patch) | |
tree | 5ffc3b6398ec53978814935700210be0821207b3 | |
parent | dd96c46b5c765a779d8c35cc7d1df7515b4c7baf (diff) |
perf symbols: Add new option --ignore-vmlinux for perf top
Running "perf top" on a machine with possibly invalid or non-matching
vmlinux at the various places results in no symbol resolving despite
/proc/kallsyms being present and valid.
Add a new option --ignore-vmlinux to explicitly indicate that we do not
want to use these kernels and just use what we have (kallsyms).
Signed-off-by: Willy Tarreau <w@1wt.eu>
Cc: Ingo Molnar <mingo@redhat.com>
Link: http://lkml.kernel.org/r/20130914083259.GA3418@1wt.eu
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-top.c | 2 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 4 | ||||
-rw-r--r-- | tools/perf/util/symbol.h | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index e8466956adbe..65c49b2f51c1 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -1073,6 +1073,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) | |||
1073 | "list of cpus to monitor"), | 1073 | "list of cpus to monitor"), |
1074 | OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name, | 1074 | OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name, |
1075 | "file", "vmlinux pathname"), | 1075 | "file", "vmlinux pathname"), |
1076 | OPT_BOOLEAN(0, "ignore-vmlinux", &symbol_conf.ignore_vmlinux, | ||
1077 | "don't load vmlinux even if found"), | ||
1076 | OPT_BOOLEAN('K', "hide_kernel_symbols", &top.hide_kernel_symbols, | 1078 | OPT_BOOLEAN('K', "hide_kernel_symbols", &top.hide_kernel_symbols, |
1077 | "hide kernel symbols"), | 1079 | "hide kernel symbols"), |
1078 | OPT_CALLBACK('m', "mmap-pages", &opts->mmap_pages, "pages", | 1080 | OPT_CALLBACK('m', "mmap-pages", &opts->mmap_pages, "pages", |
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index cd1dcc45049b..48c38791d61b 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -1215,7 +1215,7 @@ static int dso__load_kernel_sym(struct dso *dso, struct map *map, | |||
1215 | goto do_kallsyms; | 1215 | goto do_kallsyms; |
1216 | } | 1216 | } |
1217 | 1217 | ||
1218 | if (symbol_conf.vmlinux_name != NULL) { | 1218 | if (!symbol_conf.ignore_vmlinux && symbol_conf.vmlinux_name != NULL) { |
1219 | err = dso__load_vmlinux(dso, map, | 1219 | err = dso__load_vmlinux(dso, map, |
1220 | symbol_conf.vmlinux_name, filter); | 1220 | symbol_conf.vmlinux_name, filter); |
1221 | if (err > 0) { | 1221 | if (err > 0) { |
@@ -1227,7 +1227,7 @@ static int dso__load_kernel_sym(struct dso *dso, struct map *map, | |||
1227 | return err; | 1227 | return err; |
1228 | } | 1228 | } |
1229 | 1229 | ||
1230 | if (vmlinux_path != NULL) { | 1230 | if (!symbol_conf.ignore_vmlinux && vmlinux_path != NULL) { |
1231 | err = dso__load_vmlinux_path(dso, map, filter); | 1231 | err = dso__load_vmlinux_path(dso, map, filter); |
1232 | if (err > 0) | 1232 | if (err > 0) |
1233 | return err; | 1233 | return err; |
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 2a97bb1a8097..9b8b213a62c1 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
@@ -85,6 +85,7 @@ struct symbol_conf { | |||
85 | unsigned short priv_size; | 85 | unsigned short priv_size; |
86 | unsigned short nr_events; | 86 | unsigned short nr_events; |
87 | bool try_vmlinux_path, | 87 | bool try_vmlinux_path, |
88 | ignore_vmlinux, | ||
88 | show_kernel_path, | 89 | show_kernel_path, |
89 | use_modules, | 90 | use_modules, |
90 | sort_by_name, | 91 | sort_by_name, |