Skip to contentSkip to conversation

oprofile: small set of fixes

PATCH New Thomas Petazzoni 2 participants 6 messages Dec 29, 2014 – Dec 30, 2014

lore
Share & tools
lore
#0 lore raw

cover oprofile: small set of fixes

Hello,

Here is a small set of fixes/improvements to the oprofile package: fix autobuilder issue appearing since the 1.0.0 bump, remove no longer needed autoreconf, and a minor cleanup.

Thomas

Thomas Petazzoni (3):
oprofile: fix nanosleep() issue on non-threaded toolchains
oprofile: autoreconf is no longer needed
oprofile: cleanup the style of the OPROFILE_BINARIES definition

 .../0001-Include-time.h-for-nanosleep.patch        | 44 ++++++++++++++++++++++
 package/oprofile/oprofile.mk                       | 17 +++------
 2 files changed, 50 insertions(+), 11 deletions(-)
 create mode 100644 package/oprofile/0001-Include-time.h-for-nanosleep.patch
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/3 oprofile: fix nanosleep() issue on non-threaded toolchains

This commit adds a patch to OProfile that ensures <time.h> is included whenever nanosleep() is used, which fixes a build failure on uClibc toolchains with no thread support.

Fixes:

http://autobuild.buildroot.org/results/d28/d28447c1241ce3dd237710e388d799139d7d613d/

---
 .../0001-Include-time.h-for-nanosleep.patch        | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 package/oprofile/0001-Include-time.h-for-nanosleep.patch
package/oprofile/0001-Include-time.h-for-nanosleep.patch new file +44 -0
new file mode 100644
index 0000000..d4a9ca2
@@ -0,0 +1,44 @@
+From c5b93c33a81d7c52dc6089387e415f2d653f758f Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Mon, 29 Dec 2014 11:43:51 +0100
+Subject: [PATCH] Include <time.h> for nanosleep()
+
+The nanosleep() function prototype is in <time.h>, so this header file
+should be included whenever nanosleep() is used. Not including it
+causes some issues when building OProfile against a non-thread capable
+version of the uClibc C library, probably because in such situation,
+<time.h> does not get included by another header.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ pe_counting/ocount.cpp | 1 +
+ pe_profiling/operf.cpp | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/pe_counting/ocount.cpp b/pe_counting/ocount.cpp
+index 07dfd0c..fba29eb 100644
+--- a/pe_counting/ocount.cpp
++++ b/pe_counting/ocount.cpp
+@@ -28,6 +28,7 @@
+ #include <getopt.h>
+ #include <sys/time.h>
+ #include <math.h>
++#include <time.h>
+ 
+ #include "op_pe_utils.h"
+ #include "ocount_counter.h"
+diff --git a/pe_profiling/operf.cpp b/pe_profiling/operf.cpp
+index 04a25d9..4238754 100644
+--- a/pe_profiling/operf.cpp
++++ b/pe_profiling/operf.cpp
+@@ -33,6 +33,7 @@
+ #include <sys/wait.h>
+ #include <ftw.h>
+ #include <getopt.h>
++#include <time.h>
+ #include <iostream>
+ #include "operf_utils.h"
+ #include "op_pe_utils.h"
+-- 
+2.1.0
+
Signature · 1 line
2.1.0
#2 lore raw

PATCH 1/3 oprofile: fix nanosleep() issue on non-threaded toolchains

Hello,

Quoted 8 lines · Thomas Petazzoni
package/oprofile/0001-Include-time.h-for-nanosleep.patch new file +2 -0
new file mode 100644
index 0000000..d4a9ca2
@@ -0,0 +1,44 @@
+From c5b93c33a81d7c52dc6089387e415f2d653f758f Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>

package/oprofile/0001-Include-time.h-for-nanosleep.patch line 12

Quoted 10 lines
package/oprofile/0001-Include-time.h-for-nanosleep.patch new file +10 -0
+Date: Mon, 29 Dec 2014 11:43:51 +0100
+Subject: [PATCH] Include <time.h> for nanosleep()
+
+The nanosleep() function prototype is in <time.h>, so this header file
+should be included whenever nanosleep() is used. Not including it
+causes some issues when building OProfile against a non-thread capable
+version of the uClibc C library, probably because in such situation,
+<time.h> does not get included by another header.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>

Patch sent upstream at https://sourceforge.net/p/oprofile/bugs/277/.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 2/3 oprofile: autoreconf is no longer needed

In reply to Thomas Petazzoni

OPROFILE_AUTORECONF = YES was added in commit 99fc6299dbceaf6d58be2fb516a346451968a704 ("oprofile 0.9.8: fix compilation on powerpc") together with a patch touching configure.ac. However, since then, OProfile was bumped to 0.9.9 and then 1.0.0, and through those bumps, all patches touching configure.ac and .m4 files have been removed since they have been merged upstream. AUTORECONF = YES is therefore no longer necessary, and an OProfile build was successfully tested with autoreconfiguring the package.

We can also remove the OPROFILE_CREATE_FILES post-patch hook, which was only needed to create files required by the autoreconf process.

---
 package/oprofile/oprofile.mk | 7 -------
 1 file changed, 7 deletions(-)
package/oprofile/oprofile.mk +0 -7
index d40c8be..0c884b9 100644
@@ -12,7 +12,6 @@ OPROFILE_CONF_OPTS = \
 	--disable-account-check \
 	--enable-gui=no \
 	--with-kernel=$(STAGING_DIR)/usr
-OPROFILE_AUTORECONF = YES
 OPROFILE_BINARIES = utils/ophelp pp/opannotate pp/oparchive pp/opgprof
 OPROFILE_BINARIES += pp/opreport opjitconv/opjitconv
 OPROFILE_BINARIES += utils/op-check-perfevents libabi/opimport
@@ -45,12 +44,6 @@ ifeq ($(BR2_PACKAGE_LIBPFM4),y)
 OPROFILE_DEPENDENCIES += libpfm4
 endif
 
-define OPROFILE_CREATE_FILES
-	touch $(@D)/NEWS $(@D)/AUTHORS $(@D)/ChangeLog
-endef
-
-OPROFILE_POST_PATCH_HOOKS += OPROFILE_CREATE_FILES
-
 define OPROFILE_INSTALL_TARGET_CMDS
 	$(INSTALL) -d -m 755 $(TARGET_DIR)/usr/bin
 	$(INSTALL) -d -m 755 $(TARGET_DIR)/usr/share/oprofile
Signature · 1 line
2.1.0
#4 lore raw

PATCH 3/3 oprofile: cleanup the style of the OPROFILE_BINARIES definition

In reply to Thomas Petazzoni

There is no need to repeat OPROFILE_BINARIES += many times to add more values to the variable. Just define it once with all the values, as we do everywhere else in Buildroot.

---
 package/oprofile/oprofile.mk | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
package/oprofile/oprofile.mk +6 -4
index 0c884b9..1322d9d 100644
@@ -12,10 +12,12 @@ OPROFILE_CONF_OPTS = \
 	--disable-account-check \
 	--enable-gui=no \
 	--with-kernel=$(STAGING_DIR)/usr
-OPROFILE_BINARIES = utils/ophelp pp/opannotate pp/oparchive pp/opgprof
-OPROFILE_BINARIES += pp/opreport opjitconv/opjitconv
-OPROFILE_BINARIES += utils/op-check-perfevents libabi/opimport
-OPROFILE_BINARIES += pe_counting/ocount
+
+OPROFILE_BINARIES = \
+	utils/ophelp pp/opannotate pp/oparchive pp/opgprof \
+	pp/opreport opjitconv/opjitconv \
+	utils/op-check-perfevents libabi/opimport \
+	pe_counting/ocount
 
 # No perf_events support in kernel for avr32
 ifneq ($(BR2_avr32),y)
Signature · 1 line
2.1.0
#5 lore raw

cover oprofile: small set of fixes

In reply to Thomas Petazzoni
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello,
Here is a small set of fixes/improvements to the oprofile package: fix autobuilder issue appearing since the 1.0.0 bump, remove no longer needed autoreconf, and a minor cleanup.

Quoted 6 lines

Thomas

Thomas Petazzoni (3):
oprofile: fix nanosleep() issue on non-threaded toolchains
oprofile: autoreconf is no longer needed
oprofile: cleanup the style of the OPROFILE_BINARIES definition

Committed series, thanks.

Signature · 1 line
Bye, Peter Korsgaard