Giter Club home page Giter Club logo

tfg's Introduction

Terminal flame graph (tfg)

Command line tool to parse DTrace and perf output and display it as a flame graph inside your terminal emulator.

Motivation

Sometimes you may want to visualize a stack trace with FlameGraph of your application running on a server, so you will need to copy a stack traces from your server to your local machine, create a .svg file and open it in the browser. This process can get tedious if you're doing that a lot or if you just want to take a quick look of stack traces.

This tool is trying to solve that by letting you view the stack traces inside your terminal emulator.

Getting Started

This project is trying to be as simple and self-contained as possible, so the only real dependency here (besides Python interpreter) is libncurses which should probably be installed on every system.

Also, this project is Python 2/3 compatible.

To start, simple git clone https://github.com/4rtzel/tfg and you're good to go.

Usage

  • run DTrace or perf tool to collect stack traces

    DTrace:

    dtrace -n 'profile-197 {@[ustack(100)]=count()' > on.stacks

    perf:

    perf record -g -a -- sleep 1
    perf script > on.stacks
  • run tfg.py and specify an input file type

    tfg.py -t perf on.stacks
  • use the following keybindings to navigate

    , , , - navigation

    c - on/off combined frames

    Enter - zoom to a selected frame

    r - reset

    q - quit

Here is an example of running tfg with perf: asciicast

TODO

  • Tests
  • Search option and highlight
  • Diff view

tfg's People

Contributors

4rtzel avatar

Watchers

 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.