commit e5ed7ad866b5463db477396a1aa6dc020c756a0c
parent 654afe9019ed9cffbb8577329d63577207a9eb31
Author: Ryan VanderMeulen <rvandermeulen@mozilla.com>
Date: Wed, 1 Oct 2025 16:15:20 +0000
Bug 1991797 - Simplify DTPerformanceSession loading logic. r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D266934
Diffstat:
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/js/src/devtools/Instruments.cpp b/js/src/devtools/Instruments.cpp
@@ -11,15 +11,9 @@
# include <CoreFoundation/CoreFoundation.h>
# include <unistd.h>
-// There are now 2 paths to the DTPerformanceSession framework. We try to load
-// the one contained in /Applications/Xcode.app first, falling back to the one
-// contained in /Library/Developer/4.0/Instruments.
# define DTPerformanceLibraryPath \
"/Applications/Xcode.app/Contents/Developer/Library/Frameworks/" \
"DTPerformanceSession.framework/Versions/Current/DTPerformanceSession"
-# define OldDTPerformanceLibraryPath \
- "/Library/Developer/4.0/Instruments/Frameworks/" \
- "DTPerformanceSession.framework/Versions/Current/DTPerformanceSession"
extern "C" {
@@ -83,16 +77,10 @@ DTPERFORMANCE_SYMBOLS
# undef SYMBOL
void* LoadDTPerformanceLibraries(bool dontLoad) {
- int flags = RTLD_LAZY | RTLD_LOCAL | RTLD_NODELETE;
- if (dontLoad) {
- flags |= RTLD_NOLOAD;
- }
+ const int flags =
+ RTLD_LAZY | RTLD_LOCAL | RTLD_NODELETE | (dontLoad ? RTLD_NOLOAD : 0);
- void* DTPerformanceLibrary = dlopen(DTPerformanceLibraryPath, flags);
- if (!DTPerformanceLibrary) {
- DTPerformanceLibrary = dlopen(OldDTPerformanceLibraryPath, flags);
- }
- return DTPerformanceLibrary;
+ return dlopen(DTPerformanceLibraryPath, flags);
}
bool LoadDTPerformanceLibrary() {