Skip to contentSkip to conversation

perf/urgent fixes

GIT PULL New Arnaldo Carvalho de Melo 2 participants 4 messages Mar 30, 2016 – Mar 31, 2016 perf events

lore
Share & tools
lore

Arnaldo Carvalho de Melo

author maintainer
#0 lore raw

Hi Ingo,

Please consider pulling,

- Arnaldo

The following changes since commit f6343be96ebbae38a07e0878810f5bbc0c38cade:

Merge tag 'perf-urgent-for-mingo-20160329' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2016-03-30 12:31:03 +0200)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo-20160330

for you to fetch changes up to 9f56c092b99b40ce3cf4c6d0134ff7e513c9f1a6:

perf jit: genelf makes assumptions about endian (2016-03-30 18:12:06 -0300)

----------------------------------------------------------------
perf/urgent fixes:

- Fix determination of a callchain node's childlessness in the top/report TUI, which was preventing navigating some callchains, --stdio unnaffected (Andres Freund)

- Fix jitdump's genelf assumption that PowerPC is big endian only (Anton Blanchard)

----------------------------------------------------------------
Andres Freund (1):
perf hists: Fix determination of a callchain node's childlessness

Anton Blanchard (1):
perf jit: genelf makes assumptions about endian

 tools/perf/ui/browsers/hists.c |  2 +-
 tools/perf/util/genelf.h       | 24 ++++++++++--------------
 2 files changed, 11 insertions(+), 15 deletions(-)
author maintainer
#1 lore raw

PATCH 1/2 perf hists: Fix determination of a callchain node's childlessness

From: Andres Freund <[email protected]>

The 4b3a3212233a ("perf hists browser: Support flat callchains") commit over-aggressively tried to optimize callchain_node__init_have_children().

That lead to --tui mode not allowing to expand call chain elements if a call chain element had only one parent. That's why --inverted callgraphs looked halfway sane, but plain ones didn't.

Revert that individual optimization, it wasn't really related to the rest of the commit.

---
 tools/perf/ui/browsers/hists.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/ui/browsers/hists.c +1 -1
index 4b9816555946..2a83414159a6 100644
@@ -337,7 +337,7 @@ static void callchain_node__init_have_children(struct callchain_node *node,
 	chain = list_entry(node->val.next, struct callchain_list, list);
 	chain->has_children = has_sibling;
 
-	if (node->val.next != node->val.prev) {
+	if (!list_empty(&node->val)) {
 		chain = list_entry(node->val.prev, struct callchain_list, list);
 		chain->has_children = !RB_EMPTY_ROOT(&node->rb_root);
 	}
Signature · 1 line
2.5.5
author maintainer
#2 lore raw

PATCH 2/2 perf jit: genelf makes assumptions about endian

In reply to Arnaldo Carvalho de Melo

From: Anton Blanchard <[email protected]>

Commit 9b07e27f88b9 ("perf inject: Add jitdump mmap injection support") incorrectly assumed that PowerPC is big endian only.

Simplify things by consolidating the define of GEN_ELF_ENDIAN and checking for __BYTE_ORDER == __BIG_ENDIAN.

The PowerPC checks were also incorrect, they do not match what gcc emits. We should first look for __powerpc64__, then __powerpc__.

Cc Carl Love <[email protected]>
Cc Stephane Eranian <[email protected]>
Cc Sukadev Bhattiprolu <[email protected]>
Fixes 9b07e27f88b9 ("perf inject: Add jitdump mmap injection support")
---
 tools/perf/util/genelf.h | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)
tools/perf/util/genelf.h +10 -14
index cd67e64a0494..2fbeb59c4bdd 100644
@@ -9,36 +9,32 @@ int jit_add_debug_info(Elf *e, uint64_t code_addr, void *debug, int nr_debug_ent
 
 #if   defined(__arm__)
 #define GEN_ELF_ARCH	EM_ARM
-#define GEN_ELF_ENDIAN	ELFDATA2LSB
 #define GEN_ELF_CLASS	ELFCLASS32
 #elif defined(__aarch64__)
 #define GEN_ELF_ARCH	EM_AARCH64
-#define GEN_ELF_ENDIAN	ELFDATA2LSB
 #define GEN_ELF_CLASS	ELFCLASS64
 #elif defined(__x86_64__)
 #define GEN_ELF_ARCH	EM_X86_64
-#define GEN_ELF_ENDIAN	ELFDATA2LSB
 #define GEN_ELF_CLASS	ELFCLASS64
 #elif defined(__i386__)
 #define GEN_ELF_ARCH	EM_386
-#define GEN_ELF_ENDIAN	ELFDATA2LSB
 #define GEN_ELF_CLASS	ELFCLASS32
-#elif defined(__ppcle__)
-#define GEN_ELF_ARCH	EM_PPC
-#define GEN_ELF_ENDIAN	ELFDATA2LSB
-#define GEN_ELF_CLASS	ELFCLASS64
-#elif defined(__powerpc__)
-#define GEN_ELF_ARCH	EM_PPC64
-#define GEN_ELF_ENDIAN	ELFDATA2MSB
-#define GEN_ELF_CLASS	ELFCLASS64
-#elif defined(__powerpcle__)
+#elif defined(__powerpc64__)
 #define GEN_ELF_ARCH	EM_PPC64
-#define GEN_ELF_ENDIAN	ELFDATA2LSB
 #define GEN_ELF_CLASS	ELFCLASS64
+#elif defined(__powerpc__)
+#define GEN_ELF_ARCH	EM_PPC
+#define GEN_ELF_CLASS	ELFCLASS32
 #else
 #error "unsupported architecture"
 #endif
 
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define GEN_ELF_ENDIAN	ELFDATA2MSB
+#else
+#define GEN_ELF_ENDIAN	ELFDATA2LSB
+#endif
+
 #if GEN_ELF_CLASS == ELFCLASS64
 #define elf_newehdr	elf64_newehdr
 #define elf_getshdr	elf64_getshdr
Signature · 1 line
2.5.5
#3 lore raw
In reply to Arnaldo Carvalho de Melo
Quoted 34 lines · Arnaldo Carvalho de Melo

Hi Ingo,

Please consider pulling,

- Arnaldo

The following changes since commit f6343be96ebbae38a07e0878810f5bbc0c38cade:

Merge tag 'perf-urgent-for-mingo-20160329' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2016-03-30 12:31:03 +0200)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo-20160330

for you to fetch changes up to 9f56c092b99b40ce3cf4c6d0134ff7e513c9f1a6:

perf jit: genelf makes assumptions about endian (2016-03-30 18:12:06 -0300)

----------------------------------------------------------------
perf/urgent fixes:

- Fix determination of a callchain node's childlessness in the top/report TUI, which was preventing navigating some callchains, --stdio unnaffected (Andres Freund)

- Fix jitdump's genelf assumption that PowerPC is big endian only (Anton Blanchard)

----------------------------------------------------------------
Andres Freund (1):
perf hists: Fix determination of a callchain node's childlessness

Quoted 6 lines

Anton Blanchard (1):
perf jit: genelf makes assumptions about endian

 tools/perf/ui/browsers/hists.c |  2 +-
 tools/perf/util/genelf.h       | 24 ++++++++++--------------
 2 files changed, 11 insertions(+), 15 deletions(-)

Pulled, thanks a lot Arnaldo!

Ingo