11#[=============================================================================[
22# FindDTrace
33
4- Find DTrace.
4+ DTrace (Dynamic Tracing), a comprehensive tracing framework originally developed
5+ by Sun Microsystems for troubleshooting and performance analysis on Unix-like
6+ systems. While the name "DTrace" is associated with the original implementation
7+ (now maintained by the DTrace.org community), there are other compatible
8+ implementations such as SystemTap, which is widely used on Linux systems.
9+
10+ This CMake module specifically detects and uses the SystemTap implementation of
11+ DTrace.
512
613Module defines the following `IMPORTED` target(s):
714
@@ -69,9 +76,8 @@ include(FindPackageHandleStandardArgs)
6976set_package_properties(
7077 DTrace
7178 PROPERTIES
72- URL "https://dtrace .org/"
79+ URL "https://sourceware .org/systemtap "
7380 DESCRIPTION "Performance analysis and troubleshooting tool"
74- PURPOSE "https://sourceware.org/systemtap"
7581)
7682
7783set (_reason "" )
@@ -180,7 +186,7 @@ function(dtrace_target)
180186 execute_process(
181187 COMMAND ${DTrace_EXECUTABLE}
182188 -s "${parsed_INPUT}"
183- -h # Generate a systemtap header file.
189+ -h # Generate a SystemTap header file.
184190 -C # Run the cpp preprocessor on the input file.
185191 -o "${parsed_HEADER}" # Name of the output file.
186192 )
@@ -224,7 +230,7 @@ function(dtrace_target)
224230 CC="${CMAKE_C_COMPILER} "
225231 ${DTrace_EXECUTABLE}
226232 -s ${parsed_INPUT} $<TARGET_OBJECTS:${target} _object>
227- -G # Generate a systemtap probe definition object file.
233+ -G # Generate a SystemTap probe definition object file.
228234 -o ${output}
229235 -I${DTrace_INCLUDE_DIR}
230236 DEPENDS ${target} _object
@@ -236,11 +242,5 @@ function(dtrace_target)
236242
237243 add_library (${target} INTERFACE )
238244 target_sources (${target} INTERFACE ${CMAKE_CURRENT_BINARY_DIR} /${output} )
239- set_source_files_properties (
240- ${CMAKE_CURRENT_BINARY_DIR} /${output}
241- PROPERTIES
242- EXTERNAL_OBJECT TRUE
243- GENERATED TRUE
244- )
245245 add_dependencies (${target} ${target} _generator)
246246endfunction ()
0 commit comments