summaryrefslogtreecommitdiffstats
path: root/src/tracing/CMakeLists.txt
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /src/tracing/CMakeLists.txt
parentInitial commit. (diff)
downloadceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz
ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tracing/CMakeLists.txt')
-rw-r--r--src/tracing/CMakeLists.txt66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/tracing/CMakeLists.txt b/src/tracing/CMakeLists.txt
new file mode 100644
index 000000000..0044299a4
--- /dev/null
+++ b/src/tracing/CMakeLists.txt
@@ -0,0 +1,66 @@
+# 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(bluestore_tp bluestore.tp 1.0.0)
+add_tracing_library(rgw_op_tp rgw_op.tp 2.0.0)
+add_tracing_library(rgw_rados_tp rgw_rados.tp 2.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_EVENTTRACE)
+ add_tracing_library(eventtrace_tp eventtrace.tp 1.0.0)
+ install(TARGETS eventtrace_tp DESTINATION ${CMAKE_INSTALL_LIBDIR})
+endif()
+