runtime/linux/stp_tracepoint.h - systemtap
Macros defined
Source code
#ifndef _STP_TRACEPOINT_H_
#define _STP_TRACEPOINT_H_
#include <linux/tracepoint.h>
#define intptr_t long
#ifdef DECLARE_TRACE_NOARGS
#define STAPCONF_TRACEPOINT_HAS_DATA
#endif
#ifdef STAPCONF_TRACEPOINT_HAS_DATA
#define STP_TRACE_ENTER(fn, args...) \
void fn (void *__data __attribute__ ((unused)), ##args)
#define STP_TRACE_ENTER_NOARGS(fn) STP_TRACE_ENTER(fn)
#ifdef STAPCONF_TRACEPOINT_STRINGS
#define STP_TRACE_REGISTER(name, fn) register_trace_##name(fn, NULL)
#define STP_TRACE_UNREGISTER(name, fn) unregister_trace_##name(fn, NULL)
#else
#define STAP_NEED_TRACEPOINTS 1
int stp_tracepoint_probe_register(const char *name, void *probe, void *data);
int stp_tracepoint_probe_unregister(const char *name, void *probe, void *data);
#define STP_TRACE_REGISTER(name, fn) ({ \
check_trace_callback_type_##name(fn); \
stp_tracepoint_probe_register(#name, (void*)fn, NULL); \
})
#define STP_TRACE_UNREGISTER(name, fn) ({ \
check_trace_callback_type_##name(fn); \
stp_tracepoint_probe_unregister(#name, (void*)fn, NULL); \
})
#endif
#else
#define STP_TRACE_ENTER(fn, args...) void fn (args)
#define STP_TRACE_ENTER_NOARGS(fn) STP_TRACE_ENTER(fn, void)
#define STP_TRACE_REGISTER(name, fn) register_trace_##name(fn)
#define STP_TRACE_UNREGISTER(name, fn) unregister_trace_##name(fn)
#endif
#define STP_TRACE_ENTER_REAL(fn, args...) void fn (args)
#define STP_TRACE_ENTER_REAL_NOARGS(fn) STP_TRACE_ENTER_REAL(fn, void)
#endif