[PATCH] D143793: Add the ability to segment GSYM files.

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 10 16:17:53 PST 2023


clayborg created this revision.
clayborg added reviewers: GeorgeHuyubo, yinghuitan, avl, ayermolo.
Herald added a subscriber: hiraditya.
Herald added a project: All.
clayborg requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D143793

Files:
  llvm/include/llvm/DebugInfo/GSYM/FileWriter.h
  llvm/include/llvm/DebugInfo/GSYM/FunctionInfo.h
  llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h
  llvm/include/llvm/DebugInfo/GSYM/LookupResult.h
  llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp
  llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
  llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp
  llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143793.496625.patch
Type: text/x-patch
Size: 36678 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230211/3d749e88/attachment.bin>


More information about the llvm-commits mailing list