Skip to content
Snippets Groups Projects
Select Git revision
  • 72bdc160ea7f07ecdb3a9d338e092dab62bf6844
  • test default
2 results

linux-ramdump-parser-v2

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Mitchel Humpherys authored
    [29d3f2ed: "lrdp-v2: refactor Iommu domain parsing code"] introduced
    an extra argument for rb_tree `walker' functions, but didn't update the
    runqueue rb_tree user, so the ramdump parser currently fails to print
    the runqueue state. Fix this.
    
    For certain dumps, before this change we would see the following
    backtrace:
    
        Traceback (most recent call last):
          File "ramparse.py", line 266, in <module>
            p.cls(dump).parse()
          File "parsers/runqueue.py", line 196, in parse
            self.print_cfs_state(cfs_rq_addr)
          File "parsers/runqueue.py", line 101, in print_cfs_state
            rb_walker.walk(tasks_timeline_addr, self.cfs_node_func)
          File "rb_tree.py", line 54, in walk
            self._walk(node, func, [], extra)
          File "rb_tree.py", line 39, in _walk
            self._walk(left_node, func, seen, extra)
          File "rb_tree.py", line 39, in _walk
            self._walk(left_node, func, seen, extra)
          File "rb_tree.py", line 41, in _walk
            func(node, extra)
        TypeError: cfs_node_func() takes exactly 2 arguments (3 given)
    
    Change-Id: Ic19ec42d6cfbe87b6e0a0e99c6adf7c41e5b35e9
    72bdc160
    History
    Python Linux Ramdump Parser
    
    What does this tool do?
    ----------------------------------
    This tool takes as its input a vmlinux symbol file, and files representing
    memory from devices that run Linux. It proceeds to dump useful information
    such as process stacks, IRQ and workqueue information.
    
    What does this tool need?
    ----------------------------------
    1) Python. This tool has been tested with Python 2.6.5 on both Linux and Windows
    1) a set of RAM dumps. Ideally, the load location of each dump as well.
    2) The corresponding vmlinux file
    
    How is this tool invoked?
    ----------------------------------
    python ramparse.py invokes the parser. Options:
    
    --ram-file <file path> <start> <end> : Add this ram file to be parsed.
    At least one of --ram-file and --auto-dump required
    
    --vmlinux <path> : path for vmlinux to use. This is required
    
    --auto-dump <path to folder> : Automatically find files for a RAM dump and
    detect useful informaton.
    
    --gdb-path <path> : path for the GNU gdb debugger. If no path is given, the
    path will be used from local_settings.py
    
    --gdb-path <path> : path for the nm tool. If no path is given, the
    path will be used from local_settings.py
    
    --outdir <path> : Output directory to store any files written. If no path is
    given, the ramfile directory will be used if given, else the current directory
    will be used.
    
    --out-file <path> : File to write all output to. If no path is given,
    linux-parser-output.txt is used
    
    --stdout : Write to stdout instead of the out-file. This overrides any
    --out-file given.
    
    The list of features parsed is constantly growing. Please use --help option
    to see the full list of features that can be parsed.
    
    Setting up the toolchains
    -------------------------------
    The parser relies on having access to gdb and nm to work. You will need to
    specify the paths to these tools. This can be done in three ways
    
    1) Using --gdb-path and --nm-path to specify the absolute path
    2) Using CROSS_COMPILE to specify the prefix
    3) Using local_settings.py as described below
    
    Just having gdb/nm on the path is not supported as there are too many
    variations on names to invoke.
    
    local_settings.py
    -------------------------------
    The parser attempts to figure out most of the settings automatically but there
    are some settings that are unique to the environment of the running system.
    These must be specified in local_settings.py. The current format for the file
    is
    
    <setting name> = <string identifying the feaure>
    
    Currently supported features:
    gdb_path - absolute path to the gdb tool for the ramdumps
    nm_path - absolute path to the gdb tool for the ramdumps
    gdb64_path - absolute path to the 64-bit gdb tool for the ramdumps
    nm64_path - absolute path to the 64-bit nm tool for the ramdumps
    
    Note that local_settings.py is just a python file so the file may take advantage
    of python features.