Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for "Invert Call Tree" Xcode Instruments output #314

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ZPedro
Copy link

@ZPedro ZPedro commented Oct 12, 2023

Why?

When the "Invert Call Tree" setting is on in Instruments, the resulting output does not have reliable "Self Weight" columns: they only contain "0 s" past depth 1. This adds a new mode, as a new "--inverted" option to stack collapse-instruments.pl, to enable processing this format.

No, I mean, why not just process the regular Instruments format and invert it using the --reverse option of flamegraph.pl?

That is preferable in general: this --inverted option instead relies on "Weights", which requires some adjustments to the values therein, including potential roundoff inaccuracies. However in some cases it is worth relying on data mining performed by Instruments, some of which works better when it is itself responsible for the inversion. For instance, Instruments has an option to collapse a library to its boundary frames; in regular mode, the library frames are collapsed to the library entry point (represented by the attached nonreg.svg), while in "Invert Call Tree" mode the same frames are collapsed to their topmost frame, which is often more interesting (represented by the attached time-reduced-self-node-calls.svg ; that one was further reversed by flamegraph.pl for better comparison).

nonreg

time-reduced-self-node-calls

- improved processing so that forgetting to remove the blank lines at the end does not result in missing stacks in the output
- added compensation for roundoff issues in order to avoid negative weights
inverted is now an option of stackcollapse-instruments.pl; stackcollapse-instruments-inverted.pl has been removed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant