Skip to content

Latest commit

 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ftrace-chart

Generate plantuml chart for function-graph trace

Usage

$ ./ftrace-chart.sh -h

ftrace-chart
==========================
Generate plantuml chart for function-graph trace

Format:
  ./ftrace-chart.sh [record|report] [options]

Options
  -h, --help                  Help
  -m, --mode=[trace|stack|flame]
                              "trace" is function-graph chart (excution flow of the function)
                              "stack" is stacktrace chart (where has the function been called)
                              "flame" is flamegraph chart (where and times the function has been called)"
  -f, --function              Function to track
  -e, --event                 Event to track
  -t, --timeout               Seconds to trace, you can stop mannully without passing this param.
  -o, --output                Output trace file (default: result/*.data).

Trace Mode Example
---------------------
  Generate chart of schedule() excution flow:

  1. Record function-graph trace of schedule()
  $ ./ftrace-chart.sh record --mode=trace --function=schedule --timeout=10

  2. Generate plantuml files
  $ ./ftrace-chart.sh report --mode=trace

  3. Generate svg image
  $ java -jar thirdparty/plantuml/plantuml-mit.jar -tsvg ./ftrace-chart.data/schedule*.puml

Stack Mode Example
---------------------
  Generate chart of schedule() called positions:

  1. Record stacktrace of schedule()
  $ ./ftrace-chart.sh record --mode=stack --function=schedule --timeout=10

  2. Generate plantuml files and svg image"
  $ ./ftrace-chart.sh report --mode=stack

Flame Mode Example
---------------------
  1. Generate flame graph:
  $ ./ftrace-chart.sh record --mode=flame --timeout=10
  $ ./ftrace-chart.sh record --mode=flame --event=cache-misses --timeout=10
  $ ./ftrace-chart.sh record --mode=flame --function=schedule --timeout=10

  2. Generate flamechart svg image
  $ ./ftrace-chart.sh report --mode=flame

Start local http server

$ ./start-httpserver.sh

Then you can browse result files from a brower.

Screen Shot

Trace Mode

Chart of schedule() excution flow

screenshot/schedule_trace.svg

Stack Mode

Chart of schedule() called position

screenshot/schedule_stack.svg

Flame Mode

Flamegraph

screenshot/flame.svg

Reverse flamegraph of where schedule() is being called

screenshot/schedule_flame.svg

About

Generate plantuml chart for linux function-graph trace.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages