No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

stapflame - a process stack profiling tool using systemtap, perf and flamegraphs.

Author: Created: Januari 2016

The purpose of this tool is to investigate where time is spent when running an Oracle database foreground process. This tool uses perf to sample full stacktraces, and systemtap to profile the time.

It uses two files from Brendan Gregg's flamegraph visualisation scripts (

And a script from Luca Canali's stack profiling project ( eventsname.sql

For systemtap to understand the linux scheduler, the kernel debuginfo packages need to be installed: kernel-euk-debuginfo and kernel-uek-debuginfo-common, available via

The output of eventsname.sql (eventsname.sed) needs to be in the same directory as the script. Also, the and scripts need to be in that directory too.

To run it, execute, as root: ./ 123 (where 123 is the pid of an Oracle foreground process) The systemtap kernel module is compiled, and once systemtap and perf are setup, it will display:

profiling started, press enter to stop

Then execute the things you want to profile in the Oracle session you are profiling. Press enter once you want to stop profiling. The script will then process the data, and output multiple svg files:

  • stapflame_ora_cpu_wait_sequence.svg This shows a flamegraph of stacktraces per Oracle cpu and wait state.
  • stapflame_no_ora_state.svg This shows a flamegraph of stacktraces per CPU state, without Oracle state.
  • stapflame_os_cpu_state.svg This shows a flamegraph of stacktraces per CPU state, with Oracle state.
  • stapflame_ora_state_perf.collapsed.noseq.oracle__ON_CPU.svg This shows a flamegraph of stacktraces of all time spend in Oracle on cpu state.
  • stapflame_ora_state_perf.collapsed.noseq.oracle__.svg This shows a flamegraph of stacktraces of all time spend in a waitevent (a flamegraph is created for every waitevent encountered).

WARNING! This is EXPERIMENTAL proof-of-concept code. Use at your own risk.