Skip to contentSkip to conversation

ARM: fix perf build with uclibc toolchains

PATCH New Florian Fainelli 2 participants 6 messages Aug 9, 2011 – Aug 10, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: fix perf build with uclibc toolchains

libio.h is not provided by uClibc, in order to be able to test the definition of __UCLIBC__ we need to include stdlib.h, which also includes stddef.h, providing the definition of 'NULL'.

---

tools/perf/arch/arm/util/dwarf-regs.c +3 -0
index fff6450..e8d5c55 100644
@@ -8,7 +8,10 @@
  * published by the Free Software Foundation.
  */
 
+#include <stdlib.h>
+#ifndef __UCLIBC__
 #include <libio.h>
+#endif
 #include <dwarf-regs.h>
 
 struct pt_regs_dwarfnum {
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/1 ARM: fix perf build with uclibc toolchains

Hi Florian,

Quoted 11 lines · Florian Fainelli

libio.h is not provided by uClibc, in order to be able to test the definition of __UCLIBC__ we need to include stdlib.h, which also includes stddef.h, providing the definition of 'NULL'.

---

tools/perf/arch/arm/util/dwarf-regs.c +0 -0
index fff6450..e8d5c55 100644

tools/perf/arch/arm/util/dwarf-regs.c line 17

Quoted 10 lines
tools/perf/arch/arm/util/dwarf-regs.c +3 -0
@@ -8,7 +8,10 @@
  * published by the Free Software Foundation.
  */
 
+#include <stdlib.h>
+#ifndef __UCLIBC__
 #include <libio.h>
+#endif
 #include <dwarf-regs.h>
 
 struct pt_regs_dwarfnum {

Nice to see somebody trying to get this going with uclinux! I'll give this a quick compile-check on my boards and then I'll include it in my perf-fixes branch for 3.1.

Cheers,

Will

#2 lore raw

PATCH 1/1 ARM: fix perf build with uclibc toolchains

Quoted 21 lines · Will Deacon
Quoted 20 lines · Florian Fainelli

libio.h is not provided by uClibc, in order to be able to test the definition of __UCLIBC__ we need to include stdlib.h, which also includes stddef.h, providing the definition of 'NULL'.

---

tools/perf/arch/arm/util/dwarf-regs.c +3 -0
index fff6450..e8d5c55 100644
@@ -8,7 +8,10 @@
  * published by the Free Software Foundation.
  */
 
+#include <stdlib.h>
+#ifndef __UCLIBC__
 #include <libio.h>
+#endif
 #include <dwarf-regs.h>
 
Quoted 5 lines

tools/perf/arch/arm/util/dwarf-regs.c line 17

Quoted 1 line
tools/perf/arch/arm/util/dwarf-regs.c +0 -0
 struct pt_regs_dwarfnum {

Nice to see somebody trying to get this going with uclinux! I'll give this a quick compile-check on my boards and then I'll include it in my perf-fixes branch for 3.1.

Seems happy enough on my MMU boards. Since you're using this on noMMU platforms, does that mean that you can build a static perf binary out of the box or do you need further patches for this?

Will

#3 lore raw

PATCH 1/1 ARM: fix perf build with uclibc toolchains

Quoted 32 lines · On Wednesday 10 August 2011 12:21:55 Will Deacon wrote:
Quoted 23 lines · Will Deacon
Quoted 22 lines · Florian Fainelli

libio.h is not provided by uClibc, in order to be able to test the definition of __UCLIBC__ we need to include stdlib.h, which also includes stddef.h, providing the definition of 'NULL'.

---

(quoted diff) +0 -0

b/tools/perf/arch/arm/util/dwarf-regs.c index fff6450..e8d5c55 100644

tools/perf/arch/arm/util/dwarf-regs.c +3 -0
@@ -8,7 +8,10 @@
 
  * published by the Free Software Foundation.
  */
 
+#include <stdlib.h>
+#ifndef __UCLIBC__
 
 #include <libio.h>
 
+#endif
Quoted 7 lines
Quoted 3 lines

#include <dwarf-regs.h>

struct pt_regs_dwarfnum {

Nice to see somebody trying to get this going with uclinux! I'll give this a quick compile-check on my boards and then I'll include it in my perf-fixes branch for 3.1.

Quoted 3 lines

Seems happy enough on my MMU boards. Since you're using this on noMMU platforms, does that mean that you can build a static perf binary out of the box or do you need further patches for this?

uClibc is not only for noMMU boards, I just built an uclibc toolchain for arm targetting realview and run-tested this with qemu. This was the only patch required to cross-compile perf for me. I also tested this with eglibc.

By the way, perf top reports no even being generated for realview under qemu, is that normal?
--
Florian

#4 lore raw

PATCH 1/1 ARM: fix perf build with uclibc toolchains

Quoted 33 lines · Florian Fainelli
Quoted 32 lines · On Wednesday 10 August 2011 12:21:55 Will Deacon wrote:
Quoted 30 lines · Will Deacon
Quoted 22 lines · Florian Fainelli

libio.h is not provided by uClibc, in order to be able to test the definition of __UCLIBC__ we need to include stdlib.h, which also includes stddef.h, providing the definition of 'NULL'.

---

(quoted diff) +0 -0

b/tools/perf/arch/arm/util/dwarf-regs.c index fff6450..e8d5c55 100644

tools/perf/arch/arm/util/dwarf-regs.c +3 -0
@@ -8,7 +8,10 @@
 
  * published by the Free Software Foundation.
  */
 
+#include <stdlib.h>
+#ifndef __UCLIBC__
 
 #include <libio.h>
 
+#endif
Quoted 3 lines

#include <dwarf-regs.h>

struct pt_regs_dwarfnum {

Nice to see somebody trying to get this going with uclinux! I'll give this a quick compile-check on my boards and then I'll include it in my perf-fixes branch for 3.1.

Quoted 7 lines
Quoted 3 lines

Seems happy enough on my MMU boards. Since you're using this on noMMU platforms, does that mean that you can build a static perf binary out of the box or do you need further patches for this?

uClibc is not only for noMMU boards, I just built an uclibc toolchain for arm targetting realview and run-tested this with qemu. This was the only patch required to cross-compile perf for me. I also tested this with eglibc.

Ok, great. Cross-compiling perf usually just causes endless pain for me.

Quoted 2 lines

By the way, perf top reports no even being generated for realview under qemu, is that normal?

My guess is that qemu isn't emulating the cycle counter, which is required to generate interrupts for use by perf. You could try disabling HW_PERF_EVENTS which will force perf to fall back to a CPU tick instead.

Will

#5 lore raw

PATCH 1/1 ARM: fix perf build with uclibc toolchains

Quoted 43 lines · On Wednesday 10 August 2011 14:26:48 Will Deacon wrote:
Quoted 33 lines · Florian Fainelli
Quoted 32 lines · On Wednesday 10 August 2011 12:21:55 Will Deacon wrote:
Quoted 30 lines · Will Deacon
Quoted 22 lines · Florian Fainelli

libio.h is not provided by uClibc, in order to be able to test the definition of __UCLIBC__ we need to include stdlib.h, which also includes stddef.h, providing the definition of 'NULL'.

---

(quoted diff) +0 -0

b/tools/perf/arch/arm/util/dwarf-regs.c index fff6450..e8d5c55 100644 --- a/tools/perf/arch/arm/util/dwarf-regs.c +++ b/tools/perf/arch/arm/util/dwarf-regs.c

tools/perf/arch/arm/util/dwarf-regs.c +3 -0
@@ -8,7 +8,10 @@
 
  * published by the Free Software Foundation.
  */
 
+#include <stdlib.h>
+#ifndef __UCLIBC__
 
 #include <libio.h>
 
+#endif
Quoted 3 lines

#include <dwarf-regs.h>

struct pt_regs_dwarfnum {

Nice to see somebody trying to get this going with uclinux! I'll give this a quick compile-check on my boards and then I'll include it in my perf-fixes branch for 3.1.

Quoted 8 lines
Quoted 3 lines

Seems happy enough on my MMU boards. Since you're using this on noMMU platforms, does that mean that you can build a static perf binary out of the box or do you need further patches for this?

uClibc is not only for noMMU boards, I just built an uclibc toolchain for arm targetting realview and run-tested this with qemu. This was the only patch required to cross-compile perf for me. I also tested this with eglibc.

Quoted 8 lines

Ok, great. Cross-compiling perf usually just causes endless pain for me.

Quoted 2 lines

By the way, perf top reports no even being generated for realview under qemu, is that normal?

My guess is that qemu isn't emulating the cycle counter, which is required to generate interrupts for use by perf. You could try disabling HW_PERF_EVENTS which will force perf to fall back to a CPU tick instead.

That did it, thanks a lot Will.
--
Florian