This is an archive of the discontinued LLVM Phabricator instance.

Add the ability to segment GSYM files.
ClosedPublic

Authored by clayborg on Mar 6 2023, 3:58 PM.

Details

Summary

Some workflows can generate large GSYM files and sharding GSYM files into segments can help some performant workflows that can take advantage of smaller GSYM files. This patch add a new --segment-size option to llvm-gsymutil. This option can specify a rough size in bytes of how large each segment should be.

Segmented GSYM files contain only the strings and files that are needed for the FunctionInfo objects that are added to each shard. The output file path gets the first address of the first contained function info appended as a suffix to the filename. If a base address of an image is set in the GsymCreator, then all segments will use this same base address which allows lookups for symbolication to happen correctly when the image has been slid in memory.

Code has been addeed to refactor and re-use methods within the GsymCreator to allow for segments to be created easily and tested.

Example of segmenting GSYM files:

$ llvm-gsymutil --convert llvm-gsymutil.dSYM -o llvm-gsymutil.gsym --segment-size 10485760
$ ls -l llvm-gsymutil.gsym-*
-rw-r--r-- 1 gclayton staff 10485839 Feb 9 10:45 llvm-gsymutil.gsym-0x1000030c0
-rw-r--r-- 1 gclayton staff 10485765 Feb 9 10:45 llvm-gsymutil.gsym-0x100668888
-rw-r--r-- 1 gclayton staff 10485881 Feb 9 10:45 llvm-gsymutil.gsym-0x100c948b8
-rw-r--r-- 1 gclayton staff 10485954 Feb 9 10:45 llvm-gsymutil.gsym-0x101659e70
-rw-r--r-- 1 gclayton staff 10485792 Feb 9 10:45 llvm-gsymutil.gsym-0x1022b1dc0
-rw-r--r-- 1 gclayton staff 10485889 Feb 9 10:45 llvm-gsymutil.gsym-0x102a18b10
-rw-r--r-- 1 gclayton staff 10485893 Feb 9 10:45 llvm-gsymutil.gsym-0x1030b05d0
-rw-r--r-- 1 gclayton staff 10485802 Feb 9 10:45 llvm-gsymutil.gsym-0x1037caaac
-rw-r--r-- 1 gclayton staff 10485781 Feb 9 10:45 llvm-gsymutil.gsym-0x103e767a0
-rw-r--r-- 1 gclayton staff 10485832 Feb 9 10:45 llvm-gsymutil.gsym-0x10452d0d4
-rw-r--r-- 1 gclayton staff 10485782 Feb 9 10:45 llvm-gsymutil.gsym-0x104b93310
-rw-r--r-- 1 gclayton staff 6255785 Feb 9 10:45 llvm-gsymutil.gsym-0x10526bf34

Diff Detail

Event Timeline

clayborg created this revision.Mar 6 2023, 3:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2023, 3:58 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
clayborg requested review of this revision.Mar 6 2023, 3:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2023, 3:58 PM
clayborg updated this revision to Diff 502847.Mar 6 2023, 4:01 PM

Add fixes for buildbots where some compilers don't need a std::move(), but some do.

This is a resubmission of https://reviews.llvm.org/D143793. I added fixes for the buildbots

yinghuitan accepted this revision.Mar 6 2023, 4:07 PM
This revision is now accepted and ready to land.Mar 6 2023, 4:07 PM
This revision was landed with ongoing or failed builds.Mar 6 2023, 4:08 PM
This revision was automatically updated to reflect the committed changes.
chapuni added a subscriber: chapuni.Mar 6 2023, 6:10 PM
chapuni added inline comments.
llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
126

MaxAddressOffset is used only here.