- Obtain kernel source from the vault.
wget http://vault.centos.org/4.4/updates/SRPMS/kernel-2.6.9-42.0.2.EL.src.rpm
- Install kernel source.
rpm -ivh kernel-2.6.9-42.0.2.EL.src.rpm
- Install papi-3.5.0.
cd /root/PerfCtr
wget http://icl.cs.utk.edu/projects/papi/downloads/papi-3.5.0.tar.gz
tar -zxvf papi-3.5.0.tar.gz
- Patch the spec file. Notice the script-patching call after the zillion of patches.
[/usr/src/redhat/SPECS]# diff -u kernel-2.6.spec.orig kernel-2.6.spec
--- kernel-2.6.spec.orig 2009-04-21 10:27:52.000000000 -0300
+++ kernel-2.6.spec 2009-04-21 18:14:04.000000000 -0300
@@ -26,7 +26,7 @@
# that the kernel isn't the stock distribution kernel, for example by
# adding some text to the end of the version number.
#
-%define release 42.0.2.EL
+%define release 42.0.2.ELperfctr
%define sublevel 9
%define kversion 2.6.%{sublevel}
%define rpmversion 2.6.%{sublevel}
@@ -3240,7 +3240,7 @@
# but for -pre and -rc versions we need it since we only want to use
# the higher version when the final kernel is released.
perl -p -i -e "s/^SUBLEVEL.*/SUBLEVEL = %{sublevel}/" Makefile
-perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -prep/" Makefile
+perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -42.0.2.EL/" Makefile
# conditionally applied test patch for debugging convenience
%if %([ -s %{PATCH20000} ] && echo 1 || echo 0)
@@ -3249,6 +3249,8 @@
# END OF PATCH APPLICATIONS
+/root/PerfCtr/papi-3.5.0/src/perfctr-2.6.x/update-kernel
+
cp %{SOURCE10} Documentation/
mkdir configs
- Patch config files for PERFCTR.
cd /usr/src/redhat/SOURCES
for f in *.config; do cat ../SPECS/addfinal.configs >> $f; done
where addfinals.config
is
#
# Performance-monitoring counters support
#
CONFIG_PERFCTR=m
CONFIG_KPERFCTR=y
CONFIG_PERFCTR_DEBUG=y
CONFIG_PERFCTR_INIT_TESTS=y
CONFIG_PERFCTR_VIRTUAL=y
CONFIG_PERFCTR_GLOBAL=y
CONFIG_PERFCTR_INTERRUPT_SUPPORT=y
- Build it all (1hr with P4@3GHz).
rpmbuild --target i686 -ba /usr/src/redhat/SPECS/kernel-2.6.spec
- Copy the newly generated SMP kernel to contributions.
cp /usr/src/redhat/RPMS/i386/kernel-smp-2.6.9-42.0.2.ELperfctr.i686.rpm /home/install/contrib/4.2.1/i386/RPMS/
- Rebuild distribution and shoot.
cd /home/install
rocks-dist dist
shoot-node compute-0-x