jpayne@69
|
1 /* Static DTrace probes interface */
|
jpayne@69
|
2
|
jpayne@69
|
3 #ifndef Py_DTRACE_H
|
jpayne@69
|
4 #define Py_DTRACE_H
|
jpayne@69
|
5 #ifdef __cplusplus
|
jpayne@69
|
6 extern "C" {
|
jpayne@69
|
7 #endif
|
jpayne@69
|
8
|
jpayne@69
|
9 #ifdef WITH_DTRACE
|
jpayne@69
|
10
|
jpayne@69
|
11 #include "pydtrace_probes.h"
|
jpayne@69
|
12
|
jpayne@69
|
13 /* pydtrace_probes.h, on systems with DTrace, is auto-generated to include
|
jpayne@69
|
14 `PyDTrace_{PROBE}` and `PyDTrace_{PROBE}_ENABLED()` macros for every probe
|
jpayne@69
|
15 defined in pydtrace_provider.d.
|
jpayne@69
|
16
|
jpayne@69
|
17 Calling these functions must be guarded by a `PyDTrace_{PROBE}_ENABLED()`
|
jpayne@69
|
18 check to minimize performance impact when probing is off. For example:
|
jpayne@69
|
19
|
jpayne@69
|
20 if (PyDTrace_FUNCTION_ENTRY_ENABLED())
|
jpayne@69
|
21 PyDTrace_FUNCTION_ENTRY(f);
|
jpayne@69
|
22 */
|
jpayne@69
|
23
|
jpayne@69
|
24 #else
|
jpayne@69
|
25
|
jpayne@69
|
26 /* Without DTrace, compile to nothing. */
|
jpayne@69
|
27
|
jpayne@69
|
28 static inline void PyDTrace_LINE(const char *arg0, const char *arg1, int arg2) {}
|
jpayne@69
|
29 static inline void PyDTrace_FUNCTION_ENTRY(const char *arg0, const char *arg1, int arg2) {}
|
jpayne@69
|
30 static inline void PyDTrace_FUNCTION_RETURN(const char *arg0, const char *arg1, int arg2) {}
|
jpayne@69
|
31 static inline void PyDTrace_GC_START(int arg0) {}
|
jpayne@69
|
32 static inline void PyDTrace_GC_DONE(Py_ssize_t arg0) {}
|
jpayne@69
|
33 static inline void PyDTrace_INSTANCE_NEW_START(int arg0) {}
|
jpayne@69
|
34 static inline void PyDTrace_INSTANCE_NEW_DONE(int arg0) {}
|
jpayne@69
|
35 static inline void PyDTrace_INSTANCE_DELETE_START(int arg0) {}
|
jpayne@69
|
36 static inline void PyDTrace_INSTANCE_DELETE_DONE(int arg0) {}
|
jpayne@69
|
37 static inline void PyDTrace_IMPORT_FIND_LOAD_START(const char *arg0) {}
|
jpayne@69
|
38 static inline void PyDTrace_IMPORT_FIND_LOAD_DONE(const char *arg0, int arg1) {}
|
jpayne@69
|
39 static inline void PyDTrace_AUDIT(const char *arg0, void *arg1) {}
|
jpayne@69
|
40
|
jpayne@69
|
41 static inline int PyDTrace_LINE_ENABLED(void) { return 0; }
|
jpayne@69
|
42 static inline int PyDTrace_FUNCTION_ENTRY_ENABLED(void) { return 0; }
|
jpayne@69
|
43 static inline int PyDTrace_FUNCTION_RETURN_ENABLED(void) { return 0; }
|
jpayne@69
|
44 static inline int PyDTrace_GC_START_ENABLED(void) { return 0; }
|
jpayne@69
|
45 static inline int PyDTrace_GC_DONE_ENABLED(void) { return 0; }
|
jpayne@69
|
46 static inline int PyDTrace_INSTANCE_NEW_START_ENABLED(void) { return 0; }
|
jpayne@69
|
47 static inline int PyDTrace_INSTANCE_NEW_DONE_ENABLED(void) { return 0; }
|
jpayne@69
|
48 static inline int PyDTrace_INSTANCE_DELETE_START_ENABLED(void) { return 0; }
|
jpayne@69
|
49 static inline int PyDTrace_INSTANCE_DELETE_DONE_ENABLED(void) { return 0; }
|
jpayne@69
|
50 static inline int PyDTrace_IMPORT_FIND_LOAD_START_ENABLED(void) { return 0; }
|
jpayne@69
|
51 static inline int PyDTrace_IMPORT_FIND_LOAD_DONE_ENABLED(void) { return 0; }
|
jpayne@69
|
52 static inline int PyDTrace_AUDIT_ENABLED(void) { return 0; }
|
jpayne@69
|
53
|
jpayne@69
|
54 #endif /* !WITH_DTRACE */
|
jpayne@69
|
55
|
jpayne@69
|
56 #ifdef __cplusplus
|
jpayne@69
|
57 }
|
jpayne@69
|
58 #endif
|
jpayne@69
|
59 #endif /* !Py_DTRACE_H */
|