This is an archive of the discontinued LLVM Phabricator instance.

[Profile] Remove duplicate file locks when enabled continuous mode and online merging.
ClosedPublic

Authored by zequanwu on Jul 7 2023, 2:16 PM.

Details

Summary

In initializeProfileForContinuousMode, we have already locked the profile file when merging is enabled, so there's no need to lock the same file second time in openFileForMerging.

On Linux/Darwin, the locking the same file twice doesn't cause any problem. But on Windows, it causes the problem to hang forever.

With this minor fix, continuous mode seems working with online merging on Windows.

Diff Detail

Event Timeline

zequanwu created this revision.Jul 7 2023, 2:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2023, 2:16 PM
Herald added a subscriber: Enna1. · View Herald Transcript
zequanwu requested review of this revision.Jul 7 2023, 2:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2023, 2:16 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
phosek accepted this revision.Jul 10 2023, 12:39 AM

LGTM

compiler-rt/test/profile/ContinuousSyncMode/online-merging-windows.c
10–11

Can you use split-file instead?

This revision is now accepted and ready to land.Jul 10 2023, 12:39 AM
This revision was landed with ongoing or failed builds.Jul 10 2023, 8:01 AM
This revision was automatically updated to reflect the committed changes.
zequanwu marked an inline comment as done.
mstorsjo added inline comments.
compiler-rt/test/profile/ContinuousSyncMode/online-merging-windows.c
9

This broke testing on mingw; the -dll option is MS link/lld-link specific and doesn't work with the unix like interface of the linker for mingw targets. For mingw targets, one can pass -shared to the GNU like interface of clang, and that translates to the right linker options, but the test still relies on details like -o foo.dll implicitly creating an import library named foo.lib which don't work the same in mingw mode.

I'll push a fix to use REQUIRES: target={{.*windows-msvc.*}} here instead.

zequanwu added inline comments.Jul 11 2023, 2:47 PM
compiler-rt/test/profile/ContinuousSyncMode/online-merging-windows.c
9

Thanks, I didn't know that.