Use Perf on Odroid XU3/XU4

Because the Odroid is using a minor kernel version which does not support apt-get to install Perf directly, so users need to rebuild the kernel and make perf from source by themselves.

The official guide has some errors, therefore I make a clearer line of this process.

Install kernerl

install relevant packages

sudo apt-get install flex bison libdw-dev libnewt-dev binutils-dev libaudit-dev libgtk2.0-dev libperl-dev libpython-dev libunwind-*
sudo apt-get install build-essential libqt4-dev libncurses5-dev git 

download source code. The github is https://github.com/hardkernel/linux. This code includes kernel and perf. The version I downloaded is 3.10.105, replace 3.10.105 below with your download kernel version.

cd /usr/src
sudo su root 
git clone https://github.com/hardkernel/linux.git -b odroidxu3-3.10.y odroidxu3-3.10.y 
mv linux-odroidxu3-* linux

make .config

make odroidxu3_defconfig 
//or 
sudo cp /boot/config ./.config

change files to Enable PMU setting

gedit arch/arm/boot/dts/exynos5422_evt0.dtsi
/*--------------around line 91, change-------------------*/
    };
};

    watchdog@10020000 {
        compatible = "samsung,s3c2410-wdt";
        reg = <0x101D0000 0x100>;
/*----------------------into----------------------------*/
    };
};
    arm-pmu {
        /* compatible = "arm,cortex-a15-pmu";
        interrupt-parent = <&combiner>;
        interrupts = <1 2>, <7 0>, <16 6>, <19 2>;
        */
        compatible = "arm,cortex-a7-pmu";
        interrupt-parent = <&gic>;
        interrupts = <0 192 4>, <0 193 4>, <0 194 4>, <0 195 4>;
    };

    watchdog@10020000 {
        compatible = "samsung,s3c2410-wdt";
        reg = <0x101D0000 0x100>;

make files & install

make -j8
sudo cp arch/arm/boot/zImage arch/arm/boot/dts/exynos5422-odroidxu3.dtb /media/boot && sync
mkdir tmp
sudo make modules_install ARCH=arm INSTALL_MOD_PATH=./tmp && sync

rewrite config file.

sudo cp .config /boot/config-3.10.105

create initramfs

cp -r ./tmp/lib/modules/3.10.105 /lib/modules
sudo update-initramfs -c -k 3.10.105

create & install uInitrd

sudo mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n uInitrd -d /boot/initrd.img-3.10.105 /boot/uInitrd-3.10.105
sudo cp /boot/uInitrd-3.10.105 /media/boot/uInitrd

reboot

sudo sync && reboot

now your kernel should be installed

Install perf

cd /usr/src/linux/tools/perf
sudo make WERROR=0 NO_LIBNUMA=1 
sudo cp ./perf /usr/bin/

test perf

perf list
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值