GithubHelp home page GithubHelp logo

gastonfeng / fpv-gcc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ebs-universe/fpv-gcc

0.0 0.0 0.0 345 KB

Analysing GCC generated Map files for measuring code footprint

Home Page: https://fpv-gcc.readthedocs.io/en/latest/

License: GNU General Public License v3.0

Python 100.00%

fpv-gcc's Introduction

https://img.shields.io/pypi/v/fpvgcc.svg?logo=pypi https://img.shields.io/pypi/pyversions/fpvgcc.svg?logo=pypi https://img.shields.io/travis/ebs-universe/fpv-gcc.svg?logo=travis https://img.shields.io/coveralls/github/ebs-universe/fpv-gcc.svg?logo=coveralls

Introduction

fpvgcc is a python script/package to help analyse code footprint on embedded microcontrollers using GCC generated Map files.

This module uses information contained within .map files generated by gcc (when invoked with -Wl,-Map,out.map), to provide easily readable summaries of static memory usage at various levels of the code hierarchy. This package generates no information that isn't already contained within the .map file.

The provided outputs can be used to gain insight into the relative sizes of included code, and aid in prioritizing static memory optimization for very low memory platforms. Some provided functionality may also deliver minor usability improvements to the workflow involved in parsing though generated assembly listings.

Warning

This package does not attempt to perform any kind of dynamic analysis. All memory usage reported refers only to static memory usage. This means the size of actual functions and global variables which are instantiated in the C code itself.

Anything on the call stack, such as function locals, will not be accounted for. Similarly, anything in the heap which is allocated at runtime using malloc or similar will not be accounted for.

Due to this, the utility of this module is likely limited to code written for highly memory constrained embedded microcontrollers, where dynamic memory allocation is anyway avoided when possible.

Known Issues

This script was first written based on the format of mapfiles generated by msp430-elf-gcc, v4.9.1. Over time, it was modifed to accept elements found in mapfiles generated by later versions and gcc-based toolchains for other platforms.

Still, remember that the file parsing was implemented by observing the content of real mapfiles, and not based on a file format specification. Even with toolchains it was written to support, there are large sections of the file that are not actually used. Due to this, the outputs generated are not always accurate. Various boundary conditions result in minor errors in size reporting.

The following more serious issues are known. They should be fixed at some point, but for the moment I've chosen to work around them :

  • Having two C filenames with the same name (or generating the same obj name) in your tree will cause parsing to break on some platforms / toolchains.

Project Information

The latest version of the documentation, including installation, usage, and API/developer notes can be found at ReadTheDocs.

The latest version of the sources can be found at GitHub. Please use GitHub's features to report bugs, request features, or submit pull/merge requests.

The principle author for fpvgcc is Chintalagiri Shashank. The author can be contacted if necessary via the information on the author's github profile . See the AUTHORS file for a full list of collaborators and/or contributing authors, if any.

fpvgcc is distributed under the terms of the GPLv3 license . A copy of the text of the license is included along with the sources.

fpv-gcc's People

Contributors

chintal avatar gastonfeng avatar puhitaku 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.