GithubHelp home page GithubHelp logo

cma's Introduction


What is CMA?
A GDB Python script that analyzes and records C/C++ application's dynamic memory status.
CMA has little effect on analyzed C/C++ application performance.
CMA supports X86_32 and X86_64.

How to use CMA?
  1. CMA just can work with GDB 7.5 or newer version. You can use Get-GDB check the version of GDB in current system and get GDB 7.5 or newer version if need.
    wget https://raw.githubusercontent.com/teawater/get-gdb/master/get-gdb.py
    python get-gdb.py
  2. Get CMA.
    wget https://raw.githubusercontent.com/teawater/cma/master/cma.py
  3. C/C++ application that want to analyzes should be built with GCC "-g" option to get the memory allocate and release code line infomation.
    gcc -g xxx
    g++ -g xxx
  4. GDB control the C/C++ application that want to analyzes.
    There are some ways:
    • Open GDB with a application. Don't need execute application because CMA script will auto do it if need.
      gdb xxx
    • Attach a running application.
      gdb -p pid
      Or
      gdb
      attach pid
  5. Start CMA script inside GDB.
    It will let you input some options. Then, exencute application and analyzes its memory allocate and release.
    source cma.py
  6. When CMA script and application is running, you can use CTRL-C interrupt their execution. Then, you can let CMA script save record to a CSV file.
    CSV file can be read by Openoffice or Excel.
    [0] Record memory infomation to "/home/teawater/tmp/cma.csv".
    [1] Continue.
    [2] Quit.
    Which operation?[0]
    Memory infomation saved into "/home/teawater/tmp/cma.csv".
    Continuing.

Screenshot
This is a screenshot of a CSV file.

cma's People

Contributors

teawater avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.