summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-09-26 16:30:04 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-09-26 16:30:04 -0400
commit3dfdbdcd346adbd10887bf1ba52b049832f13c24 (patch)
tree7bbdfac9eb5ae9238bb50dfb6a0a754c58297612
parent64fecdf1309d2320671d2e1d8cfb19e4cb8c69a7 (diff)
sorta-fix ~lukeshu/codeanalyst
It still doesn't work, but everything compiles against this kernel, and the custom version of oprofile builds.
-rwxr-xr-x~lukeshu/codeanalyst/PKGBUILD38
-rwxr-xr-x~lukeshu/codeanalyst/codeanalyst.install7
-rw-r--r--~lukeshu/codeanalyst/kernel3.4.patch72
3 files changed, 105 insertions, 12 deletions
diff --git a/~lukeshu/codeanalyst/PKGBUILD b/~lukeshu/codeanalyst/PKGBUILD
index 5cbab45dc..885e06f0e 100755
--- a/~lukeshu/codeanalyst/PKGBUILD
+++ b/~lukeshu/codeanalyst/PKGBUILD
@@ -5,14 +5,13 @@
# The docs claim that the fork is just for adding support for
# processors that aren't upstream yet (at the time, they are now that
# 0.9.7 is out). So, shouldn't we just link against 0.9.7? Well:
-# * AMD also added a bunch of CodeAnalyst-specific code. Also some of
-# the external.
+# * AMD also added a bunch of CodeAnalyst-specific code.
# * Several external variables/types have different names; the API is
# incompatible.
# * [extra]/oprofile-0.9.7-3 only includes about half of the headers.
pkgbase=CodeAnalyst
-pkgname=codeanalyst
+pkgname=(codeanalyst codeanalyst-cakm)
pkgver=3.3.18.0361
_pkgver="${pkgver//./_}"
pkgrel=4.1
@@ -20,20 +19,24 @@ pkgdesc="AMD performance profiler. Includes a fork of oprofile."
url="http://developer.amd.com/tools/${pkgbase}/"
arch=('i686' 'x86_64')
license=('GPL')
-depends=('gcc' 'sudo' 'qt>=4.1' 'oprofile' 'libdwarf')
+depends=('gcc' 'qt>=4.1' 'libdwarf')
makedepends=('linux-headers' 'elfutils' 'findutils' 'file')
-provides=('oprofile=0.9.6cvs')
-conflicts=('oprofile')
options=('!strip')
install=codeanalyst.install
source=("http://download2-developer.amd.com/amd/${pkgbase}/${pkgbase}${_pkgver}Public.tar.gz"
'gcc47.patch'
'skipSetup.patch'
+ 'kernel3.4.patch'
'codeanalyst.sudo'
'codeanalyst.desktop'
'codeanalyst.svg')
build() {
+ build_codeanalyst
+ build_codeanalyst-cakm
+}
+
+build_codeanalyst() {
cd "${srcdir}/${pkgbase}-${_pkgver}-Public"
patch -Np1 -i "${srcdir}/gcc47.patch"
patch -Np1 -i "${srcdir}/skipSetup.patch"
@@ -46,7 +49,18 @@ build() {
make
}
-package() {
+build_codeanalyst-cakm() {
+ cd "${srcdir}/${pkgbase}-${_pkgver}-Public"/src/cakm
+ cp -r kernel2.6.38 kernel3.4
+ cd kernel3.4
+ patch -Np1 -i "${srcdir}/kernel3.4.patch"
+ make
+}
+
+package_codeanalyst() {
+ provides=('oprofile=0.9.6cvs')
+ conflicts=('oprofile')
+
cd "${srcdir}/${pkgbase}-${_pkgver}-Public"
make DESTDIR="${pkgdir}" install
rm -f "${pkgdir}/usr/sbin/ca_user_manager" # either codeanalyst.install does this, or it is trivial
@@ -59,9 +73,19 @@ package() {
install -D -m644 codeanalyst.desktop "${pkgdir}/usr/share/applications/codeanalyst.desktop"
}
+package_codeanalyst-cakm() {
+ pkgdesc="CodeAnalyst kernel module, oprofile-ca.ko, a replacement for oprofile.ko"
+ depends=(codeanalyst)
+ provides=()
+
+ cd "${srcdir}/${pkgbase}-${_pkgver}-Public"/src/cakm/kernel3.4
+ install -D -m644 oprofile.ko "${pkgdir}/lib/modules/`uname -r`/kernel/arch/x86/oprofile/oprofile-ca.ko"
+}
+
md5sums=('f1e29bc7c7da259df228ce59281ee1d7'
'063d0fc9680641a92ce5e310ffe1c9c0'
'ce549e59c4a5916fd19e8d085e863627'
+ '3a5d820a43a0360d561bb0c4d67d9735'
'3cc8f64fe84c5a886d0172ee8d99f690'
'3a18d3f7fb01f199a8ed5ae2908c18e4'
'1822a4157b82904b82e72fc1e9bcbd42')
diff --git a/~lukeshu/codeanalyst/codeanalyst.install b/~lukeshu/codeanalyst/codeanalyst.install
index 8edb4adc2..6ed1ac841 100755
--- a/~lukeshu/codeanalyst/codeanalyst.install
+++ b/~lukeshu/codeanalyst/codeanalyst.install
@@ -1,5 +1,5 @@
post_install() {
- getent group amdca &>/dev/null || /usr/bin/groupadd amdca &>/dev/null
+ getent group amdca &>/dev/null || groupadd amdca &>/dev/null
echo " ==> To use CodeAnalyst as non-root, you must be in the 'amdca' group"
echo " ie: gpasswd -a USERNAME amdca"
@@ -24,9 +24,6 @@ post_install() {
}
post_remove() {
- if getent group amdca &>/dev/null; then
- groupdel amdca
- fi
-
+ getent group amdca &>/dev/null && groupdel amdca &>/dev/null
update-desktop-database -q
}
diff --git a/~lukeshu/codeanalyst/kernel3.4.patch b/~lukeshu/codeanalyst/kernel3.4.patch
new file mode 100644
index 000000000..589abc800
--- /dev/null
+++ b/~lukeshu/codeanalyst/kernel3.4.patch
@@ -0,0 +1,72 @@
+diff -ru kernel2.6.38/Makefile kernel3.4/Makefile
+--- kernel2.6.38/Makefile 2012-04-13 01:41:43.000000000 -0400
++++ kernel3.4/Makefile 2012-07-11 11:32:27.000000000 -0400
+@@ -1,6 +1,6 @@
+ TARGET = oprofile.ko
+
+-MDIR = $(if $(shell uname -m | grep x86_64),arch/x86/oprofile,arch/x86/oprofile)
++MDIR = arch/x86/oprofile
+
+ DRIVER_OBJS = oprof.o cpu_buffer.o buffer_sync.o \
+ event_buffer.o oprofile_files.o \
+@@ -16,7 +16,8 @@
+ CURRENT = $(shell uname -r)
+ ARCH = $(if $(shell uname -m | grep x86_64),64,32)
+ KERN_ARCH = $(if $(shell uname -m | grep x86_64),x86_64,i386)
+-KDIR = /lib/modules/$(CURRENT)/build
++SYS_KDIR = /lib/modules/$(CURRENT)/build
++KDIR = $(PWD)/../build
+ PWD = $(shell pwd)
+ DEST = /lib/modules/$(CURRENT)/kernel/$(MDIR)
+ USE_INTERNAL_ERRATA = $(if $(shell ls ../internal/errata.h 2> /dev/null),1,0)
+@@ -39,6 +40,8 @@
+ all: default
+
+ default:
++ rm -rf $(KDIR)
++ cp -r $(SYS_KDIR)/ $(KDIR)
+ make -C $(KDIR) SUBDIRS=$(PWD) CFLAGS_MODULE+="-DMODULE -DUSE_INTERNAL_ERRATA=$(USE_INTERNAL_ERRATA)" modules ARCH=$(KERN_ARCH)
+
+ install:
+@@ -52,13 +55,12 @@
+
+ uninstall:
+ @echo "... Restore original oprofile.ko."
+- @mv -v $(DEST)/$(TARGET).orig $(DEST)/$(TARGET)
++ @mv -v $(DEST)/$(TARGET).orig $(DEST)/$(TARGET)
+
+ clean:
+ rm -f *.o oprofile.ko .*.cmd .*.flags *.mod.c
+
+ prebuild:
+ cp $(TARGET) ../prebuilds/$(CURRENT)_$(ARCH).ko
+-
+
+--include $(KDIR)/Rules.make
++-include $(SYS_KDIR)/Rules.make
+Only in kernel3.4/: modules.order
+Only in kernel3.4/: Module.symvers
+diff -ru kernel2.6.38/nmi_int.c kernel3.4/nmi_int.c
+--- kernel2.6.38/nmi_int.c 2012-04-13 01:41:43.000000000 -0400
++++ kernel3.4/nmi_int.c 2012-07-11 11:32:27.000000000 -0400
+@@ -16,7 +16,6 @@
+ #include <linux/notifier.h>
+ #include <linux/smp.h>
+ #include "oprofile.h"
+-#include <linux/sysdev.h>
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)
+ #include <linux/syscore_ops.h>
+ #endif
+diff -ru kernel2.6.38/oprofilefs.c kernel3.4/oprofilefs.c
+--- kernel2.6.38/oprofilefs.c 2012-04-13 01:41:43.000000000 -0400
++++ kernel3.4/oprofilefs.c 2012-07-11 11:32:27.000000000 -0400
+@@ -244,7 +244,7 @@
+ return -ENOMEM;
+ root_inode->i_op = &simple_dir_inode_operations;
+ root_inode->i_fop = &simple_dir_operations;
+- root_dentry = d_alloc_root(root_inode);
++ root_dentry = d_make_root(root_inode);
+ if (!root_dentry) {
+ iput(root_inode);
+ return -ENOMEM;
+Only in kernel3.4/: .tmp_versions