Changeset 295698 in webkit
- Timestamp:
- Jun 21, 2022, 4:21:07 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/Source/WTF/wtf/GenerateProfiles.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/wtf/GenerateProfiles.h
r295133 r295698 60 60 WTFLogAlways("<WEBKIT_LLVM_PROFILE> To sanity-check the output: `for f in ./profiles/*; do echo $f; xcrun -sdk macosx.internal llvm-profdata show $f; done;`."); 61 61 62 {63 // Maybe we could use %t instead here, but this folder is permitted through the sandbox because of ANGLE.64 FileSystem::PlatformFileHandle fileHandle;65 auto filePath = FileSystem::openTemporaryFile(makeString(name, "-", getpid()), fileHandle, ".profraw"_s);66 profileFileBase.get() = String::fromUTF8(filePath.utf8().data());67 FileSystem::closeFile(fileHandle);68 }69 70 62 WTFLogAlways("<WEBKIT_LLVM_PROFILE><%s><%d>: We will dump the resulting profile to %s.", name, pid, profileFileBase->utf8().data()); 71 63 72 64 int token; 73 65 notify_register_dispatch("com.apple.WebKit.profiledata", &token, dispatch_get_main_queue(), ^(int) { 66 67 { 68 // Maybe we could use %t instead here, but this folder is permitted through the sandbox because of ANGLE. 69 FileSystem::PlatformFileHandle fileHandle; 70 auto filePath = FileSystem::openTemporaryFile(makeString(name, "-", getpid()), fileHandle, ".profraw"_s); 71 profileFileBase.get() = String::fromUTF8(filePath.utf8().data()); 72 FileSystem::closeFile(fileHandle); 73 } 74 74 75 profileFileName.get() = makeString(profileFileBase.get(), ".", profileCount++, ".profraw"); 75 76 __llvm_profile_set_filename(profileFileName->utf8().data()); // Must stay alive while it is used by llvm.
Note:
See TracChangeset
for help on using the changeset viewer.