2 dnl # Ensure the DECLARE_EVENT_CLASS macro is available to non-GPL modules.
4 AC_DEFUN([ZFS_AC_KERNEL_DECLARE_EVENT_CLASS], [
5 AC_MSG_CHECKING([whether DECLARE_EVENT_CLASS() is available])
6 ZFS_LINUX_TRY_COMPILE_HEADER([
7 #include <linux/module.h>
8 MODULE_LICENSE("$ZFS_META_LICENSE");
10 #define CREATE_TRACE_POINTS
13 trace_zfs_autoconf_event_one(1UL);
14 trace_zfs_autoconf_event_two(2UL);
17 AC_DEFINE(HAVE_DECLARE_EVENT_CLASS, 1,
18 [DECLARE_EVENT_CLASS() is available])
22 #if !defined(_CONFTEST_H) || defined(TRACE_HEADER_MULTI_READ)
26 #define TRACE_SYSTEM zfs
27 #include <linux/tracepoint.h>
29 DECLARE_EVENT_CLASS(zfs_autoconf_event_class,
30 TP_PROTO(unsigned long i),
33 __field(unsigned long, i)
38 TP_printk("i = %lu", __entry->i)
41 #define DEFINE_AUTOCONF_EVENT(name) \
42 DEFINE_EVENT(zfs_autoconf_event_class, name, \
43 TP_PROTO(unsigned long i), \
45 DEFINE_AUTOCONF_EVENT(zfs_autoconf_event_one);
46 DEFINE_AUTOCONF_EVENT(zfs_autoconf_event_two);
48 #endif /* _CONFTEST_H */
50 #undef TRACE_INCLUDE_PATH
51 #define TRACE_INCLUDE_PATH .
52 #define TRACE_INCLUDE_FILE conftest
53 #include <trace/define_trace.h>