Add collapser for the Visual Studio built in profiler
KnapSac opened this issue · comments
Recently, I wanted to create a FlameGraph of the output of the Visual Studio profiler, but as it turns out, there is no stackcollapser for that yet. Since the original project does have a stackcollapser for this profiler, I was wondering if this would be a welcome contribution? I implemented my own stackcollapser before I found out there was an original, so I'd need to check that I haven't missed anything, but besides some polishing (and some tests) I think it should be pretty much good to go.
Absolutely, that'd be great!
If a method calls a few other methods, is the callers sample count the sample counts of the called methods combined?
So if we have a method Run( )
which calls A( )
500 times, and B( )
500 times, the sample count of Run( )
would be 1000, even though Run( )
itself may be called only once?
That depends on the collection format. I think in general the profilers report the number of samples in that function specifically, so if the sample count for A
is 500, and the sample count for Run
is 600, then that means the width of the stack frame for Run
should be 1100 samples wide (and A
's frame on top of that would be 500 wide).
That is what I was getting, both A
and B
were called 500 times, while Run
was called only once, so Run
had 1001 samples. Just wanted to double check that the sample count for Run
was indeed correct :).