mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Linux 6.10 compat: Fix tracepoints definitions
__string field definition includes the source variable for a value of the string when the TP hits; in 6.10+ kernels, __assign_str() uses that to copy a value from src to the string, with older kernels, __assign_str still accepted src as a second parameter. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pavel Snajdr <snajpa@snajpa.net> Co-authored-by: Tony Hutter <hutter2@llnl.gov> Closes #16475 Closes #16515
This commit is contained in:
committed by
Tony Hutter
parent
f4e66db401
commit
b2bef90465
@@ -0,0 +1,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>
|
||||
])
|
||||
])
|
||||
@@ -85,6 +85,34 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_IOV_ITER], [
|
||||
bytes = copy_from_iter((void *)&buf, size, &iter);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([iov_iter_get_pages2], [
|
||||
#include <linux/uio.h>
|
||||
], [
|
||||
struct iov_iter iter = { 0 };
|
||||
struct page **pages = NULL;
|
||||
size_t maxsize = 4096;
|
||||
unsigned maxpages = 1;
|
||||
size_t start;
|
||||
size_t ret __attribute__ ((unused));
|
||||
|
||||
ret = iov_iter_get_pages2(&iter, pages, maxsize, maxpages,
|
||||
&start);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([iov_iter_get_pages], [
|
||||
#include <linux/uio.h>
|
||||
], [
|
||||
struct iov_iter iter = { 0 };
|
||||
struct page **pages = NULL;
|
||||
size_t maxsize = 4096;
|
||||
unsigned maxpages = 1;
|
||||
size_t start;
|
||||
size_t ret __attribute__ ((unused));
|
||||
|
||||
ret = iov_iter_get_pages(&iter, pages, maxsize, maxpages,
|
||||
&start);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([iov_iter_type], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/uio.h>
|
||||
@@ -184,6 +212,27 @@ AC_DEFUN([ZFS_AC_KERNEL_VFS_IOV_ITER], [
|
||||
enable_vfs_iov_iter="no"
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Kernel 6.0 changed iov_iter_get_pages() to iov_iter_page_pages2().
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether iov_iter_get_pages2() is available])
|
||||
ZFS_LINUX_TEST_RESULT([iov_iter_get_pages2], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_IOV_ITER_GET_PAGES2, 1,
|
||||
[iov_iter_get_pages2() is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING([whether iov_iter_get_pages() is available])
|
||||
ZFS_LINUX_TEST_RESULT([iov_iter_get_pages], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_IOV_ITER_GET_PAGES, 1,
|
||||
[iov_iter_get_pages() is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
enable_vfs_iov_iter="no"
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # This checks for iov_iter_type() in linux/uio.h. It is not
|
||||
dnl # required, however, and the module will compiled without it
|
||||
|
||||
@@ -326,6 +326,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
||||
ZFS_AC_KERNEL_SYNC_BDEV
|
||||
ZFS_AC_KERNEL_MM_PAGE_SIZE
|
||||
ZFS_AC_KERNEL_MM_PAGE_MAPPING
|
||||
ZFS_AC_KERNEL_1ARG_ASSIGN_STR
|
||||
case "$host_cpu" in
|
||||
powerpc*)
|
||||
ZFS_AC_KERNEL_CPU_HAS_FEATURE
|
||||
|
||||
Reference in New Issue
Block a user