简体   繁体   中英

ftrace + addr2line on raspberry pi 3

I want to get kernel source code file name and line number of a kernel function from the function address that ftrace outputed on rapberry pi 3.

I tried addr2line -e /boot/kernel8.img [function address] on raspberry pi 3. But it returned addr2line: /boot/kernel8.img: File format not recognized .

note:

kernel8.img is customed kernel that i compiled. I cloned kernel source from https://github.com/raspberrypi/linux.git , checkouted to rpi-4.18.y , turned on CONFIG_DEBUG_INFO , and run make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j4 . This compile work performed on ubuntu x86_64 linux kernel 4.15.0-23-generic. The type of kernel8.img is as follows.

$ file kernel8.img
kernel8.img: MS-DOS executable

thanks

You need to run addr2line against the vmlinux file (ie uncompressed/raw kernel binary). /boot/kernel8.img is, most probably, a zImage (ie compressed kernel). You can find the vmlinux file in the root of your kernel sources after compilation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM