Flamegraph is literally just a perl script that visualizes the stack traces collected by perf/dtrace (kernel). It's a good tool though but it doesn't need to be oversold for its capabilities, the hard work is done by the kernel. And honestly, many times it is not that useful at all and can be quite misleading, and not because of the bug in the tool but because how CPUs are inherently designed to work.
Everything is just a script with some visualization once you come up with the concept.