Git Product home page Git Product logo

eyec's Introduction

eyec

A tool to spy on your C/C++ compiler.

How does it work?

eyec will work like ccache or distcc. It will wrap your c/c++ compiler and other build tools (ar, ld, etc) and will record in a report all their activities while their compiling your project.

It works by creating links to eyec with the same name as the tool your want to spy. Then redirect your PATH to those links. When the compiler is called, your build system will, in effect, call eyec which will record the compilers parameters, call the original compiler with the same parameters and once done enrich a report with the duration of the activity.

The produced report can then be read with graph.js provided in the src folder to generate a dot file that graphviz can interpret to generate a graph. The graph will show the flow of compilation from the sources to the objects to the libraries and executables.

Usage

Supposing eyec binary is in ~/.local/bin. Create a folder of links such as:

~/some/path/cc -> ~/.local/bin/eyec
~/some/path/gcc -> ~/.local/bin/eyec
~/some/path/g++ -> ~/.local/bin/eyec
~/some/path/ar -> ~/.local/bin/eyec
etc

In your project then, compile with the your PATH environment variable pointing to the links folder:

$ PATH=~/some/path/:$PATH make

eyec-report.json will be created.

The report could be generated in multiple folder depending on the complexity of your build. To merge all the result into one report, you can use the enviroment variable called EYEC_REPORT:

$ PATH=~/some/path/:$PATH EYEC_REPORT=/tmp/eyec_report.json make

Then use src/graph.js to create a .dot file:

$ node ~/to/eyec/src/graph.js eyec-report.json | dot -Tsvg > output.svg
$ open output.svg

ag build graph

How to compile

$ git clone <this_repo>
$ cd eyec
$ cargo build

eyec's People

Contributors

jdmichaud 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.