diff options
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 2227b84aa002..78f9c4576a0c 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -951,9 +951,31 @@ static void event__process_sample(const event_t *self, | |||
951 | } | 951 | } |
952 | 952 | ||
953 | if (event__preprocess_sample(self, session, &al, symbol_filter) < 0 || | 953 | if (event__preprocess_sample(self, session, &al, symbol_filter) < 0 || |
954 | al.sym == NULL || al.filtered) | 954 | al.filtered) |
955 | return; | 955 | return; |
956 | 956 | ||
957 | if (al.sym == NULL) { | ||
958 | /* | ||
959 | * As we do lazy loading of symtabs we only will know if the | ||
960 | * specified vmlinux file is invalid when we actually have a | ||
961 | * hit in kernel space and then try to load it. So if we get | ||
962 | * here and there are _no_ symbols in the DSO backing the | ||
963 | * kernel map, bail out. | ||
964 | * | ||
965 | * We may never get here, for instance, if we use -K/ | ||
966 | * --hide-kernel-symbols, even if the user specifies an | ||
967 | * invalid --vmlinux ;-) | ||
968 | */ | ||
969 | if (al.map == session->vmlinux_maps[MAP__FUNCTION] && | ||
970 | RB_EMPTY_ROOT(&al.map->dso->symbols[MAP__FUNCTION])) { | ||
971 | pr_err("The %s file can't be used\n", | ||
972 | symbol_conf.vmlinux_name); | ||
973 | exit(1); | ||
974 | } | ||
975 | |||
976 | return; | ||
977 | } | ||
978 | |||
957 | syme = symbol__priv(al.sym); | 979 | syme = symbol__priv(al.sym); |
958 | if (!syme->skip) { | 980 | if (!syme->skip) { |
959 | syme->count[counter]++; | 981 | syme->count[counter]++; |