# Debug with Hansei RAM dump parser

Source: [https://docs.qualcomm.com/doc/80-88500-3/topic/debug_with_hansei_ram_dump_parser.html](https://docs.qualcomm.com/doc/80-88500-3/topic/debug_with_hansei_ram_dump_parser.html)

The Hansei tool is used to parse the debug information out of the RAM dump. It generates the AOP logs, node power architecture (NPA) logs, master status, resource states, and so on.

## Installation

The following procedure provides the installation instructions for the Hansei parser:

1. Download python v2.7.x from [https://www.python.org/](https://www.python.org/). To check
          the current python version, type the following command.

        python –VCopy to clipboard
2. Install the `pyelftools` library that supports an Arm® technology
          compiler. 

        sudo apt-get update
        sudo apt-get install python-pyelftools
        sudo apt-get install python3-pyelftoolsCopy to clipboard
3. Type the following command to start the installation.

        python setup.py installCopy to clipboard

The Hansei script has been released with AOP release 91.

- Location – aop\_proc\core\bsp\aop\scripts\hansei\
- As Hansei refers to several files in the build, execute Hansei from the AOP build.

## Usage

1. Type the following command to use the Hansei script for RAM dump parsing.

        aop_proc\core\bsp\aop\scripts\hansei\hansei.py --elf <aop>.elf -o . -t 845 dumpfile <ramdump folder>Copy to clipboard

    - aop-log.txt – contains postprocessed AOP log
    - ddr-log.txt – contains postprocessed DDR log
    - ddr\_stats.txt – contains DDR statistics including the recent
              frequency switch history
    - npa-dump.txt – contains standard NPA dump format, without the
              (inaccurate) timestamps
    - sleep\_stats.txt – contains sleep stats of the AOSS sleep and CX
              collapse
    - cmd\_db.txt – contains mapping details of the named RPMh
              resources and addresses
    - binaries\RPMH\_BINARY\_RECOVERED.BIN – contains recovered RPMh
              register dump.
2. Load into TRACE32 for RPMh debugging.

**Parent Topic:** [RPMh debugging](https://docs.qualcomm.com/doc/80-88500-3/topic/81_RPMh_hardening_and_debugging_.html)

Last Published: Sep 26, 2023

[Previous Topic
RPMh debugging](https://docs.qualcomm.com/bundle/publicresource/80-88500-3/topics/81_RPMh_hardening_and_debugging_.md) [Next Topic
Debug AOP script](https://docs.qualcomm.com/bundle/publicresource/80-88500-3/topics/82_Debug_AOP_script.md)