Skip to content

Commit ee94ce9

Browse files
committed
WIP: Linux 6.10 compat: fix tracepoint compilation
6.10 changed __assign_str() macro from two to one arg, so we need to detect it. WIP: needs configure to detect and set HAVE_ASSIGN_STR_2ARG Signed-off-by: Rob Norris <[email protected]>
1 parent cb36f4f commit ee94ce9

17 files changed

+57
-18
lines changed

include/os/linux/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ kernel_linux_HEADERS = \
1414
%D%/kernel/linux/simd_arm.h \
1515
%D%/kernel/linux/simd_powerpc.h \
1616
%D%/kernel/linux/simd_x86.h \
17+
%D%/kernel/linux/tracepoint_compat.h \
1718
%D%/kernel/linux/utsname_compat.h \
1819
%D%/kernel/linux/vfs_compat.h \
1920
%D%/kernel/linux/xattr_compat.h
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* CDDL HEADER START
3+
*
4+
* The contents of this file are subject to the terms of the
5+
* Common Development and Distribution License (the "License").
6+
* You may not use this file except in compliance with the License.
7+
*
8+
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9+
* or https://opensource.org/licenses/CDDL-1.0.
10+
* See the License for the specific language governing permissions
11+
* and limitations under the License.
12+
*
13+
* When distributing Covered Code, include this CDDL HEADER in each
14+
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15+
* If applicable, add the following below this CDDL HEADER, with the
16+
* fields enclosed by brackets "[]" replaced with your own identifying
17+
* information: Portions Copyright [yyyy] [name of copyright owner]
18+
*
19+
* CDDL HEADER END
20+
*/
21+
22+
/*
23+
* Copyright (c) 2024, Rob Norris <[email protected]>
24+
*/
25+
26+
#ifndef _ZFS_TRACEPOINT_COMPAT_H
27+
#define _ZFS_TRACEPOINT_COMPAT_H
28+
29+
#include <linux/tracepoint.h>
30+
31+
/* 6.10 __assign_str() dropped second arg. */
32+
#ifdef HAVE_ASSIGN_STR_2ARG
33+
#define __zfs_tracepoint_assign_str(a, b) __assign_str(a, b)
34+
#else
35+
#define __zfs_tracepoint_assign_str(a, b) __assign_str(a)
36+
37+
#endif /* _ZFS_TRACEPOINT_COMPAT_H */
38+

include/os/linux/spl/sys/trace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#if !defined(_TRACE_ZFS_H) || defined(TRACE_HEADER_MULTI_READ)
5656
#define _TRACE_ZFS_H
5757

58-
#include <linux/tracepoint.h>
58+
#include <linux/tracepoint_compat.h>
5959
#include <sys/types.h>
6060

6161
/*

include/os/linux/spl/sys/trace_taskq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#if !defined(_TRACE_TASKQ_H) || defined(TRACE_HEADER_MULTI_READ)
3232
#define _TRACE_TASKQ_H
3333

34-
#include <linux/tracepoint.h>
34+
#include <linux/tracepoint_compat.h>
3535
#include <sys/types.h>
3636

3737
/*

include/os/linux/zfs/sys/trace_acl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#if !defined(_TRACE_ACL_H) || defined(TRACE_HEADER_MULTI_READ)
3232
#define _TRACE_ACL_H
3333

34-
#include <linux/tracepoint.h>
34+
#include <linux/tracepoint_compat.h>
3535
#include <linux/vfs_compat.h>
3636
#include <sys/types.h>
3737

include/os/linux/zfs/sys/trace_arc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#if !defined(_TRACE_ARC_H) || defined(TRACE_HEADER_MULTI_READ)
3434
#define _TRACE_ARC_H
3535

36-
#include <linux/tracepoint.h>
36+
#include <linux/tracepoint_compat.h>
3737
#include <sys/types.h>
3838
#include <sys/trace_common.h> /* For ZIO macros */
3939

include/os/linux/zfs/sys/trace_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#ifndef _SYS_TRACE_COMMON_H
2828
#define _SYS_TRACE_COMMON_H
29-
#include <linux/tracepoint.h>
29+
#include <linux/tracepoint_compat.h>
3030

3131
/* ZIO macros */
3232
#define ZIO_TP_STRUCT_ENTRY \

include/os/linux/zfs/sys/trace_dbgmsg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#if !defined(_TRACE_DBGMSG_H) || defined(TRACE_HEADER_MULTI_READ)
3232
#define _TRACE_DBGMSG_H
3333

34-
#include <linux/tracepoint.h>
34+
#include <linux/tracepoint_compat.h>
3535

3636
/*
3737
* This file defines tracepoint events for use by the dbgmsg(),
@@ -59,7 +59,7 @@ DECLARE_EVENT_CLASS(zfs_dprintf_class,
5959
__string(msg, msg)
6060
),
6161
TP_fast_assign(
62-
__assign_str(msg, msg);
62+
__zfs_tracepoint_assign_str(msg, msg);
6363
),
6464
TP_printk("%s", __get_str(msg))
6565
);

include/os/linux/zfs/sys/trace_dbuf.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#if !defined(_TRACE_DBUF_H) || defined(TRACE_HEADER_MULTI_READ)
3232
#define _TRACE_DBUF_H
3333

34-
#include <linux/tracepoint.h>
34+
#include <linux/tracepoint_compat.h>
3535
#include <sys/types.h>
3636

3737
#ifndef TRACE_DBUF_MSG_MAX
@@ -61,10 +61,10 @@
6161
#define DBUF_TP_FAST_ASSIGN \
6262
if (db != NULL) { \
6363
if (POINTER_IS_VALID(DB_DNODE(db)->dn_objset)) { \
64-
__assign_str(os_spa, \
64+
__zfs_tracepoint_assign_str(os_spa, \
6565
spa_name(DB_DNODE(db)->dn_objset->os_spa)); \
6666
} else { \
67-
__assign_str(os_spa, "NULL"); \
67+
__zfs_tracepoint_assign_str(os_spa, "NULL"); \
6868
} \
6969
\
7070
__entry->ds_object = db->db_objset->os_dsl_dataset ? \

include/os/linux/zfs/sys/trace_dmu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#if !defined(_TRACE_DMU_H) || defined(TRACE_HEADER_MULTI_READ)
3232
#define _TRACE_DMU_H
3333

34-
#include <linux/tracepoint.h>
34+
#include <linux/tracepoint_compat.h>
3535
#include <sys/types.h>
3636

3737
/*

include/os/linux/zfs/sys/trace_dnode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#if !defined(_TRACE_DNODE_H) || defined(TRACE_HEADER_MULTI_READ)
3232
#define _TRACE_DNODE_H
3333

34-
#include <linux/tracepoint.h>
34+
#include <linux/tracepoint_compat.h>
3535
#include <sys/types.h>
3636

3737
/*

include/os/linux/zfs/sys/trace_multilist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#if !defined(_TRACE_MULTILIST_H) || defined(TRACE_HEADER_MULTI_READ)
3232
#define _TRACE_MULTILIST_H
3333

34-
#include <linux/tracepoint.h>
34+
#include <linux/tracepoint_compat.h>
3535
#include <sys/types.h>
3636

3737
/*

include/os/linux/zfs/sys/trace_txg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#if !defined(_TRACE_TXG_H) || defined(TRACE_HEADER_MULTI_READ)
3232
#define _TRACE_TXG_H
3333

34-
#include <linux/tracepoint.h>
34+
#include <linux/tracepoint_compat.h>
3535
#include <sys/types.h>
3636

3737
/*

include/os/linux/zfs/sys/trace_vdev.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#if !defined(_TRACE_VDEV_H) || defined(TRACE_HEADER_MULTI_READ)
3838
#define _TRACE_VDEV_H
3939

40-
#include <linux/tracepoint.h>
40+
#include <linux/tracepoint_compat.h>
4141
#include <sys/types.h>
4242

4343
/*

include/os/linux/zfs/sys/trace_zil.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#if !defined(_TRACE_ZIL_H) || defined(TRACE_HEADER_MULTI_READ)
3232
#define _TRACE_ZIL_H
3333

34-
#include <linux/tracepoint.h>
34+
#include <linux/tracepoint_compat.h>
3535
#include <sys/types.h>
3636

3737
#define ZILOG_TP_STRUCT_ENTRY \

include/os/linux/zfs/sys/trace_zio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#if !defined(_TRACE_ZIO_H) || defined(TRACE_HEADER_MULTI_READ)
3434
#define _TRACE_ZIO_H
3535

36-
#include <linux/tracepoint.h>
36+
#include <linux/tracepoint_compat.h>
3737
#include <sys/types.h>
3838
#include <sys/trace_common.h> /* For ZIO macros */
3939

include/os/linux/zfs/sys/trace_zrlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#if !defined(_TRACE_ZRLOCK_H) || defined(TRACE_HEADER_MULTI_READ)
3232
#define _TRACE_ZRLOCK_H
3333

34-
#include <linux/tracepoint.h>
34+
#include <linux/tracepoint_compat.h>
3535
#include <sys/types.h>
3636

3737
/*

0 commit comments

Comments
 (0)