[llvm] 9cf60d8 - [llvm-gsymutil] Fix tracking of currently open file

Shoaib Meenai via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 3 17:49:52 PDT 2022


Author: Victor Michel
Date: 2022-10-03T17:49:12-07:00
New Revision: 9cf60d8479e2eef3a8881c166b82f8db639fcd9e

URL: https://github.com/llvm/llvm-project/commit/9cf60d8479e2eef3a8881c166b82f8db639fcd9e
DIFF: https://github.com/llvm/llvm-project/commit/9cf60d8479e2eef3a8881c166b82f8db639fcd9e.diff

LOG: [llvm-gsymutil] Fix tracking of currently open file

Prior to this change, `CurrentGSYMPath` was never updated. As a consequence, the GSYM file was reopened for every frame, even if all frames were relative to the same GSYM file.

This change brings a 13x speedup on a test I'm doing (symbolizing ~25K frames from libxul)

(This is my first-ever LLVM change - sorry if I missed something in the process!)

Reviewed By: simon.giesecke, clayborg

Differential Revision: https://reviews.llvm.org/D132912

Added: 
    

Modified: 
    llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp b/llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp
index 4eaab07e60119..476954668b5ab 100644
--- a/llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp
+++ b/llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp
@@ -496,6 +496,7 @@ int main(int argc, char const *argv[]) {
         CurrentGsym = GsymReader::openFile(GSYMPath);
         if (!*CurrentGsym)
           error(GSYMPath, CurrentGsym->takeError());
+        CurrentGSYMPath = GSYMPath;
       }
 
       uint64_t Addr;


        


More information about the llvm-commits mailing list