[all-commits] [llvm/llvm-project] 14c95e: [profile] Implement a non-mmap path when reading ...
Wael Yehia via All-commits
all-commits at lists.llvm.org
Tue Mar 18 11:13:36 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 14c95e0c8b25f6deba47cd279c5dcdeef3870159
https://github.com/llvm/llvm-project/commit/14c95e0c8b25f6deba47cd279c5dcdeef3870159
Author: Wael Yehia <wmyehia2001 at yahoo.com>
Date: 2025-03-18 (Tue, 18 Mar 2025)
Changed paths:
M compiler-rt/lib/profile/InstrProfilingFile.c
M compiler-rt/lib/profile/InstrProfilingPort.h
M compiler-rt/lib/profile/InstrProfilingUtil.c
M compiler-rt/lib/profile/InstrProfilingUtil.h
M compiler-rt/test/profile/Posix/instrprof-fork.c
A compiler-rt/test/profile/instrprof-no-mmap-during-merging.c
Log Message:
-----------
[profile] Implement a non-mmap path when reading profile files from a non-local filesystem (#131177)
On AIX, when accessing mmap'ed memory associated to a file on NFS, a
SIGBUS might be raised at random.
The problem is still in open state with the OS team.
This PR teaches the profile runtime, under certain conditions, to avoid
the mmap when reading the profile file during online merging.
This PR has no effect on any platform other than AIX because I'm not
aware of this problem on other platforms.
Other platforms can easily opt-in to this functionality in the future.
The logic in function `is_local_filesystem` was copied from
[llvm/lib/Support/Unix/Path.inc](https://github.com/llvm/llvm-project/blob/f388ca3d9d9a58e3d189458b590ba68dfd9e5a2d/llvm/lib/Support/Unix/Path.inc#L515)
(https://reviews.llvm.org/D58801), because it seems that the
compiler-rt/profile cannot reuse code from llvm except through
`InstrProfData.inc`.
Thanks to @hubert-reinterpretcast for substantial feedback downstream.
---------
Co-authored-by: Wael Yehia <wyehia at ca.ibm.com>
Co-authored-by: Hubert Tong <hubert.reinterpretcast at gmail.com>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list