summaryrefslogtreecommitdiffstats
path: root/src/tracing/CMakeLists.txt
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
commit19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch)
tree42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/tracing/CMakeLists.txt
parentInitial commit. (diff)
downloadceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.tar.xz
ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.zip
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
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()
+