File: kernel-assign_str.m4

package info (click to toggle)
zfs-linux 2.3.2-2
  • links: PTS, VCS
  • area: contrib
  • in suites: sid, trixie
  • size: 71,496 kB
  • sloc: ansic: 392,648; sh: 67,208; asm: 47,693; python: 8,160; makefile: 5,100; perl: 839; sed: 41
file content (62 lines) | stat: -rw-r--r-- 2,230 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
dnl #
dnl # 6.10 kernel, check number of args of __assign_str() for trace:
dnl
dnl # 6.10+:           one arg
dnl # 6.9 and older:   two args
dnl #
dnl # More specifically, this will test to see if __assign_str() takes one
dnl # arg.  If __assign_str() takes two args, or is not defined, then
dnl # HAVE_1ARG_ASSIGN_STR will not be set.
dnl #
AC_DEFUN([ZFS_AC_KERNEL_1ARG_ASSIGN_STR], [
       AC_MSG_CHECKING([whether __assign_str() has one arg])
       ZFS_LINUX_TRY_COMPILE_HEADER([
               #include <linux/module.h>
               MODULE_LICENSE("$ZFS_META_LICENSE");

               #define CREATE_TRACE_POINTS
               #include "conftest.h"
       ],[
               trace_zfs_autoconf_event_one("1");
               trace_zfs_autoconf_event_two("2");
       ],[
               AC_MSG_RESULT(yes)
               AC_DEFINE(HAVE_1ARG_ASSIGN_STR, 1,
                   [__assign_str() has one arg])
       ],[
               AC_MSG_RESULT(no)
       ],[
               #if !defined(_CONFTEST_H) || defined(TRACE_HEADER_MULTI_READ)
               #define _CONFTEST_H

               #undef  TRACE_SYSTEM
               #define TRACE_SYSTEM zfs
               #include <linux/tracepoint.h>

               DECLARE_EVENT_CLASS(zfs_autoconf_event_class,
                       TP_PROTO(char *string),
                       TP_ARGS(string),
                       TP_STRUCT__entry(
                               __string(str, string)
                       ),
                       TP_fast_assign(
                               __assign_str(str);
                       ),
                       TP_printk("str = %s", __get_str(str))
               );

               #define DEFINE_AUTOCONF_EVENT(name) \
               DEFINE_EVENT(zfs_autoconf_event_class, name, \
                       TP_PROTO(char * str), \
                       TP_ARGS(str))
               DEFINE_AUTOCONF_EVENT(zfs_autoconf_event_one);
               DEFINE_AUTOCONF_EVENT(zfs_autoconf_event_two);

               #endif /* _CONFTEST_H */

               #undef  TRACE_INCLUDE_PATH
               #define TRACE_INCLUDE_PATH .
               #define TRACE_INCLUDE_FILE conftest
               #include <trace/define_trace.h>
       ])
])