mirror of https://github.com/hak5/openwrt.git
oprofile: update to 1.1.0-rc2 and make it work with musl
This brings oprifle to version 1.1.0-rc2 and adds some fixes for musl. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> SVN-Revision: 46505lede-17.01
parent
ac96a1665a
commit
53647060ab
|
@ -8,12 +8,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=oprofile
|
||||
PKG_VERSION:=0.9.9
|
||||
PKG_VERSION:=1.1.0rc2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=@SF/oprofile/
|
||||
PKG_MD5SUM:=00aec1287da2dfffda17a9b1c0a01868
|
||||
PKG_MD5SUM:=ebc27a8478068cb986efd295cc4ac877
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
|
||||
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
--- 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);
|
|
@ -1,11 +0,0 @@
|
|||
--- a/utils/opcontrol
|
||||
+++ b/utils/opcontrol
|
||||
@@ -249,7 +249,7 @@ load_module_26()
|
||||
{
|
||||
grep oprofilefs /proc/filesystems >/dev/null
|
||||
if test "$?" -ne 0; then
|
||||
- modprobe oprofile
|
||||
+ insmod oprofile
|
||||
if test "$?" != "0"; then
|
||||
# couldn't load the module
|
||||
return
|
|
@ -1,30 +0,0 @@
|
|||
--- a/libop/op_cpu_type.c
|
||||
+++ b/libop/op_cpu_type.c
|
||||
@@ -250,6 +250,7 @@ static void release_at_hw_platform(void)
|
||||
}
|
||||
}
|
||||
|
||||
+#ifdef PPC64
|
||||
static op_cpu _try_ppc64_arch_generic_cpu(void)
|
||||
{
|
||||
const char * platform, * base_platform;
|
||||
@@ -312,6 +313,7 @@ static op_cpu _get_ppc64_cpu_type(void)
|
||||
cpu_type = op_get_cpu_number(cpu_type_str);
|
||||
return cpu_type;
|
||||
}
|
||||
+#endif
|
||||
|
||||
static op_cpu _get_arm_cpu_type(void)
|
||||
{
|
||||
@@ -592,9 +594,11 @@ static op_cpu __get_cpu_type_alt_method(
|
||||
fnmatch("i?86", uname_info.machine, 0) == 0) {
|
||||
return _get_x86_64_cpu_type();
|
||||
}
|
||||
+#ifdef PPC64
|
||||
if (strncmp(uname_info.machine, "ppc64", 5) == 0) {
|
||||
return _get_ppc64_cpu_type();
|
||||
}
|
||||
+#endif
|
||||
if (strncmp(uname_info.machine, "arm", 3) == 0) {
|
||||
return _get_arm_cpu_type();
|
||||
}
|
Loading…
Reference in New Issue