From a7bac9930ec43fc3b6746d7a468c9d72d1dfcf7b Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Mon, 5 Feb 2018 15:38:18 +0100 Subject: [PATCH] linux: install perf in development builds perf will be built if CONFIG_PERF_EVENTS is enabled in the kernel config. elfutils, binutils and libunwind are needed to get symbols of userspace programs in perf output. zlib is an implicit dependency of elfutils and and optional one for perf - but better add it here. openssl/libcrypto is an optional dependency for perf, add it so that the perf configuration on clean build is identical to an unclean rebuild. Signed-off-by: Matthias Reichl --- packages/linux/package.mk | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/linux/package.mk b/packages/linux/package.mk index e621e1d3e4..f8fb1763eb 100644 --- a/packages/linux/package.mk +++ b/packages/linux/package.mk @@ -50,6 +50,11 @@ else PKG_KERNEL_CFG_FILE=$PKG_DIR/config/$PKG_CFG_FILE fi +if [ "$DEVTOOLS" = "yes" ] && grep -q ^CONFIG_PERF_EVENTS= $PKG_KERNEL_CFG_FILE ; then + PKG_BUILD_PERF="yes" + PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET binutils elfutils libunwind zlib openssl" +fi + case "$LINUX" in amlogic-3.10) PKG_VERSION="02fdb27" @@ -175,6 +180,25 @@ make_target() { rm -f $INSTALL/$(get_kernel_overlay_dir)/lib/modules/*/build rm -f $INSTALL/$(get_kernel_overlay_dir)/lib/modules/*/source + if [ "$PKG_BUILD_PERF" = "yes" ] ; then + ( cd tools/perf + WERROR=0 \ + NO_LIBPERL=1 \ + NO_LIBPYTHON=1 \ + NO_SLANG=1 \ + NO_GTK2=1 \ + NO_LIBNUMA=1 \ + NO_LIBAUDIT=1 \ + NO_LZMA=1 \ + NO_SDT=1 \ + LDFLAGS="-ldw -ldwfl -lebl -lelf -ldl -lz" \ + EXTRA_PERFLIBS="-lebl" \ + make + mkdir -p $INSTALL/usr/bin + cp perf $INSTALL/usr/bin + ) + fi + ( cd $ROOT rm -rf $BUILD/initramfs $SCRIPTS/install initramfs