OILS / mycpp / probes.h View on Github | oilshell.org

39 lines, 28 significant
1#ifndef MYCPP_PROBES_H
2#define MYCPP_PROBES_H
3
4#include "_build/detected-cpp-config.h" // for HAVE_SYSTEMTAP_SDT
5
6#if HAVE_SYSTEMTAP_SDT && !defined(__ILP32__)
7 // When -m32 is passed, <sys/sdt.h> may not be available.
8 // So disable it under __ILP32__
9 // https://docs.oracle.com/cd/E19620-01/805-3024/lp64-1/index.html
10
11 // __has_include() also seems to work, but technically it's C++17, even
12 // though it works with -std=c++11
13 // #if HAVE_SYSTEMTAP_SDT && __has_include(<sys/sdt.h>)
14
15 #include <sys/sdt.h>
16#else
17 #define DTRACE_PROBE(provider, probe)
18 #define DTRACE_PROBE1(provider, probe, parm1)
19 #define DTRACE_PROBE2(provider, probe, parm1, parm2)
20 #define DTRACE_PROBE3(provider, probe, parm1, parm2, parm3)
21 #define DTRACE_PROBE4(provider, probe, parm1, parm2, parm3, parm4)
22 #define DTRACE_PROBE5(provider, probe, parm1, parm2, parm3, parm4, parm5)
23 #define DTRACE_PROBE6(provider, probe, parm1, parm2, parm3, parm4, parm5, \
24 parm6)
25 #define DTRACE_PROBE7(provider, probe, parm1, parm2, parm3, parm4, parm5, \
26 parm6, parm7)
27 #define DTRACE_PROBE8(provider, probe, parm1, parm2, parm3, parm4, parm5, \
28 parm6, parm7, parm8)
29 #define DTRACE_PROBE9(provider, probe, parm1, parm2, parm3, parm4, parm5, \
30 parm6, parm7, parm8, parm9)
31 #define DTRACE_PROBE10(provider, probe, parm1, parm2, parm3, parm4, parm5, \
32 parm6, parm7, parm8, parm9, parm10)
33 #define DTRACE_PROBE11(provider, probe, parm1, parm2, parm3, parm4, parm5, \
34 parm6, parm7, parm8, parm9, parm10, parm11)
35 #define DTRACE_PROBE12(provider, probe, parm1, parm2, parm3, parm4, parm5, \
36 parm6, parm7, parm8, parm9, parm10, parm11, parm12)
37#endif
38
39#endif // MYCPP_PROBES_H