perf symbols: Ignore mapping symbols on aarch64
[firefly-linux-kernel-4.4.55.git] / tools / perf / util / symbol-elf.c
index 06fcd1bf98b6034e39ef9af8dd0b4111d9208535..225eb73ee78b7f52a64feb035fcf0c2336fdc7d9 100644 (file)
@@ -574,13 +574,16 @@ static int decompress_kmodule(struct dso *dso, const char *name,
        const char *ext = strrchr(name, '.');
        char tmpbuf[] = "/tmp/perf-kmod-XXXXXX";
 
-       if ((type != DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP &&
-            type != DSO_BINARY_TYPE__GUEST_KMODULE_COMP) ||
-           type != dso->symtab_type)
+       if (type != DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP &&
+           type != DSO_BINARY_TYPE__GUEST_KMODULE_COMP &&
+           type != DSO_BINARY_TYPE__BUILD_ID_CACHE)
                return -1;
 
-       if (!ext || !is_supported_compression(ext + 1))
-               return -1;
+       if (!ext || !is_supported_compression(ext + 1)) {
+               ext = strrchr(dso->name, '.');
+               if (!ext || !is_supported_compression(ext + 1))
+                       return -1;
+       }
 
        fd = mkstemp(tmpbuf);
        if (fd < 0)
@@ -856,10 +859,9 @@ int dso__load_sym(struct dso *dso, struct map *map,
                /* Reject ARM ELF "mapping symbols": these aren't unique and
                 * don't identify functions, so will confuse the profile
                 * output: */
-               if (ehdr.e_machine == EM_ARM) {
-                       if (!strcmp(elf_name, "$a") ||
-                           !strcmp(elf_name, "$d") ||
-                           !strcmp(elf_name, "$t"))
+               if (ehdr.e_machine == EM_ARM || ehdr.e_machine == EM_AARCH64) {
+                       if (elf_name[0] == '$' && strchr("adtx", elf_name[1])
+                           && (elf_name[2] == '\0' || elf_name[2] == '.'))
                                continue;
                }