From b5fa643fa475a1956adcb693f6bd23e3d40798ee Mon Sep 17 00:00:00 2001 From: Christian Wiese Date: Thu, 11 Apr 2013 16:03:20 +0200 Subject: [PATCH] linux: improved to build performance analysis tools if requested --- base/linux/config-700.in | 6 +++++- base/linux/linux-conf.in | 24 +++++++++++++++++++++++- base/linux/linux.conf | 7 ++++++- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/base/linux/config-700.in b/base/linux/config-700.in index 65175a7ba..869b4e214 100644 --- a/base/linux/config-700.in +++ b/base/linux/config-700.in @@ -2,7 +2,7 @@ # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: package/.../linux/config-700.in -# Copyright (C) 2006 - 2012 The OpenSDE Project +# Copyright (C) 2006 - 2013 The OpenSDE Project # Copyright (C) 2004 - 2006 The T2 SDE Project # Copyright (C) 1998 - 2003 Clifford Wolf # @@ -34,4 +34,8 @@ menu_begin MENU_PKG_LINUX 'Linux Kernel Options' skas3 'Build UML Host kernel with SKAS3 support' \ guest 'Build UML Guest kernel (Not implemented yet!)' fi + + comment ' ' + comment 'Debugging/Development options' + bool "Build Performance analysis tools" SDECFG_PKG_LINUX_PERFTOOLS 0 menu_end diff --git a/base/linux/linux-conf.in b/base/linux/linux-conf.in index e68377eb5..4fcc24257 100644 --- a/base/linux/linux-conf.in +++ b/base/linux/linux-conf.in @@ -2,7 +2,7 @@ # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: package/.../linux/linux-conf.in -# Copyright (C) 2006 - 2012 The OpenSDE Project +# Copyright (C) 2006 - 2013 The OpenSDE Project # Copyright (C) 2004 - 2006 The T2 SDE Project # Copyright (C) 1998 - 2003 Clifford Wolf # @@ -326,6 +326,28 @@ lx_config() { echo "... configuration of $lx_kernelrelease finished!" } +lx_build_perftools() { + echo_status "Building performance analysis tools" + local perfmakeopt= + + var_append perfmakeopt ' ' 'ARCH=$arch' + var_append perfmakeopt ' ' 'DESTDIR=$root/' + var_append perfmakeopt ' ' 'prefix=/$prefix' + + if ! pkginstalled python; then + echo_warning "Disabling python extensions (python not available)" + var_append perfmakeopt ' ' "NO_LIBPYTHON=1 PYTHON=" + fi + + if ! pkginstalled elfutils; then + echo_warning "Disabling debug-info analysis feature (elfutils not available)" + var_append perfmakeopt ' ' "NO_DWARF=1" + fi + + eval $MAKE -C tools/perf $perfmakeopt + eval $MAKE -C tools/perf $perfmakeopt install +} + pkg_linux_brokenfiles="$base/architecture/$arch/kernel$treever-disable.lst \ $base/package/*/linux$treever/disable-broken.lst \ $pkg_linux_brokenfiles" diff --git a/base/linux/linux.conf b/base/linux/linux.conf index 767f58313..e92dc1b8b 100644 --- a/base/linux/linux.conf +++ b/base/linux/linux.conf @@ -2,7 +2,7 @@ # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: package/.../linux/linux.conf -# Copyright (C) 2007 - 2010 The OpenSDE Project +# Copyright (C) 2007 - 2013 The OpenSDE Project # Copyright (C) 2004 - 2006 The T2 SDE Project # Copyright (C) 1998 - 2003 Clifford Wolf # @@ -99,6 +99,11 @@ main_lx() { hook_eval postmake + # build performance analysis tools + if [ "$SDECFG_PKG_LINUX_PERFTOOLS" == 1 ]; then + lx_build_perftools + fi + # iterate over the packages that provide 3rd party linux kernel modules if grep -q "CONFIG_MODULES=y" .config ; then module_error=0