Merge "Adding breaktrace & disabling timer migration"
authorJiang, Yunhong <yunhong.jiang@intel.com>
Tue, 16 May 2017 20:34:40 +0000 (20:34 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Tue, 16 May 2017 20:34:40 +0000 (20:34 +0000)
ci/apex.conf
ci/build.sh
ci/envs/cyclictest.sh
ci/kernel_build.sh
ci/kernel_debug.sh [new file with mode: 0755]
kernel/scripts/package/Makefile
kernel/scripts/package/mkspec
tests/kvmfornfv_cyclictest_hostenv_guestenv.yaml

index 46d9930..03d2b79 100644 (file)
@@ -1,2 +1,2 @@
 branch=master
-commit_id=8e1bfc88c439db6816d6ab11575caecc56d51ca4
+commit_id=4bfeded9ee7ddc1cf05f6bd2c388894a7d736291
index ef06a71..a520559 100755 (executable)
@@ -119,6 +119,8 @@ then
     output_dir=$WORKSPACE/build_output
 fi
 
+job_type=`echo $JOB_NAME | cut -d '-' -f 2`
+
 echo ""
 echo "Building for $type package in $output_dir"
 echo ""
@@ -139,3 +141,18 @@ if [ ${apex_build_flag} -eq 1 ];then
     variable=`ls kvmfornfv-* | grep "devel" | awk -F "_" '{print $3}' | awk -F "." '{print $1}'`
     rename "s/${variable}/centos/" kvmfornfv-*
 fi
+
+# Uploading rpms only for daily job
+if [ $job_type == "verify" ]; then
+   if [ $type == "centos" ]; then
+      echo "Removing kernel-debuginfo rpm from output_dir"
+      rm -f ${output_dir}/kernel-debug*
+      echo "Checking packages in output_dir"
+      ls -lrth ${output_dir}
+   else
+     echo "Removing debug debian from output_dir"
+     rm -f ${output_dir}/*dbg*
+     echo "Checking packages in output_dir"
+     ls -lrth ${output_dir}
+   fi
+fi
\ No newline at end of file
index 920a46b..d1ae5c7 100755 (executable)
@@ -11,6 +11,7 @@ testName=$2 #idle_idle/stress_idle
 HOST_IP=$( getHostIP )
 pod_config='/opt/scripts/pod.yaml'
 cyclictest_context_file='/opt/kvmfornfv_cyclictest_'${testName}'.yaml'
+yardstick_prefix='/root/yardstick/yardstick/benchmark/scenarios/compute' # yardstick teardown path
 
 if [ ! -f ${pod_config} ] ; then
     echo "file ${pod_config} not found"
@@ -22,6 +23,12 @@ if [ ! -f ${cyclictest_context_file} ] ; then
     exit 1
 fi
 
+#As yardstick executes only *.bash scripts, copy the post-execute script as .bash script
+cp /opt/scripts/disable_trace.sh ${yardstick_prefix}/disable_trace.bash
+
+#Execution of the post-execute script copied requires re-installation of yardstick
+( cd /root/yardstick ; python setup.py install )
+
 #setting up of image for launching guest vm.
 ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
 root@$HOST_IP "cp /root/images/guest1.qcow2 /root/"
index 91e8b77..6071ca7 100755 (executable)
@@ -50,7 +50,7 @@ EOF
 
 # Build the kernel debs
 make-kpkg clean
-fakeroot make-kpkg --initrd --revision=$VERSION kernel_image kernel_headers
+fakeroot make-kpkg --initrd --revision=$VERSION kernel_image kernel_headers kernel_debug -j$(nproc)
 make
 mv /root/kvmfornfv/linux-* /root/kvmfornfv/build_output
 }
diff --git a/ci/kernel_debug.sh b/ci/kernel_debug.sh
new file mode 100755 (executable)
index 0000000..5ccf1af
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+tmpdir=$1 #/tmp/kvmfornfv_rpmbuild.1/BUILD/kernel-4.4.50_rt62nfv
+OBJCOPY=objcopy
+if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
+for module in $(find $tmpdir/lib/modules/ -name *.ko -printf '%P\n'); do
+                        module=lib/modules/$module
+                        mkdir -p $(dirname $tmpdir/usr/lib/debug/$module)
+                        # only keep debug symbols in the debug file
+                        $OBJCOPY --only-keep-debug $tmpdir/$module $tmpdir/usr/lib/debug/$module
+                        # strip original module from debug symbols
+                        $OBJCOPY --strip-debug $tmpdir/$module
+                        # then add a link to those
+                        $OBJCOPY --add-gnu-debuglink=$tmpdir/usr/lib/debug/$module $tmpdir/$module
+                done
+fi
\ No newline at end of file
index 493e226..a7ed595 100644 (file)
@@ -52,7 +52,7 @@ rpm-pkg rpm: FORCE
        $(call cmd,src_tar,$(KERNELPATH),kernel.spec)
        $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
        mv -f $(objtree)/.tmp_version $(objtree)/.version
-       rpmbuild $(RPMOPTS) --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz
+       QA_SKIP_BUILD_ROOT=1 rpmbuild $(RPMOPTS) --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz
        rm $(KERNELPATH).tar.gz kernel.spec
 
 # binrpm-pkg
index fe44d68..0f96d4f 100755 (executable)
@@ -39,10 +39,9 @@ if ! $PREBUILT; then
 echo "Source: kernel-$__KERNELRELEASE.tar.gz"
 fi
 
+echo "%undefine _missing_build_ids_terminate_build"
 echo "BuildRoot: %{_tmppath}/%{name}-%{PACKAGE_VERSION}-root"
 echo "Provides: $PROVIDES"
-echo "%define __spec_install_post /usr/lib/rpm/brp-compress || :"
-echo "%define debug_package %{nil}"
 echo ""
 echo "%description"
 echo "The Linux Kernel, the operating system core itself"
@@ -81,6 +80,8 @@ echo "make clean && make %{?_smp_mflags}"
 echo ""
 fi
 
+echo ""
+
 echo "%install"
 echo 'KBUILD_IMAGE=$(make image_name)'
 echo "%ifarch ia64"
@@ -91,6 +92,7 @@ echo "%endif"
 echo 'mkdir -p $RPM_BUILD_ROOT'"/lib/firmware/$KERNELRELEASE"
 
 echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{?_smp_mflags} KBUILD_SRC= mod-fw= modules_install'
+echo '/opt/kvmfornfv/ci/kernel_debug.sh $RPM_BUILD_ROOT'
 echo 'INSTALL_FW_PATH=$RPM_BUILD_ROOT'"/lib/firmware/$KERNELRELEASE"
 echo 'make INSTALL_FW_PATH=$INSTALL_FW_PATH' firmware_install
 echo "%ifarch ia64"
@@ -110,15 +112,15 @@ echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE"
 
 echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$KERNELRELEASE"
 
-echo "%ifnarch ppc64"
-echo 'bzip2 -9 --keep vmlinux'
-echo 'mv vmlinux.bz2 $RPM_BUILD_ROOT'"/boot/vmlinux-$KERNELRELEASE.bz2"
-echo "%endif"
+#echo "%ifnarch ppc64"
+#echo 'bzip2 -9 --keep vmlinux'
+#echo 'mv vmlinux.bz2 $RPM_BUILD_ROOT'"/boot/vmlinux-$KERNELRELEASE.bz2"
+#echo "%endif"
 
 if ! $PREBUILT; then
 echo 'rm -f $RPM_BUILD_ROOT'"/lib/modules/$KERNELRELEASE/{build,source}"
 echo "mkdir -p "'$RPM_BUILD_ROOT'"/usr/src/kernels/$KERNELRELEASE"
-echo "EXCLUDES=\"$RCS_TAR_IGNORE --exclude .tmp_versions --exclude=*vmlinux* --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation --exclude=firmware --exclude .config.old --exclude .missing-syscalls.d\""
+echo "EXCLUDES=\"$RCS_TAR_IGNORE --exclude .tmp_versions --exclude=*.o --exclude=*vmlinux* --exclude=*.ko --exclude=*.cmd --exclude=Documentation --exclude=firmware --exclude .config.old --exclude .missing-syscalls.d\""
 echo "tar "'$EXCLUDES'" -cf- . | (cd "'$RPM_BUILD_ROOT'"/usr/src/kernels/$KERNELRELEASE;tar xvf -)"
 echo 'cd $RPM_BUILD_ROOT'"/lib/modules/$KERNELRELEASE"
 echo "ln -sf /usr/src/kernels/$KERNELRELEASE build"
index 3f477f4..99c474c 100644 (file)
@@ -51,3 +51,10 @@ context:
   type: Node
   name: LF
   file: /opt/scripts/pod.yaml
+  env:
+     type: script
+     prefix:  yardstick.benchmark.scenarios.compute
+     teardown:
+     -
+       kvm:
+         script: disable_trace.bash