brendangregg / FlameGraph

Stack trace visualizer
http://www.brendangregg.com/flamegraphs.html
17.46k stars 1.97k forks source link

use function input parameter as period for perf #328

Open zhongsheng94 opened 9 months ago

zhongsheng94 commented 9 months ago

When using perf probe to analyze memory leaks, the output results may include the memory application size.

perf probe output example

a.out 423699/423721 [000] 515038.551407: probe_libc:malloc: (560024aaf2d9) bytes=0xf0

This PR attempts to use this size information. The width of the flame graph in this way represents the requested memory size rather than the number of times.

Inspired by https://github.com/brendangregg/BPF-tools/blob/master/old/2017-12-23/mallocstacks.py