Page MenuHomePhabricator

[llvm-objdump][CallGraphInfo] Parse .callgraph section
AcceptedPublic

Authored by necipfazil on Jul 28 2021, 9:53 PM.

Details

Summary

Parse the .callgraph section for indirect call graph information. Print type
identifier mappings for indirect calls and targets.

Patch 6/6: Extract call graph information from binary

Original RFC: https://lists.llvm.org/pipermail/llvm-dev/2021-June/151044.html
Updated RFC: https://lists.llvm.org/pipermail/llvm-dev/2021-July/151739.html

Diff Detail

Unit TestsFailed

TimeTest
120 msx64 windows > LLVM.tools/llvm-objdump/ELF::call-graph-info-callgraph-section-warnings.test
Script: -- : 'RUN: at line 4'; c:\ws\w7\llvm-project\premerge-checks\build\bin\llvm-mc.exe C:\ws\w7\llvm-project\premerge-checks\llvm\test\tools\llvm-objdump\ELF\call-graph-info-callgraph-section-warnings.test -filetype=obj -triple=x86_64-pc-linux -o C:\ws\w7\llvm-project\premerge-checks\build\test\tools\llvm-objdump\ELF\Output\call-graph-info-callgraph-section-warnings.test.tmp
70 msx64 windows > LLVM.tools/llvm-objdump/ELF::call-graph-info-err-invalid-format-version.test
Script: -- : 'RUN: at line 4'; c:\ws\w7\llvm-project\premerge-checks\build\bin\llvm-mc.exe C:\ws\w7\llvm-project\premerge-checks\llvm\test\tools\llvm-objdump\ELF\call-graph-info-err-invalid-format-version.test -filetype=obj -triple=x86_64-pc-linux -o C:\ws\w7\llvm-project\premerge-checks\build\test\tools\llvm-objdump\ELF\Output\call-graph-info-err-invalid-format-version.test.tmp
80 msx64 windows > LLVM.tools/llvm-objdump/ELF::call-graph-info-err-invalid-func-entry.test
Script: -- : 'RUN: at line 4'; c:\ws\w7\llvm-project\premerge-checks\build\bin\llvm-mc.exe C:\ws\w7\llvm-project\premerge-checks\llvm\test\tools\llvm-objdump\ELF\call-graph-info-err-invalid-func-entry.test -filetype=obj -triple=x86_64-pc-linux -o C:\ws\w7\llvm-project\premerge-checks\build\test\tools\llvm-objdump\ELF\Output\call-graph-info-err-invalid-func-entry.test.tmp
70 msx64 windows > LLVM.tools/llvm-objdump/ELF::call-graph-info-err-invalid-func-kind.test
Script: -- : 'RUN: at line 4'; c:\ws\w7\llvm-project\premerge-checks\build\bin\llvm-mc.exe C:\ws\w7\llvm-project\premerge-checks\llvm\test\tools\llvm-objdump\ELF\call-graph-info-err-invalid-func-kind.test -filetype=obj -triple=x86_64-pc-linux -o C:\ws\w7\llvm-project\premerge-checks\build\test\tools\llvm-objdump\ELF\Output\call-graph-info-err-invalid-func-kind.test.tmp
70 msx64 windows > LLVM.tools/llvm-objdump/ELF::call-graph-info-err-malformed-callgraph-section.test
Script: -- : 'RUN: at line 3'; c:\ws\w7\llvm-project\premerge-checks\build\bin\llvm-mc.exe C:\ws\w7\llvm-project\premerge-checks\llvm\test\tools\llvm-objdump\ELF\call-graph-info-err-malformed-callgraph-section.test -filetype=obj -triple=x86_64-pc-linux -o C:\ws\w7\llvm-project\premerge-checks\build\test\tools\llvm-objdump\ELF\Output\call-graph-info-err-malformed-callgraph-section.test.tmp
View Full Test Results (8 Failed)

Event Timeline

necipfazil created this revision.Jul 28 2021, 9:53 PM
necipfazil requested review of this revision.Jul 28 2021, 9:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2021, 9:53 PM
morehouse added inline comments.Jul 29 2021, 3:46 PM
llvm/tools/llvm-objdump/llvm-objdump.cpp
2154

We probably want sorted maps to avoid tests breaking in the future.

necipfazil marked an inline comment as done.

Use stable iteration order and adapt tests

Use MapVector instead of DenseMap for structs that would break the tests
in the future due to unstable iteration order.

This revision is now accepted and ready to land.Jul 29 2021, 4:11 PM

Apologies, I haven't had a chance to get back to this or the rest of the patch series, and I'm off work next week, so won't be able to until after getting back.

It might be worth trying to get some people to comment on your upstream RFC and see if they are happy for the additional functionality to be added.