oprofile: make opcontrol compatible with busybox 'kill'
authorJohn Lee <john_lee@openmoko.org>
Fri, 23 May 2008 09:10:35 +0000 (09:10 +0000)
committerJohn Lee <john_lee@openmoko.org>
Fri, 23 May 2008 09:10:35 +0000 (09:10 +0000)
packages/oprofile/oprofile/opcontrol-busybox-compat.patch [new file with mode: 0644]
packages/oprofile/oprofile_0.9.3.bb

diff --git a/packages/oprofile/oprofile/opcontrol-busybox-compat.patch b/packages/oprofile/oprofile/opcontrol-busybox-compat.patch
new file mode 100644 (file)
index 0000000..d394e01
--- /dev/null
@@ -0,0 +1,49 @@
+Index: oprofile-0.9.3/utils/opcontrol
+===================================================================
+--- oprofile-0.9.3.orig/utils/opcontrol        2008-05-23 16:54:21.000000000 +0800
++++ oprofile-0.9.3/utils/opcontrol     2008-05-23 00:47:38.000000000 +0800
+@@ -908,7 +908,7 @@
+               return
+       fi
+-      kill -s 0 `cat $LOCK_FILE` 2>/dev/null
++      kill -0 `cat $LOCK_FILE` 2>/dev/null
+       if test "$?" -ne 0; then
+               echo "Detected stale lock file. Removing." >&2
+               rm -f "$LOCK_FILE"
+@@ -919,7 +919,7 @@
+               echo "Stopping profiling."
+               echo 0 >/dev/oprofile/enable
+       fi
+-      kill -s USR2 `cat $LOCK_FILE` 2>/dev/null
++      kill -usr2 `cat $LOCK_FILE` 2>/dev/null
+ }
+@@ -932,7 +932,7 @@
+               return
+       fi
+-      kill -s 0 `cat $LOCK_FILE` 2>/dev/null
++      kill -0 `cat $LOCK_FILE` 2>/dev/null
+       if test "$?" -ne 0; then
+               echo "Detected stale lock file. Removing." >&2
+               rm -f "$LOCK_FILE"
+@@ -1274,7 +1274,7 @@
+ {
+  
+       if test -f "$LOCK_FILE"; then
+-              kill -s 0 `cat $LOCK_FILE` 2>/dev/null
++              kill -0 `cat $LOCK_FILE` 2>/dev/null
+               if test "$?" -eq 0; then
+                       return;
+               else
+@@ -1341,7 +1341,7 @@
+       if test "$KERNEL_SUPPORT" = "yes"; then
+               echo 1 >$MOUNT/enable
+       fi
+-      kill -s USR1 `cat $LOCK_FILE` 2>/dev/null
++      kill -USR1 `cat $LOCK_FILE` 2>/dev/null
+       echo "Profiler running."
+ }
index d758b97..977907e 100644 (file)
@@ -1,11 +1,15 @@
-SECTION = "devel"
 DESCRIPTION = "OProfile is a system-wide profiler for Linux systems, capable \
 of profiling all running code at low overhead."
+SECTION = "devel"
 LICENSE = "GPL"
 DEPENDS = "popt binutils"
+PR = "r1"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/oprofile/oprofile-${PV}.tar.gz \
-          file://acinclude.m4"
+           file://acinclude.m4 \
+           file://opcontrol-busybox-compat.patch;patch=1 \
+           "
+
 S = "${WORKDIR}/oprofile-${PV}"
 
 inherit autotools
@@ -14,12 +18,12 @@ inherit autotools
 # Should add the oprofile kernel modules, for those with 2.4
 # kernels, as a seperate .oe file.
 EXTRA_OECONF = "--with-kernel-support \
-               --without-x \
-               --disable-werror "
+                --without-x \
+                --disable-werror "
 
 do_configure () {
-       cp ${WORKDIR}/acinclude.m4 ${S}/
-       autotools_do_configure
+        cp ${WORKDIR}/acinclude.m4 ${S}/
+        autotools_do_configure
 }
 # Available config options
 #  --enable-abi                 enable abi portability code (default is disabled)