Skip to contentSkip to conversation

package/oprofile: bump version to 1.1.0

PATCH New Bernd Kuhls 3 participants 4 messages Jan 31, 2016 – Feb 2, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/oprofile: bump version to 1.1.0

Removed patch applied upstream:
http://sourceforge.net/p/oprofile/oprofile/ci/f357d40c9f64f3ea2dccf5f9abdff84b2ac62e6f/

---
 .../0001-Include-time.h-for-nanosleep.patch        | 44 ----------------------
 package/oprofile/oprofile.hash                     |  5 ++-
 package/oprofile/oprofile.mk                       |  2 +-
 3 files changed, 4 insertions(+), 47 deletions(-)
 delete mode 100644 package/oprofile/0001-Include-time.h-for-nanosleep.patch
package/oprofile/0001-Include-time.h-for-nanosleep.patch deleted +0 -44
deleted file mode 100644
index d4a9ca2..0000000
@@ -1,44 +0,0 @@
-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
-
package/oprofile/oprofile.hash +3 -2
index b6ab3ba..cc15ed1 100644
@@ -1,2 +1,3 @@
-# Locally computed:
-sha256  847110b4ecdcf8c8353cd38f94c1b704aad4bfcd9453e38b88d112cfb7e3c45a  oprofile-1.0.0.tar.gz
+# From http://sourceforge.net/projects/oprofile/files/oprofile/oprofile-1.1.0/
+sha1	38c0d8812fe605f6ddd1cd183a482aa7605c0e81	oprofile-1.1.0.tar.gz
+md5	248c4c069f9476f427fa7195563f9867		oprofile-1.1.0.tar.gz
package/oprofile/oprofile.mk +1 -1
index f27e06e..d91ddab 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-OPROFILE_VERSION = 1.0.0
+OPROFILE_VERSION = 1.1.0
 OPROFILE_SITE = http://downloads.sourceforge.net/project/oprofile/oprofile/oprofile-$(OPROFILE_VERSION)
 OPROFILE_LICENSE = GPLv2+
 OPROFILE_LICENSE_FILES = COPYING
Signature · 1 line
2.7.0
#1 lore raw

PATCH 2/2 package/oprofile: fux musl build

The build error has not yet been found by the autobuilders:

operf.cpp: In function ?int __delete_old_previous_sample_data(const char*, const stat*, int, FTW*)?:
operf.cpp:862:10: error: ?FTW_STOP? was not declared in this scope

   return FTW_STOP;
          ^
operf.cpp:864:10: error: ?FTW_CONTINUE? was not declared in this scope
   return FTW_CONTINUE;
          ^
operf.cpp: In function ?void convert_sample_data()?:
operf.cpp:899:41: error: ?FTW_ACTIONRETVAL? was not declared in this scope
                 int flags = FTW_DEPTH | FTW_ACTIONRETVAL;
---
 package/oprofile/0001-musl.patch | 53 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 package/oprofile/0001-musl.patch
package/oprofile/0001-musl.patch new file +53 -0
new file mode 100644
index 0000000..95ae200
@@ -0,0 +1,53 @@
+Fix musl build
+
+Downloaded from:
+https://github.com/openwrt-mirror/openwrt/blob/f22d5e25660106a48727c7aa5d1a73e4171a7987/package/devel/oprofile/patches/100-musl.patch
+after I found a hint for the patch here:
+http://patchwork.openembedded.org/patch/112675/
+
+Because openwrt removed the oprofile package from their repo last week
+https://github.com/openwrt-mirror/openwrt/commit/aaf46a8524e138e1673a398e8d2dd9357405b313#diff-fe14456f94abf436d997e2c01c10f3bd
+I decided to put this patch into the buildroot repo instead of adding
+_PATCH to oprofile.mk
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+
+--- a/pe_profiling/operf.cpp
++++ b/pe_profiling/operf.cpp
+@@ -857,11 +857,14 @@ static int __delete_old_previous_sample_
+                                 int tflag  __attribute__((unused)),
+                                 struct FTW *ftwbuf __attribute__((unused)))
+ {
++	int err;
++
+ 	if (remove(fpath)) {
++		err = errno;
+ 		perror("sample data removal error");
+-		return FTW_STOP;
++		return err;
+ 	} else {
+-		return FTW_CONTINUE;
++		return 0;
+ 	}
+ }
+ 
+@@ -896,7 +899,7 @@ static void convert_sample_data(void)
+ 		return;
+ 
+ 	if (!operf_options::append) {
+-                int flags = FTW_DEPTH | FTW_ACTIONRETVAL;
++                int flags = FTW_DEPTH;
+ 		errno = 0;
+ 		if (nftw(previous_sampledir.c_str(), __delete_old_previous_sample_data, 32, flags) !=0 &&
+ 				errno != ENOENT) {
+--- a/libop/op_events.c
++++ b/libop/op_events.c
+@@ -83,7 +83,7 @@ static int parse_hex(char const * str)
+ static u64 parse_long_hex(char const * str)
+ {
+ 	u64 value;
+-	if (sscanf(str, "%Lx", &value) != 1)
++	if (sscanf(str, "0x%llx", &value) != 1)
+ 		parse_error("expected long hexadecimal value");
+ 
+ 	fflush(stderr);
Signature · 1 line
2.7.0
#2 lore raw

PATCH 2/2 package/oprofile: fux musl build

Quoted 26 lines · Bernd Kuhls

The build error has not yet been found by the autobuilders:

operf.cpp: In function ?int __delete_old_previous_sample_data(const char*, const stat*, int, FTW*)?:
operf.cpp:862:10: error: ?FTW_STOP? was not declared in this scope

   return FTW_STOP;
          ^
operf.cpp:864:10: error: ?FTW_CONTINUE? was not declared in this scope
   return FTW_CONTINUE;
          ^
operf.cpp: In function ?void convert_sample_data()?:
operf.cpp:899:41: error: ?FTW_ACTIONRETVAL? was not declared in this scope
                 int flags = FTW_DEPTH | FTW_ACTIONRETVAL;
---
 package/oprofile/0001-musl.patch | 53 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 package/oprofile/0001-musl.patch
package/oprofile/0001-musl.patch new file +1 -0
new file mode 100644
index 0000000..95ae200
@@ -0,0 +1,53 @@
+Fix musl build

package/oprofile/0001-musl.patch line 11

Quoted 10 lines
package/oprofile/0001-musl.patch new file +10 -0
+
+Downloaded from:
+https://github.com/openwrt-mirror/openwrt/blob/f22d5e25660106a48727c7aa5d1a73e4171a7987/package/devel/oprofile/patches/100-musl.patch
+after I found a hint for the patch here:
+http://patchwork.openembedded.org/patch/112675/
+
+Because openwrt removed the oprofile package from their repo last week
+https://github.com/openwrt-mirror/openwrt/commit/aaf46a8524e138e1673a398e8d2dd9357405b313#diff-fe14456f94abf436d997e2c01c10f3bd
+I decided to put this patch into the buildroot repo instead of adding
+_PATCH to oprofile.mk

Commit message could be a lot better:

Remove non-Posix use of FTW_ACTIONRETVAL

The musl implementation of nftw doesn't support the glibc extension FTW_ACTIONRETVAL. Since none of the features of FTW_ACTIONRETVAL are used here, just use the normal nftw return value.

Quoted 29 lines
package/oprofile/0001-musl.patch new file +29 -0
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+
+--- a/pe_profiling/operf.cpp
++++ b/pe_profiling/operf.cpp
+@@ -857,11 +857,14 @@ static int __delete_old_previous_sample_
+                                 int tflag  __attribute__((unused)),
+                                 struct FTW *ftwbuf __attribute__((unused)))
+ {
++	int err;
++
+ 	if (remove(fpath)) {
++		err = errno;
+ 		perror("sample data removal error");
+-		return FTW_STOP;
++		return err;
+ 	} else {
+-		return FTW_CONTINUE;
++		return 0;
+ 	}
+ }
+ 
+@@ -896,7 +899,7 @@ static void convert_sample_data(void)
+ 		return;
+ 
+ 	if (!operf_options::append) {
+-                int flags = FTW_DEPTH | FTW_ACTIONRETVAL;
++                int flags = FTW_DEPTH;
+ 		errno = 0;

package/oprofile/0001-musl.patch line 50

Quoted 10 lines
package/oprofile/0001-musl.patch new file +10 -0
+ 		if (nftw(previous_sampledir.c_str(), __delete_old_previous_sample_data, 32, flags) !=0 &&
+ 				errno != ENOENT) {
+--- a/libop/op_events.c
++++ b/libop/op_events.c
+@@ -83,7 +83,7 @@ static int parse_hex(char const * str)
+ static u64 parse_long_hex(char const * str)
+ {
+ 	u64 value;
+-	if (sscanf(str, "%Lx", &value) != 1)
++	if (sscanf(str, "0x%llx", &value) != 1)

Why is this change needed? musl supports the standard %Lx specifier, no?

Regards,
Arnout

Quoted 4 lines
package/oprofile/0001-musl.patch new file +3 -0
+ 		parse_error("expected long hexadecimal value");
+ 
+ 	fflush(stderr);
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#3 lore raw

PATCH 1/2 package/oprofile: bump version to 1.1.0

In reply to Bernd Kuhls

Dear Bernd Kuhls,

Quoted 10 lines · Bernd Kuhls

Removed patch applied upstream:
http://sourceforge.net/p/oprofile/oprofile/ci/f357d40c9f64f3ea2dccf5f9abdff84b2ac62e6f/

---
 .../0001-Include-time.h-for-nanosleep.patch        | 44 ----------------------
 package/oprofile/oprofile.hash                     |  5 ++-
 package/oprofile/oprofile.mk                       |  2 +-
 3 files changed, 4 insertions(+), 47 deletions(-)
 delete mode 100644 package/oprofile/0001-Include-time.h-for-nanosleep.patch

Applied, thanks.

Thomas

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