Linux Perf on linux-altera-ltsi

Hi there,

I have been trying to compile and use perf in the environment provided by the GSRDs. So far I have managed to compile it with minimum support (only glibc). However this limited functionality does not produce perf records that are very human-readable. I have been trying to at least add elf and dwarf support and this has been rather challenging.

I have managed to compile and install into the compiler’s area libdwarf and libelf:

COMPILER_PATH=/opt/intelFPGA/17.0/embedded/ds-5/sw/gcc
HOST=arm-linux-gnueabihf
LIB_PATH=$COMPILER_PATH/$HOST/lib
INC_PATH=$COMPILER_PATH/$HOST/include
git clone https://github.com/WolfgangSt/libelf.git
...
...
make instroot=$COMPILER_PATH/ install
...
...
git clone https://github.com/tomhughes/libdwarf.git
cd libdwarf/libdwarf
LDFLAGS="$LDFLAGS" CC="$CROSS_COMPILE"gcc HOSTCC=gcc make all 
cp libdwarf.a $LIB_PATH
cp libdwarf.a $LIB_PATH/libdw.a
mkdir -p $INC_PATH/ldwarf
mkdir -p $INC_PATH/ldw
cp libdwarf.h $INC_PATH/ldwarf
# Make a copy onto libdw
cp libdwarf.h $INC_PATH/ldw/libdw.h

I have tried to disable the feature checks to then hack the build system without success. Just for completeness see below my makefile call:

export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-                                                          
export PCFLAGS="--sysroot=/opt/intelFPGA/17.0/embedded/ds-5/sw/gcc/arm-linux-gnueabihf -O3 -pipe -g\
 -feliminate-unused-debug-types -fno-omit-frame-pointer -march=armv7-a -funwind-tables"

make perf \
FEATURES_DUMP=FEATURE-DUMP-LOCAL \                                                               
CROSS_COMPILE="arm-linux-gnueabihf-" \
EXTRA_CFLAGS="$PCFLAGS -I/opt/intelFPGA/17.0/embedded/ds-5/sw/gcc/arm-linux-gnueabihf/include" \
LDFLAGS="-L/opt/intelFPGA/17.0/embedded/ds-5/sw/gcc/arm-linux-gnueabihf/lib $LDFLAGS" \
LIBDW_DIR="/opt/intelFPGA/17.0/embedded/ds-5/sw/gcc/arm-linux-gnueabihf"
JOBS=4
prefix=/opt/intelFPGA/17.0/embedded/ds-5/sw/gcc/arm-linux-gnueabihf \
V=1 VF=1 NO_LIBPYTHON=1

However this has not been successful. I have found an email thread by the maintainers where they deal with this problem, but I believe that they have dealt with this in a newer version of the kernel:

http://www.spinics.net/lists/linux-perf-users/msg03037.html

Has anyone managed to overcome this? Does anyone has any suggestions on how to get perf compiled with dwarf support for the kernel provided with the GSRD?

I have gotten the source code for the kernel from here:

export KERNEL_PROVIDER=linux-altera-ltsi
export KERNEL_TAG=refs/tags/ACDS17.0_REL_GSRD_PR 
export UBOOT_TAG=refs/tags/ACDS17.0_REL_GSRD_PR
export KBRANCH=socfpga-4.1.33-ltsi # Check above for release branch to use

And, I am trying this on an Arria10 SoC devkit.

Many thanks in advance!