2016-07-21 15:39:55 +08:00
|
|
|
# Build for the XRay runtime support library.
|
|
|
|
|
|
|
|
set(XRAY_SOURCES
|
|
|
|
xray_init.cc
|
2016-11-16 09:01:13 +08:00
|
|
|
xray_interface.cc
|
|
|
|
xray_flags.cc
|
[compiler-rt][XRay] Initial per-thread inmemory logging implementation
Depends on D21612 which implements the building blocks for the compiler-rt
implementation of the XRay runtime. We use a naive in-memory log of fixed-size
entries that get written out to a log file when the buffers are full, and when
the thread exits.
This implementation lays some foundations on to allowing for more complex XRay
records to be written to the log in subsequent changes. It also defines the format
that the function call accounting tool in D21987 will start building upon.
Once D21987 lands, we should be able to start defining more tests using that tool
once the function call accounting tool becomes part of the llvm distribution.
Reviewers: echristo, kcc, rnk, eugenis, majnemer, rSerge
Subscribers: sdardis, rSerge, dberris, tberghammer, danalbert, srhines, majnemer, llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D21982
llvm-svn: 279805
2016-08-26 14:39:33 +08:00
|
|
|
xray_inmemory_log.cc
|
2016-07-21 15:39:55 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
set(x86_64_SOURCES
|
2016-11-16 09:01:13 +08:00
|
|
|
xray_x86_64.cc
|
|
|
|
xray_trampoline_x86_64.S
|
|
|
|
${XRAY_SOURCES})
|
2016-07-21 15:39:55 +08:00
|
|
|
|
2016-09-20 22:35:57 +08:00
|
|
|
set(arm_SOURCES
|
2016-11-16 09:01:13 +08:00
|
|
|
xray_arm.cc
|
|
|
|
xray_trampoline_arm.S
|
|
|
|
${XRAY_SOURCES})
|
2016-09-20 22:35:57 +08:00
|
|
|
|
|
|
|
set(armhf_SOURCES ${arm_SOURCES})
|
|
|
|
|
2016-07-21 15:39:55 +08:00
|
|
|
include_directories(..)
|
|
|
|
include_directories(../../include)
|
|
|
|
|
|
|
|
set(XRAY_CFLAGS ${SANITIZER_COMMON_CFLAGS})
|
|
|
|
|
|
|
|
set(XRAY_COMMON_DEFINITIONS XRAY_HAS_EXCEPTIONS=1)
|
2016-11-16 09:01:13 +08:00
|
|
|
append_list_if(
|
|
|
|
COMPILER_RT_HAS_XRAY_COMPILER_FLAG XRAY_SUPPORTED=1 XRAY_COMMON_DEFINITIONS)
|
2016-07-21 15:39:55 +08:00
|
|
|
|
|
|
|
add_compiler_rt_object_libraries(RTXray
|
[compiler-rt][XRay] Initial per-thread inmemory logging implementation
Depends on D21612 which implements the building blocks for the compiler-rt
implementation of the XRay runtime. We use a naive in-memory log of fixed-size
entries that get written out to a log file when the buffers are full, and when
the thread exits.
This implementation lays some foundations on to allowing for more complex XRay
records to be written to the log in subsequent changes. It also defines the format
that the function call accounting tool in D21987 will start building upon.
Once D21987 lands, we should be able to start defining more tests using that tool
once the function call accounting tool becomes part of the llvm distribution.
Reviewers: echristo, kcc, rnk, eugenis, majnemer, rSerge
Subscribers: sdardis, rSerge, dberris, tberghammer, danalbert, srhines, majnemer, llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D21982
llvm-svn: 279805
2016-08-26 14:39:33 +08:00
|
|
|
ARCHS ${XRAY_SUPPORTED_ARCH}
|
|
|
|
SOURCES ${XRAY_SOURCES} CFLAGS ${XRAY_CFLAGS}
|
|
|
|
DEFS ${XRAY_COMMON_DEFINITIONS})
|
2016-07-21 15:39:55 +08:00
|
|
|
|
2016-08-27 04:52:22 +08:00
|
|
|
add_compiler_rt_component(xray)
|
|
|
|
|
2016-07-21 15:39:55 +08:00
|
|
|
set(XRAY_COMMON_RUNTIME_OBJECT_LIBS
|
2016-11-16 09:01:13 +08:00
|
|
|
RTSanitizerCommon
|
|
|
|
RTSanitizerCommonLibc)
|
2016-07-21 15:39:55 +08:00
|
|
|
|
|
|
|
foreach (arch ${XRAY_SUPPORTED_ARCH})
|
2016-11-16 09:01:13 +08:00
|
|
|
if (CAN_TARGET_${arch})
|
|
|
|
add_compiler_rt_runtime(clang_rt.xray
|
|
|
|
STATIC
|
|
|
|
ARCHS ${arch}
|
|
|
|
SOURCES ${${arch}_SOURCES}
|
|
|
|
CFLAGS ${XRAY_CFLAGS}
|
|
|
|
DEFS ${XRAY_COMMON_DEFINITIONS}
|
|
|
|
OBJECT_LIBS ${XRAY_COMMON_RUNTIME_OBJECT_LIBS}
|
|
|
|
PARENT_TARGET xray)
|
|
|
|
endif ()
|
2016-07-21 15:39:55 +08:00
|
|
|
endforeach()
|