File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ tristate_option(CCACHE "Use ccache for compiling." "if ccache is found." AUTO)
47
47
tristate_option (WITH_NATPMP "Enable NAT-PMP." "if libnatpmp is found." AUTO )
48
48
tristate_option (WITH_MINIUPNPC "Enable UPnP." "if libminiupnpc is found." AUTO )
49
49
tristate_option (WITH_ZMQ "Enable ZMQ notifications." "if libzmq is found." AUTO )
50
+ tristate_option (WITH_USDT
51
+ "Enable tracepoints for Userspace, Statically Defined Tracing."
52
+ "if sys/sdt.h is found."
53
+ AUTO
54
+ )
50
55
51
56
if (CXX20 )
52
57
set (CMAKE_CXX_STANDARD 20 )
@@ -144,6 +149,7 @@ message("Optional packages:")
144
149
message (" NAT-PMP ............................. ${WITH_NATPMP} " )
145
150
message (" UPnP ................................ ${WITH_MINIUPNPC} " )
146
151
message (" ZeroMQ .............................. ${WITH_ZMQ} " )
152
+ message (" USDT tracing ........................ ${WITH_USDT} " )
147
153
message ("" )
148
154
if (CMAKE_CROSSCOMPILING )
149
155
set (cross_status "TRUE, for ${CMAKE_SYSTEM_NAME} , ${CMAKE_SYSTEM_PROCESSOR} " )
Original file line number Diff line number Diff line change 33
33
/* Copyright year */
34
34
#define COPYRIGHT_YEAR @COPYRIGHT_YEAR@
35
35
36
+ /* Define to 1 to enable tracepoints for Userspace, Statically Defined Tracing
37
+ */
38
+ #cmakedefine ENABLE_TRACING 1
39
+
36
40
/* Define this symbol if you have __builtin_clzl */
37
41
#cmakedefine HAVE_BUILTIN_CLZL 1
38
42
Original file line number Diff line number Diff line change @@ -82,3 +82,24 @@ if(WITH_ZMQ)
82
82
message (FATAL_ERROR "libzmq requested, but not found." )
83
83
endif ()
84
84
endif ()
85
+
86
+ include (CheckCXXSourceCompiles )
87
+ if (WITH_USDT )
88
+ check_cxx_source_compiles ("
89
+ #include <sys/sdt.h>
90
+
91
+ int main()
92
+ {
93
+ DTRACE_PROBE(\" context\" , \" event\" );
94
+ }
95
+ " HAVE_USDT_H
96
+ )
97
+ if (HAVE_USDT_H )
98
+ set (ENABLE_TRACING TRUE )
99
+ set (WITH_USDT ON )
100
+ elseif (WITH_USDT STREQUAL "AUTO" )
101
+ set (WITH_USDT OFF )
102
+ else ()
103
+ message (FATAL_ERROR "sys/sdt.h requested, but not found." )
104
+ endif ()
105
+ endif ()
You can’t perform that action at this time.
0 commit comments