Skip to contentSkip to conversation

linux-imx: Add a patch to fix perf compilation issue.

PATCH Superseded Noor, Ahsan 4 participants 6 messages Dec 18, 2012 – Dec 19, 2012 Arm i.MX and Layerscape

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-imx: Add a patch to fix perf compilation issue.

From: Noor Ahsan <[email protected]>

* Perf build fails with GNU C library version 2.16. It give undefined reference for RUSAGE_SELF and storage size of 'ru'
in builtin-sched.c.
* Fixed issue by adding time.h and resource.h headerfiles in builtin-sched.c.

---
 .../linux/linux-imx/fix_of_getrusage.patch         |   11 +++++++++++
 recipes-kernel/linux/linux-imx_3.0.35.bb           |    3 +++
 2 files changed, 14 insertions(+)
recipes-kernel/linux/linux-imx/fix_of_getrusage.patch new file +11 -0
new file mode 100644
index 0000000..4d3faa8
@@ -0,0 +1,11 @@
+--- git/tools/perf/builtin-sched_orig.c	2012-12-11 15:18:58.000000000 +0500
++++ git/tools/perf/builtin-sched.c	2012-12-11 15:22:43.302782244 +0500
+@@ -14,6 +14,8 @@
+ #include "util/debug.h"
+ 
+ #include <sys/prctl.h>
++#include <sys/time.h>
++#include <sys/resource.h>
+ 
+ #include <semaphore.h>
+ #include <pthread.h>
recipes-kernel/linux/linux-imx_3.0.35.bb +3 -0
index 4aa5f08..a3235e8 100644
@@ -13,3 +13,6 @@ LOCALVERSION = "-12.09.01+yocto"
 
 # iMX6Q SabreLITE changes done by Boundary Devices
 SRC_URI_append_imx6qsabrelite = " file://sync-boundary-changes.patch"
+
+SRC_URI += "file://fix_of_getrusage.patch \
+           "
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 8 lines · Ahsan

From: Noor Ahsan <[email protected]>

* Perf build fails with GNU C library version 2.16. It give undefined reference for RUSAGE_SELF and storage size of 'ru' in builtin-sched.c.
* Fixed issue by adding time.h and resource.h headerfiles in builtin-sched.c.

I just finished a build with linux-imx + eglibc 2.16. No error.

Could this be generated by something else?

ag

#2 lore raw
Quoted 11 lines · Andrei Gherzan
Quoted 8 lines · Ahsan

From: Noor Ahsan <[email protected]>

* Perf build fails with GNU C library version 2.16. It give undefined reference for RUSAGE_SELF and storage size of 'ru' in builtin-sched.c.
* Fixed issue by adding time.h and resource.h headerfiles in builtin-sched.c.

Quoted 3 lines

I just finished a build with linux-imx + eglibc 2.16. No error.

Could this be generated by something else?

Same here. I am curious why you're getting different results than us.

Please check the build log so we confirm the GCC params being passed ...

--
Otavio Salvador O.S. Systems
E-mail: [email protected] http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br

#3 lore raw
In reply to Noor, Ahsan

recipes-kernel/linux/linux-imx_3.0.35.bb LOCALVERSION = "-12.09.01+yocto" · line 18

Quoted 11 lines · Ahsan
recipes-kernel/linux/linux-imx_3.0.35.bb +3 -0
index 4aa5f08..a3235e8 100644
@@ -13,3 +13,6 @@ LOCALVERSION = "-12.09.01+yocto"
 
  # iMX6Q SabreLITE changes done by Boundary Devices
  SRC_URI_append_imx6qsabrelite = " file://sync-boundary-changes.patch"
+
+SRC_URI += "file://fix_of_getrusage.patch \
+           "

It's missing a BUMP here.

Daiane

#4 lore raw
In reply to Noor, Ahsan
Quoted 8 lines · Ahsan

From: Noor Ahsan <[email protected]>

* Perf build fails with GNU C library version 2.16. It give undefined reference for RUSAGE_SELF and storage size of 'ru'
in builtin-sched.c.
* Fixed issue by adding time.h and resource.h headerfiles in builtin-sched.c.

Checking the kernel sources it seems the only required header is resource.h, as stated in:

commit 7b78f13603c6fcb64e020a0bbe31a651ea2b657b

Author: Markus Trippelsdorf <[email protected]>
Date:   Wed Apr 4 10:45:27 2012 +0200

perf tools: Fix getrusage() related build failure on glibc trunk

On a system running glibc trunk perf doesn't build:

CC builtin-sched.o
builtin-sched.c: In function ‘get_cpu_usage_nsec_parent’:
builtin-sched.c:399:16: error: storage
[...]

Fix it by including sys/resource.h.

Please use this patch, add a Upstream-Status header in the patch and also bump PR.

Regards,

--
Otavio Salvador O.S. Systems
E-mail: [email protected] http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br

#5 lore raw

Hello,

Thanks for your input. I'll send another patch. In order to reproduce it you need to build perf not linux-imx.

Regards,
Noor

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Otavio Salvador
Sent: Tuesday, December 18, 2012 9:09 PM
To: Ahsan, Noor
Cc: [email protected]
Subject: Re: [meta-freescale] [meta-fsl-arm][PATCH] linux-imx: Add a patch to fix perf compilation issue.

Quoted 8 lines · Ahsan

From: Noor Ahsan <[email protected]>

* Perf build fails with GNU C library version 2.16. It give undefined reference for RUSAGE_SELF and storage size of 'ru'
in builtin-sched.c.
* Fixed issue by adding time.h and resource.h headerfiles in builtin-sched.c.

Checking the kernel sources it seems the only required header is resource.h, as stated in:

commit 7b78f13603c6fcb64e020a0bbe31a651ea2b657b

Author: Markus Trippelsdorf <[email protected]>
Date:   Wed Apr 4 10:45:27 2012 +0200

perf tools: Fix getrusage() related build failure on glibc trunk

On a system running glibc trunk perf doesn't build:

CC builtin-sched.o
builtin-sched.c: In function 'get_cpu_usage_nsec_parent':
builtin-sched.c:399:16: error: storage
[...]

Fix it by including sys/resource.h.

Please use this patch, add a Upstream-Status header in the patch and also bump PR.

Regards,

--
Otavio Salvador O.S. Systems
E-mail: [email protected] http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br