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)
4747tristate_option(WITH_NATPMP "Enable NAT-PMP." "if libnatpmp is found." AUTO)
4848tristate_option(WITH_MINIUPNPC "Enable UPnP." "if libminiupnpc is found." AUTO)
4949tristate_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+ )
5055
5156if (CXX20)
5257 set (CMAKE_CXX_STANDARD 20)
@@ -144,6 +149,7 @@ message("Optional packages:")
144149message (" NAT-PMP ............................. ${WITH_NATPMP} " )
145150message (" UPnP ................................ ${WITH_MINIUPNPC} " )
146151message (" ZeroMQ .............................. ${WITH_ZMQ} " )
152+ message (" USDT tracing ........................ ${WITH_USDT} " )
147153message ("" )
148154if (CMAKE_CROSSCOMPILING )
149155 set (cross_status "TRUE, for ${CMAKE_SYSTEM_NAME} , ${CMAKE_SYSTEM_PROCESSOR} " )
Original file line number Diff line number Diff line change 3333/* Copyright year */
3434#define COPYRIGHT_YEAR @COPYRIGHT_YEAR@
3535
36+ /* Define to 1 to enable tracepoints for Userspace, Statically Defined Tracing
37+ */
38+ #cmakedefine ENABLE_TRACING 1
39+
3640/* Define this symbol if you have __builtin_clzl */
3741#cmakedefine HAVE_BUILTIN_CLZL 1
3842
Original file line number Diff line number Diff line change @@ -83,3 +83,24 @@ if(WITH_ZMQ)
8383 message (FATAL_ERROR "libzmq requested, but not found." )
8484 endif ()
8585endif ()
86+
87+ include (CheckCXXSourceCompiles)
88+ if (WITH_USDT)
89+ check_cxx_source_compiles("
90+ #include <sys/sdt.h>
91+
92+ int main()
93+ {
94+ DTRACE_PROBE(\" context\" , \" event\" );
95+ }
96+ " HAVE_USDT_H
97+ )
98+ if (HAVE_USDT_H)
99+ set (ENABLE_TRACING TRUE )
100+ set (WITH_USDT ON )
101+ elseif (WITH_USDT STREQUAL "AUTO" )
102+ set (WITH_USDT OFF )
103+ else ()
104+ message (FATAL_ERROR "sys/sdt.h requested, but not found." )
105+ endif ()
106+ endif ()
You can’t perform that action at this time.
0 commit comments