-
Notifications
You must be signed in to change notification settings - Fork 256
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
Disassembly: per-instruction cost is not shown for inlined code #671
Labels
Comments
This was referenced Sep 2, 2024
milianw
added a commit
that referenced
this issue
Sep 2, 2024
Previously, we put the cost of an inline frame into a container indexed by the inline symbol. But during disassembly, we never get to query that data again, since we cannot disassemble an inline frame. Instead, we need to be able to query the cost for arbitrary binary offsets, independent of their originating symbol. The patch here achieves this by lifting the OffsetLocationCostMap out of the CallerCalleeEntryMap into CallerCalleeResults, but mapped by the binary name. This way we can efficiently store and lookup the data of a given offset within a specific binary during disassembly, which allows us to show the cost for inlined code in the disassembly view. Fixes: #671
milianw
added a commit
that referenced
this issue
Sep 2, 2024
Previously, we put the cost of an inline frame into a container indexed by the inline symbol. But during disassembly, we never get to query that data again, since we cannot disassemble an inline frame. Instead, we need to be able to query the cost for arbitrary binary offsets, independent of their originating symbol. The patch here achieves this by lifting the OffsetLocationCostMap out of the CallerCalleeEntryMap into CallerCalleeResults, but mapped by the binary name. This way we can efficiently store and lookup the data of a given offset within a specific binary during disassembly, which allows us to show the cost for inlined code in the disassembly view. Fixes: #671
milianw
added a commit
that referenced
this issue
Sep 5, 2024
Previously, we put the cost of an inline frame into a container indexed by the inline symbol. But during disassembly, we never get to query that data again, since we cannot disassemble an inline frame. Instead, we need to be able to query the cost for arbitrary binary offsets, independent of their originating symbol. The patch here achieves this by lifting the OffsetLocationCostMap out of the CallerCalleeEntryMap into CallerCalleeResults, but mapped by the binary name. This way we can efficiently store and lookup the data of a given offset within a specific binary during disassembly, which allows us to show the cost for inlined code in the disassembly view. Fixes: #671
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When disassembling functions containing inlined code, the disassembly view does not show per-line/instruction costs for code inlined from other functions.
To Reproduce
Steps to reproduce the behavior:
Compile this program with
gcc -g -O2 -o fib main.c
:Then profile the binary using Hotspot and open the disassembly view for
main
.Expected behavior
The disassembly view should show per-line/instruction costs even for inlined code.
Screenshots
The profile in
perf report
:The same profile in Hotspot's disassembly view:
If I compile with
-fno-inline
and disassemblefib
instead, the costs show as expected:Version Info (please complete the following information):
Additional context
Originally found while profiling Go code, but it seems Go and C binaries behave the same here.
The text was updated successfully, but these errors were encountered: