龍芯3A oprofile使用方法

應用程序源碼編譯(本地編譯)
1.git-clone git://git.printk.org/caiwanwei/oprofile-0.9.7

2.tar xf oprofile-0.9.7; cdoprofile-0.9.7 

3. ./configure --with-kernel-support

4. make

5. sudo make install

內核模塊編譯(交叉編譯,也可選擇本地編譯)
1.git-clonegit://git.printk.org/linux-loongson-release.git

2.make ARCH=mips menuconfig

3.General Setup->Profilingsupport->OProfile systemprofiling選爲<M>

4.make ARCH=mipsCROSS_COMPILE=/path/to/toolchain/gcc4.6/install/bin/mips64el-linux-
(交叉編譯)

5.scp [email protected]:/boot/vmlinux

6.make modules_install ARCH=mipsCROSS_COMPILE=/path/to/toolchain/gcc4.6/install/bin/mips64el-linux- INSTALL_MOD_PATH=./modules_install/

7.cd modules_install

8. tar zcf - lib | ssh [email protected] tarzxf - -C /
(將oprofile模塊拷貝到Loongson3機器上)

使用
sudo opcontrol --init
sudo opcontrol --reset
sudo opcontrol --vmlinux=/boot/vmlinux
sudo opcontrol --setup --separate=kernel--event=CPU_CLK_UNHALTED:50000:0:1:1
sudo opcontrol --start
./test.out
sudo opcontrol --shutdown
opreport -l ./test.out
發佈了22 篇原創文章 · 獲贊 2 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章