jonhoo / inferno

A Rust port of FlameGraph

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feature request - implement skip_after

romange opened this issue · comments

Or k bottom frames if you consider flamegraph order.

The attached image demonstrates the problem. The process threads have different names, but besides this they are completely homogenous. I would like to have an option of skipping k root frames in order to merge relevant stacks together and reduce unneeded noise.

image

I've run into this in the past too, but I don't think top/bottom k frames is actually good enough because every now and again you'll end up with two stacks that are "the same" (as yours are above), but where the differentiating bottoms are of different heights. For example, in tokio, depending on whether a future runs on a worker as part of regular execution, or after having been stolen from another worker, the distance from the bottom will differ by 1: the "steal" function. If you wanted to look at where the cycles in your futures are going, what you'd really want is "strip everything up to a frame by this name" rather "strip the k first frames". Basically something like a skip_until. And I think that'd work for your case too?

Any chance you have time to write up a PR?

Hi @jonhoo. I've written up the PR. would you mind taking a look? i am new to rust so don't be shy with comments :)