diff options
| -rw-r--r-- | tools/perf/ui/browsers/hists.c | 2 | ||||
| -rw-r--r-- | tools/perf/util/genelf.h | 24 |
2 files changed, 11 insertions, 15 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 4b9816555946..2a83414159a6 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
| @@ -337,7 +337,7 @@ static void callchain_node__init_have_children(struct callchain_node *node, | |||
| 337 | chain = list_entry(node->val.next, struct callchain_list, list); | 337 | chain = list_entry(node->val.next, struct callchain_list, list); |
| 338 | chain->has_children = has_sibling; | 338 | chain->has_children = has_sibling; |
| 339 | 339 | ||
| 340 | if (node->val.next != node->val.prev) { | 340 | if (!list_empty(&node->val)) { |
| 341 | chain = list_entry(node->val.prev, struct callchain_list, list); | 341 | chain = list_entry(node->val.prev, struct callchain_list, list); |
| 342 | chain->has_children = !RB_EMPTY_ROOT(&node->rb_root); | 342 | chain->has_children = !RB_EMPTY_ROOT(&node->rb_root); |
| 343 | } | 343 | } |
diff --git a/tools/perf/util/genelf.h b/tools/perf/util/genelf.h index cd67e64a0494..2fbeb59c4bdd 100644 --- a/tools/perf/util/genelf.h +++ b/tools/perf/util/genelf.h | |||
| @@ -9,36 +9,32 @@ int jit_add_debug_info(Elf *e, uint64_t code_addr, void *debug, int nr_debug_ent | |||
| 9 | 9 | ||
| 10 | #if defined(__arm__) | 10 | #if defined(__arm__) |
| 11 | #define GEN_ELF_ARCH EM_ARM | 11 | #define GEN_ELF_ARCH EM_ARM |
| 12 | #define GEN_ELF_ENDIAN ELFDATA2LSB | ||
| 13 | #define GEN_ELF_CLASS ELFCLASS32 | 12 | #define GEN_ELF_CLASS ELFCLASS32 |
| 14 | #elif defined(__aarch64__) | 13 | #elif defined(__aarch64__) |
| 15 | #define GEN_ELF_ARCH EM_AARCH64 | 14 | #define GEN_ELF_ARCH EM_AARCH64 |
| 16 | #define GEN_ELF_ENDIAN ELFDATA2LSB | ||
| 17 | #define GEN_ELF_CLASS ELFCLASS64 | 15 | #define GEN_ELF_CLASS ELFCLASS64 |
| 18 | #elif defined(__x86_64__) | 16 | #elif defined(__x86_64__) |
| 19 | #define GEN_ELF_ARCH EM_X86_64 | 17 | #define GEN_ELF_ARCH EM_X86_64 |
| 20 | #define GEN_ELF_ENDIAN ELFDATA2LSB | ||
| 21 | #define GEN_ELF_CLASS ELFCLASS64 | 18 | #define GEN_ELF_CLASS ELFCLASS64 |
| 22 | #elif defined(__i386__) | 19 | #elif defined(__i386__) |
| 23 | #define GEN_ELF_ARCH EM_386 | 20 | #define GEN_ELF_ARCH EM_386 |
| 24 | #define GEN_ELF_ENDIAN ELFDATA2LSB | ||
| 25 | #define GEN_ELF_CLASS ELFCLASS32 | 21 | #define GEN_ELF_CLASS ELFCLASS32 |
| 26 | #elif defined(__ppcle__) | 22 | #elif defined(__powerpc64__) |
| 27 | #define GEN_ELF_ARCH EM_PPC | ||
| 28 | #define GEN_ELF_ENDIAN ELFDATA2LSB | ||
| 29 | #define GEN_ELF_CLASS ELFCLASS64 | ||
| 30 | #elif defined(__powerpc__) | ||
| 31 | #define GEN_ELF_ARCH EM_PPC64 | ||
| 32 | #define GEN_ELF_ENDIAN ELFDATA2MSB | ||
| 33 | #define GEN_ELF_CLASS ELFCLASS64 | ||
| 34 | #elif defined(__powerpcle__) | ||
| 35 | #define GEN_ELF_ARCH EM_PPC64 | 23 | #define GEN_ELF_ARCH EM_PPC64 |
| 36 | #define GEN_ELF_ENDIAN ELFDATA2LSB | ||
| 37 | #define GEN_ELF_CLASS ELFCLASS64 | 24 | #define GEN_ELF_CLASS ELFCLASS64 |
| 25 | #elif defined(__powerpc__) | ||
| 26 | #define GEN_ELF_ARCH EM_PPC | ||
| 27 | #define GEN_ELF_CLASS ELFCLASS32 | ||
| 38 | #else | 28 | #else |
| 39 | #error "unsupported architecture" | 29 | #error "unsupported architecture" |
| 40 | #endif | 30 | #endif |
| 41 | 31 | ||
| 32 | #if __BYTE_ORDER == __BIG_ENDIAN | ||
| 33 | #define GEN_ELF_ENDIAN ELFDATA2MSB | ||
| 34 | #else | ||
| 35 | #define GEN_ELF_ENDIAN ELFDATA2LSB | ||
| 36 | #endif | ||
| 37 | |||
| 42 | #if GEN_ELF_CLASS == ELFCLASS64 | 38 | #if GEN_ELF_CLASS == ELFCLASS64 |
| 43 | #define elf_newehdr elf64_newehdr | 39 | #define elf_newehdr elf64_newehdr |
| 44 | #define elf_getshdr elf64_getshdr | 40 | #define elf_getshdr elf64_getshdr |
