jpayne@69: /* Static DTrace probes interface */ jpayne@69: jpayne@69: #ifndef Py_DTRACE_H jpayne@69: #define Py_DTRACE_H jpayne@69: #ifdef __cplusplus jpayne@69: extern "C" { jpayne@69: #endif jpayne@69: jpayne@69: #ifdef WITH_DTRACE jpayne@69: jpayne@69: #include "pydtrace_probes.h" jpayne@69: jpayne@69: /* pydtrace_probes.h, on systems with DTrace, is auto-generated to include jpayne@69: `PyDTrace_{PROBE}` and `PyDTrace_{PROBE}_ENABLED()` macros for every probe jpayne@69: defined in pydtrace_provider.d. jpayne@69: jpayne@69: Calling these functions must be guarded by a `PyDTrace_{PROBE}_ENABLED()` jpayne@69: check to minimize performance impact when probing is off. For example: jpayne@69: jpayne@69: if (PyDTrace_FUNCTION_ENTRY_ENABLED()) jpayne@69: PyDTrace_FUNCTION_ENTRY(f); jpayne@69: */ jpayne@69: jpayne@69: #else jpayne@69: jpayne@69: /* Without DTrace, compile to nothing. */ jpayne@69: jpayne@69: static inline void PyDTrace_LINE(const char *arg0, const char *arg1, int arg2) {} jpayne@69: static inline void PyDTrace_FUNCTION_ENTRY(const char *arg0, const char *arg1, int arg2) {} jpayne@69: static inline void PyDTrace_FUNCTION_RETURN(const char *arg0, const char *arg1, int arg2) {} jpayne@69: static inline void PyDTrace_GC_START(int arg0) {} jpayne@69: static inline void PyDTrace_GC_DONE(Py_ssize_t arg0) {} jpayne@69: static inline void PyDTrace_INSTANCE_NEW_START(int arg0) {} jpayne@69: static inline void PyDTrace_INSTANCE_NEW_DONE(int arg0) {} jpayne@69: static inline void PyDTrace_INSTANCE_DELETE_START(int arg0) {} jpayne@69: static inline void PyDTrace_INSTANCE_DELETE_DONE(int arg0) {} jpayne@69: static inline void PyDTrace_IMPORT_FIND_LOAD_START(const char *arg0) {} jpayne@69: static inline void PyDTrace_IMPORT_FIND_LOAD_DONE(const char *arg0, int arg1) {} jpayne@69: static inline void PyDTrace_AUDIT(const char *arg0, void *arg1) {} jpayne@69: jpayne@69: static inline int PyDTrace_LINE_ENABLED(void) { return 0; } jpayne@69: static inline int PyDTrace_FUNCTION_ENTRY_ENABLED(void) { return 0; } jpayne@69: static inline int PyDTrace_FUNCTION_RETURN_ENABLED(void) { return 0; } jpayne@69: static inline int PyDTrace_GC_START_ENABLED(void) { return 0; } jpayne@69: static inline int PyDTrace_GC_DONE_ENABLED(void) { return 0; } jpayne@69: static inline int PyDTrace_INSTANCE_NEW_START_ENABLED(void) { return 0; } jpayne@69: static inline int PyDTrace_INSTANCE_NEW_DONE_ENABLED(void) { return 0; } jpayne@69: static inline int PyDTrace_INSTANCE_DELETE_START_ENABLED(void) { return 0; } jpayne@69: static inline int PyDTrace_INSTANCE_DELETE_DONE_ENABLED(void) { return 0; } jpayne@69: static inline int PyDTrace_IMPORT_FIND_LOAD_START_ENABLED(void) { return 0; } jpayne@69: static inline int PyDTrace_IMPORT_FIND_LOAD_DONE_ENABLED(void) { return 0; } jpayne@69: static inline int PyDTrace_AUDIT_ENABLED(void) { return 0; } jpayne@69: jpayne@69: #endif /* !WITH_DTRACE */ jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: } jpayne@69: #endif jpayne@69: #endif /* !Py_DTRACE_H */