]> git.proxmox.com Git - ceph.git/blame - ceph/src/tracing/CMakeLists.txt
update sources to v12.1.2
[ceph.git] / ceph / src / tracing / CMakeLists.txt
CommitLineData
7c673cae
FG
1# we are in "src/tracing", so create the output dir manually.
2# the source files include the tracing headers like
3# #include "tracing/oprequest.h". so better put them into
4# ${PROJECT_BINARY_DIR}/include, where acconfig.h is also located
5set(working_dir ${CMAKE_BINARY_DIR}/include)
6set(header_dir ${working_dir}/tracing)
7file(MAKE_DIRECTORY ${header_dir})
8
9add_custom_target(tracepoint_libraries)
10
11file(GLOB tps "*.tp")
12foreach(tp ${tps})
13 get_filename_component(name ${tp} NAME_WE)
14 set(header ${header_dir}/${name}.h)
15 add_custom_command(
16 OUTPUT ${header}
17 COMMAND ${LTTNG_GEN_TP} ${tp} -o tracing/${name}.h
18 DEPENDS ${tp}
19 WORKING_DIRECTORY ${working_dir}
20 COMMENT "generating ${header}")
21 add_custom_target(
22 ${name}-tp
23 DEPENDS ${header})
24endforeach()
25
26function(add_tracing_library name tracings version)
27 foreach(tp_file ${tracings})
28 get_filename_component(tp ${tp_file} NAME_WE)
29 list(APPEND hdrs
30 ${header_dir}/${tp}.h)
31 list(APPEND tpfiles ${tp}.c)
32 endforeach()
33 add_library(${name} SHARED ${hdrs} ${tpfiles})
34 target_link_libraries(${name} ${LTTNGUST_LIBRARIES} ${CMAKE_DL_LIBS})
35 string(REGEX MATCH "^[0-9]+" soversion ${version})
36 set_target_properties(${name} PROPERTIES
37 OUTPUT_NAME ${name}
38 VERSION ${version}
39 SOVERSION ${soversion}
40 INSTALL_RPATH "")
41 add_dependencies(tracepoint_libraries ${name})
42endfunction()
43
44set(osd_traces oprequest.tp osd.tp pg.tp)
45add_tracing_library(osd_tp "${osd_traces}" 1.0.0)
46add_tracing_library(rados_tp librados.tp 2.0.0)
7c673cae
FG
47add_tracing_library(os_tp objectstore.tp 1.0.0)
48
c07f9fc5
FG
49install(TARGETS rados_tp osd_tp os_tp DESTINATION ${CMAKE_INSTALL_LIBDIR})
50if(WITH_RBD)
51 add_tracing_library(rbd_tp librbd.tp 1.0.0)
52 install(TARGETS rbd_tp DESTINATION ${CMAKE_INSTALL_LIBDIR})
53endif(WITH_RBD)
31f18b77
FG
54if(WITH_OSD_INSTRUMENT_FUNCTIONS)
55 add_tracing_library(cyg_profile_tp cyg_profile.tp 1.0.0)
56 install(TARGETS cyg_profile_tp DESTINATION ${CMAKE_INSTALL_LIBDIR})
57endif()
7c673cae
FG
58if(WITH_LTTNG AND WITH_EVENTTRACE)
59 add_tracing_library(eventtrace_tp eventtrace.tp 1.0.0)
60 install(TARGETS eventtrace_tp DESTINATION ${CMAKE_INSTALL_LIBDIR})
61endif()
62