From 651f1f520b769e9bc7379f49a37fc821f2ac6c43 Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Fri, 12 Mar 2010 11:58:15 +0200 Subject: main/oprofile: new aport A system level profiler for Linux. --- main/oprofile/APKBUILD | 43 +++++++++++++++++++++++++++++++++++ main/oprofile/oprofile-pic.patch | 49 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 main/oprofile/APKBUILD create mode 100644 main/oprofile/oprofile-pic.patch diff --git a/main/oprofile/APKBUILD b/main/oprofile/APKBUILD new file mode 100644 index 000000000..9c9e4f8cf --- /dev/null +++ b/main/oprofile/APKBUILD @@ -0,0 +1,43 @@ +# Contributor: Timo Teras +# Maintainer: Timo Teras +pkgname=oprofile +pkgver=0.9.6 +pkgrel=0 +pkgdesc="A System Profiler for Linux" +url="http://oprofile.sourceforge.net/" +license="GPL" +depends="" +makedepends="libiconv-dev gettext" +install= +subpackages="$pkgname-doc" +source="http://prdownloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz + oprofile-pic.patch" + +_builddir="$srcdir/$pkgname-$pkgver" + +prepare() { + cd "$_builddir" + for i in ../*.patch; do + msg "Apply $i" + patch -p1 < $i || return 1 + done +} + +build() { + cd "$srcdir/$pkgname-$pkgver" + + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --with-kernel-support \ + --with-pic + make -j1 || return 1 + make -j1 DESTDIR="$pkgdir" install + + #install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/knockd + #install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/knockd +} + +md5sums="4e407093ac06200185d5a5e6437d7242 oprofile-0.9.6.tar.gz +e7b80603bc86f120480c3d411d532ab8 oprofile-pic.patch" diff --git a/main/oprofile/oprofile-pic.patch b/main/oprofile/oprofile-pic.patch new file mode 100644 index 000000000..8867ff243 --- /dev/null +++ b/main/oprofile/oprofile-pic.patch @@ -0,0 +1,49 @@ +--- oprofile-0.9.6/libop/op_hw_specific.h ++++ oprofile-0.9.6.new/libop/op_hw_specific.h +@@ -20,7 +20,8 @@ + char v[12]; + } v; + unsigned eax; +- asm("cpuid" : "=a" (eax), "=b" (v.b), "=c" (v.c), "=d" (v.d) : "0" (0)); ++ asm("push %%ebx ; cpuid ; movl %%ebx, %%esi ; pop %%ebx" ++ : "=a" (eax), "=S" (v.b), "=c" (v.c), "=d" (v.d) : "0" (0)); + return !strncmp(v.v, vnd, 12); + } + +@@ -46,7 +47,7 @@ + + if (!cpuid_vendor("GenuineIntel")) + return; +- asm("cpuid" : "=a" (v.eax) : "0" (1) : "ecx","ebx","edx"); ++ asm("push %%ebx; cpuid; pop %%ebx" : "=a" (v.eax) : "0" (1) : "ecx","edx"); + model = (v.ext_model << 4) + v.model; + if (v.family != 6 || model != 26 || v.stepping > 4) + return; +@@ -57,7 +58,8 @@ + { + if (cpu_type == CPU_ARCH_PERFMON) { + unsigned ebx, eax; +- asm("cpuid" : "=a" (eax), "=b" (ebx) : "0" (0xa) : "ecx","edx"); ++ asm("push %%ebx; cpuid; movl %%ebx, %%edx; pop %%ebx" ++ : "=a" (eax), "=d" (ebx) : "0" (0xa) : "ecx"); + workaround_nehalem_aaj79(&ebx); + return ebx & num_to_mask(eax >> 24); + } +@@ -68,7 +70,7 @@ + { + if (cpu_type == CPU_ARCH_PERFMON) { + unsigned v; +- asm("cpuid" : "=a" (v) : "0" (0xa) : "ebx","ecx","edx"); ++ asm("push %%ebx; cpuid; pop %%ebx" : "=a" (v) : "0" (0xa) : "ecx","edx"); + return (v >> 8) & 0xff; + } + return -1; +@@ -77,7 +79,7 @@ + static inline unsigned arch_get_counter_mask(void) + { + unsigned v; +- asm("cpuid" : "=a" (v) : "0" (0xa) : "ebx","ecx","edx"); ++ asm("push %%ebx; cpuid; pop %%ebx" : "=a" (v) : "0" (0xa) : "ecx","edx"); + return num_to_mask((v >> 8) & 0xff); + } + -- cgit v1.2.3