Android Crash debugging using Rampdump parser

This post details usage of ramdump parser to debug crashes on android running qualcomm chipsets.
It has been validated on APQ8064 chipsets with host running Ubuntu 14.04.1 LTS version.

Prerequisite:

Python Ver 2.7 is needed

Environment Setup:

  1.  Download the ramdump parser tool from code aurora forum
    mkir caftools
    cd caftools
    git clone git://www.codeaurora.org/platform/vendor/qcom­opensource/tools.git
  2.  Download the aarch64 toolchain from linaro website below:
    https://releases.linaro.org/13.09/components/toolchain/binaries/gcc-linaro-aarch64-linux-gnu-4.8-2013.09_linux.tar
  3.  setup the gdb and nm paths using a python script file below
    ANDROID_SRC_PATH – path containing android source code.
    LINARO_TOOL_PATH – path to the extracted folder of gcc-linaro-aarch64-linux-gnu-4.8-2013.09_linux.tar
  4. python local_settings.py to setup the paths.
  5. Copy the bin files when device is in Mass Storage i.e., crashed and shown as an additional drive on host machine.
    The list of bin files might include but not limited to:
    CODERAM.BIN, CPU1_WDT.BIN, CPU3_WDT.BIN, EBICS0.BIN, ETB_REG.BIN, IMEM_C.BIN, LPASS.BIN, PMIC_PON.BIN, ETB.BIN,
    IMEM_A.BIN, PMIC_WD.BIN

   CRASH_BIN_FOLDER_PATH – path in which these bin files are copied

Usage: python ramparse.py -v <path to vmlinux> -g <gdb path> -n <nm path> -j <objdump path> -o <folder having bin files> -a <folder having bin files> -x

python linux-ramdump-parser-v2/ramparse.py -v ANDROID_SRC_PATH/out/target/product/msm8960/obj/KERNEL_OBJ/vmlinux -g ANDROID_SRC_PATH/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/arm-eabi-gdb -n ANDROID_SRC_PATH/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/arm-eabi-nm -j ANDROID_SRC_PATH/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/arm-eabi-objdump -o CRASH_BIN_FOLDER_PATH -a CRASH_BIN_FOLDER_PATH -x

Command to dump workqueues and tasks
Answer:    cd CRASH_BIN_FOLDER_PATH
python ramparse.py ­v ­a . ­o . ­x ­t ­q

Help:
python ramparse.py –help

The source of local_settings.py

local_settings.py

import parser_util
if parser_util.get_system_type() == ‘Linux’:
gdb_path = “ANDROID_SRC_PATH/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/arm-eabi-gdb”
nm_path = “ANDROID_SRC_PATH/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/arm-eabi-nm”
gdb64_path = “LINARO_TOOL_PATH/gcc-linaro-aarch64-linux-gnu-4.8-2013.09_linux/bin/aarch64-linux-gnu-gdb”
nm64_path = “LINARO_TOOL_PATH/gcc-linaro-aarch64-linux-gnu-4.8-2013.09_linux/bin/aarch64-linux-gnu-nm”
objdump64_path = “LINARO_TOOL_PATH/gcc-linaro-aarch64-linux-gnu-4.8-2013.09_linux/bin/aarch64-linux-gnu-objdump”
else:
#if not linux assume windows
gdb_path = “c:\\<replace ARM WINDOWS TOOLCHAIN PATH>\arm-eabi-4.7\bin\arm-eabi-gdb”
nm_path = “c:\\<replace ARM WINDOWS TOOLCHAIN PATH>\arm-eabi-4.7\bin\arm-eabi-nm”
gdb64_path = “c:\\<replace ARM WINDOWS TOOLCHAIN PATH>\aarch64-linux-gnu-gdb”
nm64_path = “c:\\<replace ARM WINDOWS TOOLCHAIN PATH>\aarch64-linux-gnu-nm”
objdump64_path = “c:\\<replace ARM WINDOWS TOOLCHAIN PATH>\aarch64-linux-gnu-objdump”

We shall see how to analyze the RTB, dmesg_TZ files generated by ramdump parser in the next post.

Happy Debugging !!

Advertisements