Line data Source code
1 : #ifndef HEADER_fd_src_util_log_fd_dtrace_h
2 : #define HEADER_fd_src_util_log_fd_dtrace_h
3 :
4 : /* fd_dtrace.h provides wrappers for software-defined trace points. */
5 :
6 : #ifdef __has_include
7 : #if __has_include(<sys/sdt.h>) && defined(__linux__)
8 : #define FD_HAS_SDT 1
9 : #endif
10 : #endif
11 :
12 : #ifndef FD_HAS_SDT
13 : #define FD_HAS_SDT 0
14 : #endif
15 :
16 : #if FD_HAS_SDT
17 :
18 : #include <sys/sdt.h>
19 :
20 : #define FD_DTRACE_PROBE(name) DTRACE_PROBE(Firedancer,name)
21 12 : #define FD_DTRACE_PROBE_1(name,a1) DTRACE_PROBE1(Firedancer,name,a1)
22 0 : #define FD_DTRACE_PROBE_2(name,a1,a2) DTRACE_PROBE2(Firedancer,name,a1,a2)
23 177 : #define FD_DTRACE_PROBE_3(name,a1,a2,a3) DTRACE_PROBE3(Firedancer,name,a1,a2,a3)
24 96899549 : #define FD_DTRACE_PROBE_4(name,a1,a2,a3,a4) DTRACE_PROBE4(Firedancer,name,a1,a2,a3,a4)
25 92046585 : #define FD_DTRACE_PROBE_5(name,a1,a2,a3,a4,a5) DTRACE_PROBE5(Firedancer,name,a1,a2,a3,a4,a5)
26 :
27 : #else
28 :
29 : #define FD_DTRACE_PROBE(name)
30 : #define FD_DTRACE_PROBE_1(name,a1) (void)((a1));
31 : #define FD_DTRACE_PROBE_2(name,a1,a2) (void)((a1)); (void)((a2));
32 : #define FD_DTRACE_PROBE_3(name,a1,a2,a3) (void)((a1)); (void)((a2)); (void)((a3));
33 : #define FD_DTRACE_PROBE_4(name,a1,a2,a3,a4) (void)((a1)); (void)((a2)); (void)((a3)); (void)((a4));
34 : #define FD_DTRACE_PROBE_5(name,a1,a2,a3,a4,a5) (void)((a1)); (void)((a2)); (void)((a3)); (void)((a4)); (void)((a5));
35 :
36 : #endif /* FD_HAS_SDT */
37 :
38 : #endif /* HEADER_fd_src_util_log_fd_dtrace_h */
|