File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121* .stderr
2222* .stdout
2323
24+ # llvm-xray logs
25+ xray-log. *
26+
2427/docs /build
2528/docs /publish
2629/docs /edit
Original file line number Diff line number Diff line change @@ -119,6 +119,8 @@ add_library(global-libs INTERFACE)
119119
120120include (cmake/sanitize.cmake )
121121
122+ include (cmake/instrument.cmake )
123+
122124option (ENABLE_COLORED_BUILD "Enable colors in compiler output" ON )
123125
124126set (CMAKE_COLOR_MAKEFILE ${ENABLE_COLORED_BUILD} ) # works only for the makefile generator
Original file line number Diff line number Diff line change 1+ # https://llvm.org/docs/XRay.html
2+
3+ option (ENABLE_XRAY "Enable LLVM XRay" OFF )
4+
5+ if (NOT ENABLE_XRAY)
6+ message (STATUS "Not using LLVM XRay" )
7+ return ()
8+ endif ()
9+
10+ if (NOT (ARCH_AMD64 AND (OS_LINUX OR OS_FREEBSD)))
11+ message (STATUS "Not using LLVM XRay, only amd64 Linux or FreeBSD are supported" )
12+ return ()
13+ endif ()
14+
15+ # The target clang must support xray, otherwise it should error on invalid option
16+ set (XRAY_FLAGS "-fxray-instrument -DUSE_XRAY" )
17+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${XRAY_FLAGS} " )
18+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${XRAY_FLAGS} " )
19+
20+ message (STATUS "Using LLVM XRay" )
Original file line number Diff line number Diff line change @@ -738,6 +738,7 @@ std::string BaseDaemon::getDefaultConfigFileName() const
738738
739739void BaseDaemon::closeFDs ()
740740{
741+ #if !defined(USE_XRAY)
741742 // / NOTE: may benefit from close_range() (linux 5.9+)
742743#if defined(OS_FREEBSD) || defined(OS_DARWIN)
743744 fs::path proc_path{" /dev/fd" };
@@ -785,13 +786,13 @@ void BaseDaemon::closeFDs()
785786 }
786787 }
787788 }
789+ #endif
788790}
789791
790792
791793void BaseDaemon::initialize (Application & self)
792794{
793795 closeFDs ();
794-
795796 ServerApplication::initialize (self);
796797
797798 // / now highest priority (lowest value) is PRIO_APPLICATION = -100, we want higher!
You can’t perform that action at this time.
0 commit comments