Call Graph - Twiggy🌱 (original) (raw)

  1. Introduction
  2. 1. 📦 Install
  3. 2. 💡 Concepts
    1. 2.1. Call Graph
    2. 2.2. Paths
    3. 2.3. Dominators and Retained Size
    4. 2.4. Generic Functions and Monomorphization
  4. 3. 🏋️‍♀️ Usage
    1. 3.1. ⌨ Command Line Interface
      1. 3.1.1. twiggy top
        1. 3.1.2. twiggy paths
        2. 3.1.3. twiggy monos
        3. 3.1.4. twiggy dominators
        4. 3.1.5. twiggy diff
        5. 3.1.6. twiggy garbage
    2. 3.2. 🦀 As a Crate
    3. 3.3. 🕸 On the Web with WebAssembly
  5. 4. 🔎 Supported Binary Formats
  6. 5. 🙌 Contributing to Twiggy
    1. 5.1. Building
    2. 5.2. Testing
    3. 5.3. Code Formatting
    4. 5.4. Pull Requests
    5. 5.5. Team

Twiggy🌱

Call Graph

Consider the following functions:


#![allow(unused)]
fn main() {
pub fn shred() {
    gnar_gnar();
    bluebird();
}

fn gnar_gnar() {
    weather_report();
    pow();
}

fn bluebird() {
    weather_report();
}

fn weather_report() {
    shred();
}

fn pow() {
    fluffy();
    soft();
}

fn fluffy() {}

fn soft() {}

pub fn baker() {
    hood();
}

fn hood() {}
}

If we treat every function as a vertex in a graph, and if we add an edge_from A to B if function A calls function B, then we get the following_call graph:

Call Graph