I’ve developed a script (here: https://gist.github.com/DJRickyB/ee0bfd732af64aa44ad8421fa0d9d5ca) that parses thread profile JSON and outputs collapsed txt compatible with FlameGraphs (https://github.com/brendangregg/FlameGraph) (… actually it outputs two files, one for what i think is CPU and one for what i think is WAIT).
(a) can anyone validate assumptions being made in this script or point me to a schema for the data in this JSON file?
(b) i noticed even after for accounting for stacks that may have not been as deep as others that i don’t seem to find anything at the top other than the furthest leaves of the stack. to give an example, if I were to use the following as my collapsed.txt and run
flamegraph.pl collapsed.txt > test.svg the following occurs:
note the red area, which indicates time spent in method1 and NOT in method2. it seems unlikely that this would not occur in the real world so i wonder if a given branch’s values are ONLY the sum of its leaves, rather than its own count. could be interesting that a bunch of execution times are getting dropped because there are times when the stack goes deeper