[llvm-gsymutil] Fix tracking of currently open file
authorVictor Michel <vic.michel.web@gmail.com>
Tue, 4 Oct 2022 00:48:20 +0000 (17:48 -0700)
committerShoaib Meenai <smeenai@fb.com>
Tue, 4 Oct 2022 00:49:12 +0000 (17:49 -0700)
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

llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp

index 4eaab07..4769546 100644 (file)
@@ -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;