From 9cf60d8479e2eef3a8881c166b82f8db639fcd9e Mon Sep 17 00:00:00 2001 From: Victor Michel Date: Mon, 3 Oct 2022 17:48:20 -0700 Subject: [PATCH] [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 --- llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp b/llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp index 4eaab07..4769546 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; -- 2.7.4