Logs Metrics & Traces

How Do You Read a Flame Graph? Axes, Width and the Top Edge

November 22, 2026
7
min read
Logs Metrics & Traces

In a CPU flame graph, each box is a function, and a box’s width is the share of profiler samples in which that function was on the stack, including samples taken while it was waiting on functions it called. The boxes along the top edge are the code that was running on-CPU when each sample fired. The x-axis is not time. Brendan Gregg’s flame graph reference defines it as the stack profile population, sorted alphabetically. Height is stack depth, so a tall tower is a deep call chain and says nothing about cost.

The reading procedure runs in this order: find the root at the bottom, read upward from callers to callees, scan the top edge for frames that were on-CPU, pick the widest plateaus, then hover or search to get exact numbers. Before you act on any of it, check the total sample count and confirm the stacks are intact. A graph built from a few hundred samples or from broken stacks will point you at the wrong function. The sections below cover, in order, a 30-second reading guide, what a flame graph is, its anatomy, self time versus total time, common patterns, a worked Netflix example, colors and interactive features, common misreadings, differential flame graphs, generating graphs with perf and other profilers, how flame graphs compare with icicle graphs, flame charts and call trees, and applying all of this to production work, followed by an FAQ.

How to Read a Flame Graph in 30 Seconds

This is the short version of how to read flame graph output from perf, async-profiler, py-spy or pprof. Run these steps in order on any CPU flame graph:

  1. Find the root. The bottom row is the start of every stack, often a process name, a thread entry point or main. Its width is 100% of the samples in the graph.
  2. Read up the y-axis. Each row up is one level deeper in the call stack. A box sits on top of the function that called it.
  3. Scan the top edge. Any box with nothing above it, or with an exposed strip along its top, was on-CPU in those samples. That exposed strip is where cycles were burned.
  4. Find the widest plateaus. A wide, flat top edge means one stack showed up in a large fraction of samples. Start there, because width is the only dimension that encodes cost.
  5. Hover and search. Mouse over a frame for its details, click it to zoom, and use Ctrl-F to search a function name and see the cumulative percentage of samples that contain it.

What a Flame Graph Is and Why It Beats Raw Profiler Output

A flame graph is a visualization of sampled stack traces in which identical stacks merge into single boxes. A sampling profiler interrupts each CPU at a fixed rate, records the call stack, and counts how many times each unique stack appeared. Gregg’s CACM article gives a typical capture: 99 samples per second for 30 seconds across all CPUs, which on a 16-CPU system produces 47,520 stack samples.

Raw output at that volume is unreadable. perf script prints one multi-line block per sample: an event header, then one line per frame with address, symbol and module, ending in a blank line. Gregg’s perf page notes that perf script output “can be dozens of Mbytes, taking many seconds to process.” perf report coalesces it into an indented tree of percentages, and DTrace prints each unique stack followed by its count. All three formats make you read thousands of lines to find the hot path.

Flame graphs fix this with an intermediate step called folding. stackcollapse-perf.pl reduces each sample to one line, frames joined by semicolons, followed by a count, and sums the counts of identical stacks:

swapper;start_kernel;rest_init;cpu_idle;default_idle;native_safe_halt 1

Because every stack is one line, you can grep a folded file before rendering it. flamegraph.pl then turns each line into a column of boxes whose width tracks the count.

Gregg invented the format while working a production MySQL issue on the Joyent public cloud, where the CACM article describes the database as “consuming around 40% more CPU resources than expected.” He writes on his flame graphs page that the regular profilers “had produced walls of text,” that function tracing perturbed the target too much, and that he switched to timed sampling and dropped time from the x-axis so samples could merge. Flame graphs were released in December 2011.

Anatomy of a Flame Graph: Axes, Boxes and Stack Order

A CPU flame graph encodes three things: stack depth on the y-axis, the sample population on the x-axis, and cost as box width. The fourth signal, the top edge, falls out of the first three: a frame with nothing on top of it was the one executing.

The Y-Axis: Stack Depth from Caller to Callee

The y-axis counts stack depth from zero at the bottom. The root sits on the bottom row, each frame’s caller sits directly beneath it, and leaf functions sit at the top. Gregg’s CPU flame graph page defines it as “stack depth (number of frames on the stack).”

Height carries no cost information. A 40-frame Spring or Tokio stack produces a tall tower even if it accounts for 0.2% of samples. Some tools flip the axis and draw the root at the top; that inverted layout is an icicle graph, and the reading rules are otherwise identical.

The X-Axis: Sample Population Sorted Alphabetically, Not Time

Left-to-right position has no meaning. flamegraph.pl sorts stacks alphabetically by function name, from the root frame upward, so that stacks sharing a prefix land next to each other and merge into one wide box. The CPU flame graph page states it directly: the ordering is “sorted alphabetically to maximize frame merging.”

The alphabetical sort is a direct consequence of sampling. A sampling profiler has gaps between samples, so it never knew the true sequence of calls, and the flamegraph.pl source says as much: “since the data is samples, time order of events is not known.” Sorting by name gives up a timeline the data never had in exchange for merging, which is what makes the hot path visible as one wide box instead of hundreds of slivers.

Box Width and the Top Edge

Box width is proportional to the number of samples in which that frame appeared, whether the function was running itself or one of its descendants was. Gregg’s LISA13 slides put it as “the total time a function was profiled directly or its children were profiled.” Width is a total, not a self measurement.

The top edge shows what was on-CPU. Everything beneath a top-edge frame is its ancestry. In the CACM worked example, g() has the most exposed top edge and is on-CPU the most, while d() is wider “but its exposed top edge is on-CPU the least.”

Width has two limits you need to keep in mind:

  • Call count is invisible: A wide box can mean the function is expensive per call or that it was called more often, and sampling cannot tell you which.
  • Samples can exceed wall time: On a multi-threaded process sampled across CPUs, the total sample count can exceed elapsed time, because several threads were sampled at once.

Self Time vs. Total Time in a Flame Graph

Total time is a box’s full width. Self time is the part of that width with no child box stacked on top of it. The two measurements are the same as Go pprof’s flat and cum: pprof defines flat as “the value of the location itself” and cum as “the value of the location plus all its descendants.”

Here is an illustrative graph built from 100 samples:

[ parse_json 30 ][ hash 20 ]
[ handle_request       70          ][ gc 30         ]
[ main                        100                    ]

handle_request has a total of 70 samples. Its children cover 50 of them (30 + 20), so its self time is the 20-sample strip of handle_request that nothing sits on. main has a total of 100 and a self time of 0, because its children cover its full width. parse_json, hash and gc are leaves, so their self time equals their total.

The practical rule follows from that arithmetic. If you want to know what code to optimize, read the exposed top edges. If you want to know which subsystem owns the cost, read total width lower in the stack. A wide function with a narrow child on top of it, as an InfoQ talk on continuous profiling describes, “can often indicate a lot of self time within that method.”

Speedscope’s Sandwich view lets you sort by self time or total time, and the Firefox DevTools call tree exposes the split as separate Self Time and Total Time columns, which is useful when you need a sorted list instead of a picture.

Flame Graph Patterns: Wide Plateaus, Tall Towers and Thin Spikes

Most CPU flame graphs reduce to a handful of shapes. This table maps each one to its usual cause and the next action:

PatternWhat it looks likeTypical meaningAction
Wide plateauA broad, flat top edgeOne stack was on-CPU in a large fraction of samplesOptimize that function or cut how often it is called
Wide frame, narrow childrenLarge exposed strip along a box’s topHigh self time in that functionProfile inside the function: loops, allocations, inlined callees
Tall, narrow towerMany stacked frames, little widthDeep call chain with low costUsually ignore
Thin spikeSliver a few pixels wideFew samples; may be dropped below 1 pixelClick to zoom or search the name before drawing conclusions
Wide idle framecpu_idle or similar spanning much of the graphThe machine was idleFilter idle stacks with grep -v cpu_idle
Shallow stacks or [unknown] framesFlat graph, towers rooted in [unknown]Broken stack walking or missing symbolsFix frame pointers or symbols before reading further
Same function in many towersOne name repeated across separate columnsCost split by different callersSearch the name to get its combined percentage

The thin-spike row matters more than it looks. Gregg’s YOW 2022 slides note that flame graphs “may drop tiny frames that are <1 pixel wide unless zoomed in, just to speed up rendering.”

Worked Example: Reading a Real CPU Flame Graph Step by Step

Netflix engineers used this reading sequence to remove an unneeded legacy call from a high-traffic service, a case written up in the Netflix Technology Blog.

  1. Capture under real load. The team profiled with Linux perf_events on live production instances, so the samples reflected production traffic instead of a synthetic benchmark.
  2. Search before reading tower by tower. Searching for the service’s matching package attributed more than 30% of samples to it, but the matching frames were split across several towers, so no single box looked dominant. This is the “same function in many towers” pattern from the table above.
  3. Merge the scattered cost. After the stacks were reshaped so the matching frames grouped together, the matching stacks accounted for almost 44% of CPU samples. The cost had been there all along, spread across callers.
  4. Find the widest frame worth questioning. Inside that group, one method stood out: a call into legacy functionality, highlighted as matching 25% of CPU samples.
  5. Verify before changing code. The engineers confirmed the method no longer returned distinct results. A dynamic flag already gated it, so they disabled it in a canary cluster, where they saw a drop in CPU usage and request latency.
  6. Re-profile. A new flame graph showed the package falling to 18% of CPU samples, and the removed method matching a fraction of a percent.

Netflix calculated that the change reduces the service’s CPU time by more than 13 million minutes, almost 25 years, per day. These results come from one Netflix service and workload, so figures on your own services will vary with your traffic and cluster conditions; validate them against your own workloads. One caution when you reuse these numbers: the 30%, 44%, 25% and 18% figures come from different flame graphs and stack views, so read them as a diagnostic sequence, not as one before/after pair.

Step 5 is the part most write-ups skip. The flame graph told the team where cycles went; it did not tell them the method was safe to remove. That proof came from checking the method’s output and from the canary.

Color and interactivity are presentation layers on top of the same width-and-depth data. Neither changes what a box means.

What Flame Graph Colors Mean

In the default palette, color means nothing. The CPU flame graph page says “the colors aren’t significant, and are usually picked at random to be warm colors.” Random hues exist only to separate adjacent frames. The warm palette came from the name: Gregg picked warm colors because they “explained why the CPUs were ‘hot’ (busy).” A red box is no hotter than an orange one, and only width encodes cost.

Some palettes do assign meaning. flamegraph.pl --colors accepts hot (the default), mem, io, wakeup, chain, java, js, perl and several flat colors. With --color=java and annotated input from stackcollapse-perf.pl --all, the FlameGraph README gives the mapping: green for Java, yellow for C++, red for user-mode native code, orange for kernel. Gregg’s YOW 2022 slides add aqua for inlined frames and magenta for search matches. --hash keys colors to a hash of the function name, which keeps colors stable between runs. Differential flame graphs are the one case where color carries a value; that encoding is covered in the differential section below.

flamegraph.pl writes an SVG with an embedded script, so you need to open it in a browser rather than an image viewer. The interactive controls are:

  • Hover: Mouse over a frame to see its details in the status bar.
  • Click to zoom: Clicking a box zooms the graph to that frame, which widens thin frames until they are readable. The embedded script includes a zoom reset that restores the full graph.
  • Search: Press Ctrl-F or click the search button, enter a regular expression, and every matching frame is highlighted. Search is case sensitive by default; Ctrl-I toggles that.
  • Matched share: Search reports the cumulative percentage of stacks that include the term, which is how you total a function that appears in many towers.

The SVG also restores zoom and search state from URL parameters, so you can share a link to a zoomed, searched view. Other viewers expose the same moves with different keys. In speedscope, + and - zoom, 0 zooms out to the whole profile, and Cmd+F or Ctrl+F opens search. The d3-flame-graph plugin used by pprof’s web UI has a resetZoom() call, and its default search handler reports the matched sample sum, total samples and percentage.

Common Flame Graph Misreadings and How to Correct Them

Four misreadings account for most wrong conclusions from flame graphs. Each one has a direct correction.

Misconception: the x-axis is a timeline. A frame on the left did not run first. The alphabetical sort means decode left of encode says nothing about order. If your question is about sequence, such as a pause every few seconds or a slow startup phase, use a flame chart, which keeps time on the x-axis, or Netflix’s FlameScope, which lets you select a time range on a subsecond heat map and builds a flame graph for that range.

Misconception: a tall tower is expensive. Height is stack depth. A deep tower that is narrow is cheap. Compare widths only, and remember that width includes children.

Misconception: a wide box is the function to optimize. Width is total time. A wide handle_request can have almost no self time, with every sample spent in its children. Read the exposed top edge to find self time, as in the 70-sample example earlier. The CACM article’s d() case is the canonical example: widest box, least time on-CPU.

Misconception: any flame graph is a reliable profile. Check the sample count first. flamegraph.pl prints the warning “Stack count is low ($time). Did something go wrong?” when a samples-based input totals under 100.

  • Gregg’s YOW 2022 slides suggest checking the sample count on the bottom frame and give a rule of thumb: on a 16-CPU host profiled for 30 seconds, “<500 samples total would mean <2% busy and probably not interesting!” Low counts mean an idle system or a failed capture, and a frame that received a handful of samples has a wide relative error.
  • A USENIX OSDI ‘26 paper adds a harder limit: for flat workloads with short-lived functions, even at the highest sampling rates, perf captured only 62% of the functions.
  • Broken stacks are a fifth trap. Gregg’s frame pointer post describes a profile where about 15% of samples sat above [unknown] in the wrong place because libc was built without frame pointers, a problem that “usually goes unnoticed as the flame graph looks ok at first glance.” The fixes are in the generation section below.

Spotting Performance Regressions with Differential Flame Graphs

A differential flame graph takes two folded profiles, sizes the boxes by the second one, and colors each frame by how its sample count changed: red where it grew, blue where it shrank, with color intensity showing the size of the change. You can see “what changed between the release that was fine and the one that isn’t” without flipping between two SVGs.

difffolded.pl joins the two folded files into three columns: the stack, its count in profile 1, and its count in profile 2. A stack missing from one file gets a zero. Capture the “before” and “after” profiles under comparable load, fold each with stackcollapse-perf.pl into out.folded1 and out.folded2, and run this from the FlameGraph directory. It writes a graph sized by the after profile and colored by what changed:

./difffolded.pl -n out.folded1 out.folded2 | ./flamegraph.pl > diff2.svg

The -n flag scales the first profile’s counts by the ratio of the two totals. Without it, a profile taken during heavier traffic paints the whole graph red, and one taken during lighter traffic paints it blue, which hides the code paths that changed. Gregg’s differential flame graph post describes -n as balancing the first profile “so you get the full red/blue spectrum.”

The default view has a blind spot. If a code path disappeared entirely in the second profile, it has no width, so there is nothing to color blue. To see what went away, reverse the inputs and negate the colors. This command sizes the graph by the before profile and colors it by what will happen:

./difffolded.pl -n out.folded2 out.folded1 | ./flamegraph.pl --negate > diff1.svg

Generate both SVGs for any regression review. Memory addresses that differ between builds can also show up as false differences; the current repository strips hex addresses with -s, while the 2014 blog post names the flag -x, so check ./difffolded.pl -h on your checkout. If you profile Java, async-profiler’s jfrconv builds a differential graph from two JFR recordings:

jfrconv --cpu --diff baseline.jfr new.jfr diff.html

Generating a Flame Graph with perf and the FlameGraph Scripts

The perf pipeline has four stages: record stack samples, dump them as text, fold identical stacks, and render the SVG. You can also use a language-specific profiler, but either approach needs intact stacks and function names.

Profiling with perf requires privileges. The kernel’s perf_event_paranoid sysctl defaults to 2, which disallows kernel profiling for users without CAP_PERFMON, and system-wide capture with -a is normally root-only.

Since Linux 5.8, CAP_PERFMON is the least-privilege grant for perf; on older kernels, or for a quick capture on a host you control, run perf with sudo as shown. Ubuntu also defines a stricter level 4. If a command fails with a permissions error, check your profiling privileges.

  1. Clone the scripts and work from that directory. This fetches stackcollapse-perf.pl, flamegraph.pl and difffolded.pl:
git clone https://github.com/brendangregg/FlameGraph
cd FlameGraph
  1. Record stack samples. This samples every CPU (-a) at 99 Hz (-F 99) for 60 seconds, recording call graphs (-g) into perf.data:
sudo perf record -F 99 -a -g -- sleep 60
  1. Dump the samples as text. This writes one multi-line stack block per sample to out.perf:
sudo perf script > out.perf
  1. Fold identical stacks. This collapses each stack to one semicolon-joined line with a count:
./stackcollapse-perf.pl out.perf > out.folded
  1. Render the SVG. This draws the folded stacks as an interactive flame graph you open in a browser:
./flamegraph.pl out.folded > perf.svg

The rate is 99 Hz rather than 100 Hz to avoid lockstep sampling, where the profiler fires in sync with a periodic task in the workload and skews the result. Gregg’s perf CPU sampling post calls 99 Hz overhead “negligible”; you can go up to 997 Hz for short bursts of activity at the cost of more overhead.

To profile one process instead of the whole host, replace -a with -p PID. If idle stacks crowd the graph, pipe the folded output through grep -v cpu_idle before flamegraph.pl.

Two variations are worth knowing. On Linux 4.5 and later, perf report can emit folded stacks directly and skip the CPU-costly collapse step (Gregg’s perf page gives 4.4 for the same feature):

sudo perf report --stdio -n -g folded

Gregg’s LISA 2017 container slides used docker run --cap-add sys_admin and set kptr_restrict to 0 for kernel symbols, and noted that setting perf_event_paranoid to -1 alone did not fix it.

Other Profilers That Output Flame Graphs

Most language runtimes have a profiler that renders flame graphs directly, without the perf pipeline. These were the current releases as of November 2026:

  • async-profiler (Java): Version 4.6 is the latest release, dated October 19, 2026, with commits as recent as November 19, 2026. This runs a 30-second profile of a JVM and writes an interactive HTML flame graph:
  • py-spy (Python): v0.4.3 is marked latest on the releases page; the README lists support for CPython 2.3–2.7 and 3.3–3.15. This samples a running Python process and writes an interactive SVG:
  • Go pprof: Go 1.27 shipped on August 19, 2026. Since Go 1.26, the pprof web UI opens on the flame graph view by default. With net/http/pprof imported in your service, this fetches a 30-second CPU profile and serves the web UI:
  • 0x (Node.js): The latest release is 6.0.0, published July 7, 2025, which is also the date of the most recent commit, and the npm page lists Node v20.x and above. With no activity since then, active maintenance cannot be confirmed. This profiles a script and writes a <pid>.0x folder containing flamegraph.html when the process exits on SIGINT or SIGTERM:

Fixing Broken Stacks and Missing Function Names

Broken stacks show up as shallow towers, towers rooted in [unknown], or hex addresses where function names belong. The causes are missing frame pointers, stripped symbols, and JIT-compiled code that perf cannot name. Each has a specific fix.

Frame Pointers

perf walks user stacks with frame pointers by default, and GCC omits them from 64-bit code unless told otherwise. Rebuild with -fno-omit-frame-pointer. Gregg reports that adding frame pointers to everything, libc and Java included, usually cost under 1%, with one 10% outlier. Distributions have moved: Fedora 38 added -fno-omit-frame-pointer and -mno-omit-leaf-frame-pointer to its default flags, Ubuntu 24.04 LTS enabled frame pointers by default on 64-bit platforms (Canonical measured a 1–2% penalty in most cases and kept them off where the impact was high, such as the Python interpreter), and Arch’s devtools added the flags in February 2024. Your own binaries still need the flag.

DWARF Unwinding

When you can’t rebuild, perf can unwind from debug info:

sudo perf record -F 99 -a --call-graph dwarf -- sleep 10
  • This copies a user stack dump with every sample, 8192 bytes by default and adjustable as --call-graph dwarf,4096, then unwinds in user space.
  • Fedora’s frame pointer proposal describes the overhead as “very high,” so use it for short captures.
  • Hardware LBR (--call-graph lbr) needs no compiler changes but is limited to recent Intel CPUs, user stacks only, and Gregg notes it is disabled in most cloud environments.

Debug Symbols

Distribution binaries are usually stripped. Install your distribution’s debug symbol packages for the libraries and runtimes in your hot paths, including libjvm.so for Java.

Java

The JVM uses the frame pointer register as a general-purpose register and does not expose a symbol table for JIT-compiled methods, so plain perf shows hex addresses and broken stacks. Start the JVM with -XX:+PreserveFramePointer (available since JDK 8u60) and write a perf map file so perf can name JIT frames. On recent JDKs (the JDK 24 and JDK 27 jcmd references document it), the JVM writes /tmp/perf-<pid>.map itself:

jcmd <pid> Compiler.perfmap

The map is a snapshot, so methods compiled or unloaded after you run it won’t be named; run it right before perf record. The older perf-map-agent does the same job as an attached agent, but its README calls the code “very experimental,” and its current maintenance status is unclear. async-profiler avoids both problems because it pairs perf events with the JVM’s AsyncGetCallTrace and does not need -XX:+PreserveFramePointer.

Node.js

V8’s --perf-basic-prof writes a /tmp/perf-PID.map file that perf uses to name JavaScript frames. The Node.js flame graph guide records this way:

perf record -e cycles:u -g -- node --perf-basic-prof --interpreted-frames-native-stack app.js

The map file grows without bound, which can fill disks on long-running processes. In production, use --perf-basic-prof-only-functions, which writes less output. These flags are Linux-only.

Flame Graphs vs. Icicle Graphs, Flame Charts and Call Trees

These four views draw the same stack samples in different ways, and the choice depends on whether you need aggregate cost or sequence. The table compares them:

ViewX-axis meaningOrientationTime orderingBest use
Flame graphSample population, sorted alphabeticallyRoot at bottom, leaves at topNone; identical stacks mergeFinding the hottest code paths; multi-threaded profiles
Icicle graphSame population axis as a flame graphRoot at top, leaves belowNoneVery deep stacks, where the root stays on screen without scrolling
Flame chart (Chrome DevTools)Time over the recordingRoot activities at topPreserved; repeated calls don’t mergeTime-based patterns in a single thread
Call tree (Chrome DevTools Call Tree tab)No axis; nested list of root activitiesRoot activities as top-level itemsNot time-orderedFinding which activity causes the most work in a selected range
speedscope Left HeavyStack weight, heaviest stack per parent on the leftNot statedNone; identical stacks groupedMany interleaved calls where you need where the time went

Flame charts trade merging for sequence. Gregg’s flame graphs page points out that multi-threaded applications “can’t be shown sensibly by a single flame chart,” because each thread’s timeline fragments the same function into many separate bars. In flamegraph.pl, --inverted draws an icicle graph and --flamechart sorts by time without merging. Speedscope’s default Time Order view is a flame chart; switch to Left Heavy (key 2) for a flame-graph-style aggregate.

Applying Flame Graph Reading to Production Performance Work

A flame graph is only as good as the capture behind it. Run through this checklist before you act on one:

  • Confirm the total sample count is high enough to be worth reading, using the bottom frame or the file total.
  • Look for [unknown] frames, hex addresses and suspiciously shallow towers, and fix stacks before interpreting widths.
  • Read exposed top edges for self time and full widths for subsystem cost.
  • Search for any function that appears in several towers to get its combined share.
  • Zoom into thin frames before dismissing them.
  • Never infer order from left-to-right position; switch to a flame chart or FlameScope for time questions.
  • For regressions, compare normalized differential graphs in both directions.
  • Validate a fix by re-profiling and by measuring latency or CPU in a canary, as Netflix did.

A CPU flame graph tells you which code burns cycles in one process. It doesn’t tell you which endpoint, pod or deployment drove that load, or whether the latency your users saw came from CPU at all. That context usually decides where you point the profiler. groundcover’s eBPF sensor runs as a Kubernetes DaemonSet, one pod per node, and collects traces, logs and golden-signal metrics without SDKs or code changes, with each signal tied to its workload, namespace and node. You can use that view to find the service and pod whose latency or CPU moved after a rollout, then run perf record -p or async-profiler against that pod to see the code path responsible. Process inspection and profiling commands like these may require host access or additional permissions, and perf in particular can need CAP_PERFMON, so a permissions error points to access rather than a mistake in the command.

If you want to try that workflow on your own cluster, the groundcover free plan includes Bring Your Own Cloud (BYOC) and requires no credit card. The groundcover MCP Server also gives compatible AI agents access to the same logs, traces, metrics and Kubernetes events, which helps when you want that context inside an IDE or incident channel while you profile.

FAQs

The x-axis spans the population of stack samples, sorted alphabetically so identical stacks merge. It does not represent time, and a frame’s horizontal position carries no information. Only width does.

Total time is the full width of a box, including samples spent in its children. Self time is the part of the box’s width with no child on top of it, which is the code that was on-CPU in that function.

In the default palette, no. Colors are random warm hues that separate adjacent frames. Language palettes such as --color=java assign hues by code type, and differential graphs use red for growth and blue for reduction.

A flame graph sorts and merges stacks to show aggregate cost. A flame chart, such as the Chrome DevTools Performance panel, puts time on the x-axis and keeps every call in sequence, so it shows when things happened but merges nothing.

Stack walking failed or symbols are missing. Rebuild with -fno-omit-frame-pointer, record with --call-graph dwarf, install debug symbols, or for JIT runtimes generate a perf map with jcmd <pid> Compiler.perfmap or Node’s --perf-basic-prof-only-functions.

Fold both profiles and run difffolded.pl -n to build a differential flame graph, then build the reversed, --negate version to see code paths that disappeared.

No published threshold guarantees statistical reliability. flamegraph.pl warns below 100 samples, and Gregg’s rule of thumb treats fewer than 500 samples on a 16-CPU, 30-second capture as a mostly idle system. Total samples scale with sampling rate times duration times busy CPUs, so lengthen the capture or raise the rate when narrow frames matter, and treat any frame built from a handful of samples as uncertain.

Sign up for Updates

Keep up with all things cloud-native observability.

We care about data. Check out our privacy policy.