[all-commits] [llvm/llvm-project] 985486: [Profile] Remove duplicate file locks when enabled...

Zequan Wu via All-commits all-commits at lists.llvm.org
Mon Jul 10 08:01:43 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 985486dca48bffd9e991d9f5ac32e1d109ae000f
      https://github.com/llvm/llvm-project/commit/985486dca48bffd9e991d9f5ac32e1d109ae000f
  Author: Zequan Wu <zequanwu at google.com>
  Date:   2023-07-10 (Mon, 10 Jul 2023)

  Changed paths:
    M compiler-rt/lib/profile/InstrProfilingFile.c
    A compiler-rt/test/profile/ContinuousSyncMode/online-merging-windows.c
    M compiler-rt/test/profile/ContinuousSyncMode/runtime-counter-relocation.c

  Log Message:
  -----------
  [Profile] Remove duplicate file locks when enabled continuous mode and online merging.

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.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D154748




More information about the All-commits mailing list