[PATCH] D102219: Optimize GSymCreator::finalize.

Simon Giesecke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 12 12:27:00 PDT 2021


simon.giesecke added a comment.

In D102219#2754679 <https://reviews.llvm.org/D102219#2754679>, @clayborg wrote:

> In D102219#2753742 <https://reviews.llvm.org/D102219#2753742>, @simon.giesecke wrote:
>
>> In D102219#2752199 <https://reviews.llvm.org/D102219#2752199>, @clayborg wrote:
>>
>>> There are unit tests that could be added if you would like to test a bad case, but existing unit tests should still pass with this.
>>
>> I had a look at the test cases in llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp. The TestDWARF* test cases seem to provide a template for such a test, but unfortunately I am not familiar with the details of DWARF to come up with a representative test case. With some advice, I could do that in another patch?
>
> No worries. We have existing tests that catch this. But just to clarify, you ran llvm-gsymutil on a GCC binary that caused a major slowdown. It would be great if you could verify that if you run llvm-gsymutil with "--num-threads=1" using the current llvm-gsymutil and with the modified llvm-gsymutil, can you verify that they binaries match? If they don't then we do need to add a test. You have to run with --num-threads=1 to make sure threading doesn't make things change in the final GSYM. So if you can run this test for me and verify things match up, then I will commit this diff.

Sure. I checked this with a gcc-built ninja, there are no differences:

  [sgiesecke at DEVVM-sgiesecke ninja]$ diff buildDebug/ninja.gsym.new buildDebug/ninja.gsym.orig 
  [sgiesecke at DEVVM-sgiesecke ninja]$ 

The baseline version produced lots of warnings such as:

  warning: duplicate function info entries for range: [0x0000000000429ef4 - 0x0000000000429f0e)
  warning: duplicate function info entries for range: [0x0000000000429f0e - 0x0000000000429f3f)

while the version with my patch didn't produce any warnings:

  [sgiesecke at DEVVM-sgiesecke ninja]$ llvm-gsymutil --num-threads 1 --convert buildDebug/ninja
  Input file: buildDebug/ninja
  Output file (x86_64): buildDebug/ninja.gsym
  Loaded 5424 functions from DWARF.
  Loaded 11 functions from symbol table.
  Pruned 2485 functions, ended with 2950 total


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102219/new/

https://reviews.llvm.org/D102219



More information about the llvm-commits mailing list