diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/tracing/CMakeLists.txt | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tracing/CMakeLists.txt')
-rw-r--r-- | src/tracing/CMakeLists.txt | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/tracing/CMakeLists.txt b/src/tracing/CMakeLists.txt new file mode 100644 index 00000000..d63399d5 --- /dev/null +++ b/src/tracing/CMakeLists.txt @@ -0,0 +1,64 @@ +# we are in "src/tracing", so create the output dir manually. +# the source files include the tracing headers like +# #include "tracing/oprequest.h". so better put them into +# ${PROJECT_BINARY_DIR}/include, where acconfig.h is also located +set(working_dir ${CMAKE_BINARY_DIR}/include) +set(header_dir ${working_dir}/tracing) +file(MAKE_DIRECTORY ${header_dir}) + +add_custom_target(tracepoint_libraries) + +file(GLOB tps "*.tp") +foreach(tp ${tps}) + get_filename_component(name ${tp} NAME_WE) + set(header ${header_dir}/${name}.h) + add_custom_command( + OUTPUT ${header} + COMMAND ${LTTNG_GEN_TP} ${tp} -o tracing/${name}.h + DEPENDS ${tp} + WORKING_DIRECTORY ${working_dir} + COMMENT "generating ${header}") + add_custom_target( + ${name}-tp + DEPENDS ${header}) +endforeach() + +function(add_tracing_library name tracings version) + foreach(tp_file ${tracings}) + get_filename_component(tp ${tp_file} NAME_WE) + list(APPEND hdrs + ${header_dir}/${tp}.h) + list(APPEND tpfiles ${tp}.c) + endforeach() + add_library(${name} SHARED ${hdrs} ${tpfiles}) + target_link_libraries(${name} ${LTTNGUST_LIBRARIES} ${CMAKE_DL_LIBS}) + string(REGEX MATCH "^[0-9]+" soversion ${version}) + set_target_properties(${name} PROPERTIES + OUTPUT_NAME ${name} + VERSION ${version} + SOVERSION ${soversion} + INSTALL_RPATH "") + add_dependencies(tracepoint_libraries ${name}) +endfunction() + +set(osd_traces oprequest.tp osd.tp pg.tp) +add_tracing_library(osd_tp "${osd_traces}" 1.0.0) +add_tracing_library(rados_tp librados.tp 2.0.0) +add_tracing_library(os_tp objectstore.tp 1.0.0) +add_tracing_library(rgw_op_tp rgw_op.tp 1.0.0) +add_tracing_library(rgw_rados_tp rgw_rados.tp 1.0.0) + +install(TARGETS rados_tp osd_tp os_tp rgw_rados_tp rgw_op_tp DESTINATION ${CMAKE_INSTALL_LIBDIR}) +if(WITH_RBD) + add_tracing_library(rbd_tp librbd.tp 1.0.0) + install(TARGETS rbd_tp DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif(WITH_RBD) +if(WITH_OSD_INSTRUMENT_FUNCTIONS) + add_tracing_library(cyg_profile_tp cyg_profile.tp 1.0.0) + install(TARGETS cyg_profile_tp DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif() +if(WITH_LTTNG AND WITH_EVENTTRACE) + add_tracing_library(eventtrace_tp eventtrace.tp 1.0.0) + install(TARGETS eventtrace_tp DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif() + |