From d66620681d85105256203b4f4407f0092e5a7fe7 Mon Sep 17 00:00:00 2001 From: Matthew Macy Date: Wed, 11 Sep 2019 14:25:53 -0700 Subject: [PATCH] OpenZFS restructuring - move linux tracing code to platform directories Move Linux specific tracing headers and source to platform directories and update the build system. Reviewed-by: Allan Jude Reviewed-by: Ryan Moeller Reviewed by: Brad Lewis Reviewed-by: Brian Behlendorf Signed-off-by: Matt Macy Closes #9290 --- include/os/linux/spl/sys/Makefile.am | 1 + include/{ => os/linux/spl}/sys/trace.h | 0 include/os/linux/zfs/sys/Makefile.am | 15 ++++++ include/{ => os/linux/zfs}/sys/trace_acl.h | 0 include/{ => os/linux/zfs}/sys/trace_arc.h | 0 include/{ => os/linux/zfs}/sys/trace_common.h | 0 include/{ => os/linux/zfs}/sys/trace_dbgmsg.h | 0 include/{ => os/linux/zfs}/sys/trace_dbuf.h | 0 include/os/linux/zfs/sys/trace_defs.h | 52 +++++++++++++++++++ include/{ => os/linux/zfs}/sys/trace_dmu.h | 0 include/{ => os/linux/zfs}/sys/trace_dnode.h | 0 .../{ => os/linux/zfs}/sys/trace_multilist.h | 0 .../{ => os/linux/zfs}/sys/trace_rrwlock.h | 0 include/{ => os/linux/zfs}/sys/trace_txg.h | 0 include/{ => os/linux/zfs}/sys/trace_vdev.h | 6 +-- include/{ => os/linux/zfs}/sys/trace_zil.h | 0 include/{ => os/linux/zfs}/sys/trace_zio.h | 0 include/{ => os/linux/zfs}/sys/trace_zrlock.h | 0 include/sys/Makefile.am | 15 ------ lib/libspl/include/sys/Makefile.am | 1 + lib/libspl/include/sys/trace_defs.h | 1 + module/os/linux/zfs/Makefile.in | 1 + module/{ => os/linux}/zfs/trace.c | 4 +- module/zfs/Makefile.in | 1 - module/zfs/arc.c | 2 +- module/zfs/dbuf.c | 2 +- module/zfs/dmu.c | 2 +- module/zfs/dmu_tx.c | 2 +- module/zfs/dnode.c | 2 +- module/zfs/dsl_pool.c | 2 +- module/zfs/multilist.c | 2 +- module/zfs/rrwlock.c | 2 +- module/zfs/txg.c | 2 +- module/zfs/vdev_removal.c | 2 +- module/zfs/zil.c | 2 +- module/zfs/zio.c | 2 +- module/zfs/zrlock.c | 2 +- 37 files changed, 89 insertions(+), 34 deletions(-) rename include/{ => os/linux/spl}/sys/trace.h (100%) rename include/{ => os/linux/zfs}/sys/trace_acl.h (100%) rename include/{ => os/linux/zfs}/sys/trace_arc.h (100%) rename include/{ => os/linux/zfs}/sys/trace_common.h (100%) rename include/{ => os/linux/zfs}/sys/trace_dbgmsg.h (100%) rename include/{ => os/linux/zfs}/sys/trace_dbuf.h (100%) create mode 100644 include/os/linux/zfs/sys/trace_defs.h rename include/{ => os/linux/zfs}/sys/trace_dmu.h (100%) rename include/{ => os/linux/zfs}/sys/trace_dnode.h (100%) rename include/{ => os/linux/zfs}/sys/trace_multilist.h (100%) rename include/{ => os/linux/zfs}/sys/trace_rrwlock.h (100%) rename include/{ => os/linux/zfs}/sys/trace_txg.h (100%) rename include/{ => os/linux/zfs}/sys/trace_vdev.h (96%) rename include/{ => os/linux/zfs}/sys/trace_zil.h (100%) rename include/{ => os/linux/zfs}/sys/trace_zio.h (100%) rename include/{ => os/linux/zfs}/sys/trace_zrlock.h (100%) create mode 100644 lib/libspl/include/sys/trace_defs.h rename module/{ => os/linux}/zfs/trace.c (96%) diff --git a/include/os/linux/spl/sys/Makefile.am b/include/os/linux/spl/sys/Makefile.am index de2f74d8c..934289321 100644 --- a/include/os/linux/spl/sys/Makefile.am +++ b/include/os/linux/spl/sys/Makefile.am @@ -43,6 +43,7 @@ KERNEL_H = \ $(top_srcdir)/include/os/linux/spl/sys/thread.h \ $(top_srcdir)/include/os/linux/spl/sys/time.h \ $(top_srcdir)/include/os/linux/spl/sys/timer.h \ + $(top_srcdir)/include/os/linux/spl/sys/trace.h \ $(top_srcdir)/include/os/linux/spl/sys/tsd.h \ $(top_srcdir)/include/os/linux/spl/sys/types32.h \ $(top_srcdir)/include/os/linux/spl/sys/types.h \ diff --git a/include/sys/trace.h b/include/os/linux/spl/sys/trace.h similarity index 100% rename from include/sys/trace.h rename to include/os/linux/spl/sys/trace.h diff --git a/include/os/linux/zfs/sys/Makefile.am b/include/os/linux/zfs/sys/Makefile.am index 5aa87da37..c4e2df0d7 100644 --- a/include/os/linux/zfs/sys/Makefile.am +++ b/include/os/linux/zfs/sys/Makefile.am @@ -1,5 +1,20 @@ KERNEL_H = \ $(top_srcdir)/include/os/linux/zfs/sys/policy.h \ + $(top_srcdir)/include/os/linux/zfs/sys/trace_acl.h \ + $(top_srcdir)/include/os/linux/zfs/sys/trace_arc.h \ + $(top_srcdir)/include/os/linux/zfs/sys/trace_common.h \ + $(top_srcdir)/include/os/linux/zfs/sys/trace_defs.h \ + $(top_srcdir)/include/os/linux/zfs/sys/trace_dbgmsg.h \ + $(top_srcdir)/include/os/linux/zfs/sys/trace_dbuf.h \ + $(top_srcdir)/include/os/linux/zfs/sys/trace_dmu.h \ + $(top_srcdir)/include/os/linux/zfs/sys/trace_dnode.h \ + $(top_srcdir)/include/os/linux/zfs/sys/trace_multilist.h \ + $(top_srcdir)/include/os/linux/zfs/sys/trace_rrwlock.h \ + $(top_srcdir)/include/os/linux/zfs/sys/trace_txg.h \ + $(top_srcdir)/include/os/linux/zfs/sys/trace_vdev.h \ + $(top_srcdir)/include/os/linux/zfs/sys/trace_zil.h \ + $(top_srcdir)/include/os/linux/zfs/sys/trace_zio.h \ + $(top_srcdir)/include/os/linux/zfs/sys/trace_zrlock.h \ $(top_srcdir)/include/os/linux/zfs/sys/zfs_ctldir.h \ $(top_srcdir)/include/os/linux/zfs/sys/zfs_dir.h \ $(top_srcdir)/include/os/linux/zfs/sys/zfs_vfsops.h \ diff --git a/include/sys/trace_acl.h b/include/os/linux/zfs/sys/trace_acl.h similarity index 100% rename from include/sys/trace_acl.h rename to include/os/linux/zfs/sys/trace_acl.h diff --git a/include/sys/trace_arc.h b/include/os/linux/zfs/sys/trace_arc.h similarity index 100% rename from include/sys/trace_arc.h rename to include/os/linux/zfs/sys/trace_arc.h diff --git a/include/sys/trace_common.h b/include/os/linux/zfs/sys/trace_common.h similarity index 100% rename from include/sys/trace_common.h rename to include/os/linux/zfs/sys/trace_common.h diff --git a/include/sys/trace_dbgmsg.h b/include/os/linux/zfs/sys/trace_dbgmsg.h similarity index 100% rename from include/sys/trace_dbgmsg.h rename to include/os/linux/zfs/sys/trace_dbgmsg.h diff --git a/include/sys/trace_dbuf.h b/include/os/linux/zfs/sys/trace_dbuf.h similarity index 100% rename from include/sys/trace_dbuf.h rename to include/os/linux/zfs/sys/trace_dbuf.h diff --git a/include/os/linux/zfs/sys/trace_defs.h b/include/os/linux/zfs/sys/trace_defs.h new file mode 100644 index 000000000..aaff65fbc --- /dev/null +++ b/include/os/linux/zfs/sys/trace_defs.h @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +#ifndef _OS_LINUX_ZFS_TRACE_H +#define _OS_LINUX_ZFS_TRACE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/sys/trace_dmu.h b/include/os/linux/zfs/sys/trace_dmu.h similarity index 100% rename from include/sys/trace_dmu.h rename to include/os/linux/zfs/sys/trace_dmu.h diff --git a/include/sys/trace_dnode.h b/include/os/linux/zfs/sys/trace_dnode.h similarity index 100% rename from include/sys/trace_dnode.h rename to include/os/linux/zfs/sys/trace_dnode.h diff --git a/include/sys/trace_multilist.h b/include/os/linux/zfs/sys/trace_multilist.h similarity index 100% rename from include/sys/trace_multilist.h rename to include/os/linux/zfs/sys/trace_multilist.h diff --git a/include/sys/trace_rrwlock.h b/include/os/linux/zfs/sys/trace_rrwlock.h similarity index 100% rename from include/sys/trace_rrwlock.h rename to include/os/linux/zfs/sys/trace_rrwlock.h diff --git a/include/sys/trace_txg.h b/include/os/linux/zfs/sys/trace_txg.h similarity index 100% rename from include/sys/trace_txg.h rename to include/os/linux/zfs/sys/trace_txg.h diff --git a/include/sys/trace_vdev.h b/include/os/linux/zfs/sys/trace_vdev.h similarity index 96% rename from include/sys/trace_vdev.h rename to include/os/linux/zfs/sys/trace_vdev.h index 13688a99e..50711446f 100644 --- a/include/sys/trace_vdev.h +++ b/include/os/linux/zfs/sys/trace_vdev.h @@ -24,8 +24,8 @@ /* * If tracepoints are available define dtrace_probe events for vdev - * related probes. Definitions in usr/include/trace.h will map - * DTRACE_PROBE* calls to tracepoints. + * related probes. Definitions in include/os/linux/spl/sys/trace.h + * will map DTRACE_PROBE* calls to tracepoints. */ #undef TRACE_SYSTEM @@ -129,7 +129,7 @@ DEFINE_REMOVE_FREE_EVENT_TXG(zfs_remove__free__inflight); * When tracepoints are not available, a DEFINE_DTRACE_PROBE* macro is * needed for each DTRACE_PROBE. These will be used to generate stub * tracing functions and prototypes for those functions. See - * include/sys/trace.h. + * include/os/linux/spl/sys/trace.h. */ DEFINE_DTRACE_PROBE3(remove__free__synced); diff --git a/include/sys/trace_zil.h b/include/os/linux/zfs/sys/trace_zil.h similarity index 100% rename from include/sys/trace_zil.h rename to include/os/linux/zfs/sys/trace_zil.h diff --git a/include/sys/trace_zio.h b/include/os/linux/zfs/sys/trace_zio.h similarity index 100% rename from include/sys/trace_zio.h rename to include/os/linux/zfs/sys/trace_zio.h diff --git a/include/sys/trace_zrlock.h b/include/os/linux/zfs/sys/trace_zrlock.h similarity index 100% rename from include/sys/trace_zrlock.h rename to include/os/linux/zfs/sys/trace_zrlock.h diff --git a/include/sys/Makefile.am b/include/sys/Makefile.am index 75033d913..897b7e1cc 100644 --- a/include/sys/Makefile.am +++ b/include/sys/Makefile.am @@ -70,21 +70,6 @@ COMMON_H = \ $(top_srcdir)/include/sys/spa_impl.h \ $(top_srcdir)/include/sys/spa_checksum.h \ $(top_srcdir)/include/sys/sysevent.h \ - $(top_srcdir)/include/sys/trace.h \ - $(top_srcdir)/include/sys/trace_acl.h \ - $(top_srcdir)/include/sys/trace_arc.h \ - $(top_srcdir)/include/sys/trace_common.h \ - $(top_srcdir)/include/sys/trace_dbgmsg.h \ - $(top_srcdir)/include/sys/trace_dbuf.h \ - $(top_srcdir)/include/sys/trace_dmu.h \ - $(top_srcdir)/include/sys/trace_dnode.h \ - $(top_srcdir)/include/sys/trace_multilist.h \ - $(top_srcdir)/include/sys/trace_rrwlock.h \ - $(top_srcdir)/include/sys/trace_txg.h \ - $(top_srcdir)/include/sys/trace_vdev.h \ - $(top_srcdir)/include/sys/trace_zil.h \ - $(top_srcdir)/include/sys/trace_zio.h \ - $(top_srcdir)/include/sys/trace_zrlock.h \ $(top_srcdir)/include/sys/txg.h \ $(top_srcdir)/include/sys/txg_impl.h \ $(top_srcdir)/include/sys/u8_textprep_data.h \ diff --git a/lib/libspl/include/sys/Makefile.am b/lib/libspl/include/sys/Makefile.am index 5156e2912..60ddb7881 100644 --- a/lib/libspl/include/sys/Makefile.am +++ b/lib/libspl/include/sys/Makefile.am @@ -43,6 +43,7 @@ libspl_HEADERS = \ $(top_srcdir)/lib/libspl/include/sys/sysmacros.h \ $(top_srcdir)/lib/libspl/include/sys/systeminfo.h \ $(top_srcdir)/lib/libspl/include/sys/time.h \ + $(top_srcdir)/lib/libspl/include/sys/trace_defs.h \ $(top_srcdir)/lib/libspl/include/sys/types32.h \ $(top_srcdir)/lib/libspl/include/sys/types.h \ $(top_srcdir)/lib/libspl/include/sys/tzfile.h \ diff --git a/lib/libspl/include/sys/trace_defs.h b/lib/libspl/include/sys/trace_defs.h new file mode 100644 index 000000000..a96e29318 --- /dev/null +++ b/lib/libspl/include/sys/trace_defs.h @@ -0,0 +1 @@ +/* Here to keep the libspl build happy */ diff --git a/module/os/linux/zfs/Makefile.in b/module/os/linux/zfs/Makefile.in index 84900bd2c..2165e7f74 100644 --- a/module/os/linux/zfs/Makefile.in +++ b/module/os/linux/zfs/Makefile.in @@ -11,6 +11,7 @@ ccflags-y += -I@abs_top_srcdir@/module/os/linux/zfs $(MODULE)-objs += ../os/linux/zfs/abd.o $(MODULE)-objs += ../os/linux/zfs/policy.o +$(MODULE)-objs += ../os/linux/zfs/trace.o $(MODULE)-objs += ../os/linux/zfs/qat.o $(MODULE)-objs += ../os/linux/zfs/qat_compress.o $(MODULE)-objs += ../os/linux/zfs/qat_crypt.o diff --git a/module/zfs/trace.c b/module/os/linux/zfs/trace.c similarity index 96% rename from module/zfs/trace.c rename to module/os/linux/zfs/trace.c index fe503776b..7b2f981ee 100644 --- a/module/zfs/trace.c +++ b/module/os/linux/zfs/trace.c @@ -33,11 +33,10 @@ #include #include #include -#include #include #include -#include +#ifdef _KERNEL #define CREATE_TRACE_POINTS #include #include @@ -52,3 +51,4 @@ #include #include #include +#endif diff --git a/module/zfs/Makefile.in b/module/zfs/Makefile.in index 7c560fad7..b60b799b5 100644 --- a/module/zfs/Makefile.in +++ b/module/zfs/Makefile.in @@ -80,7 +80,6 @@ $(MODULE)-objs += spa_log_spacemap.o $(MODULE)-objs += spa_misc.o $(MODULE)-objs += space_map.o $(MODULE)-objs += space_reftree.o -$(MODULE)-objs += trace.o $(MODULE)-objs += txg.o $(MODULE)-objs += uberblock.o $(MODULE)-objs += unique.o diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 21f3dee07..709a565b1 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -302,7 +302,7 @@ #include #include #include -#include +#include #include #include diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c index dd33ae97c..ca6032ed2 100644 --- a/module/zfs/dbuf.c +++ b/module/zfs/dbuf.c @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c index 861858e3a..895cac58e 100644 --- a/module/zfs/dmu.c +++ b/module/zfs/dmu.c @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #ifdef _KERNEL #include diff --git a/module/zfs/dmu_tx.c b/module/zfs/dmu_tx.c index fcbe30287..66dbb583a 100644 --- a/module/zfs/dmu_tx.c +++ b/module/zfs/dmu_tx.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include typedef void (*dmu_tx_hold_func_t)(dmu_tx_t *tx, struct dnode *dn, uint64_t arg1, uint64_t arg2); diff --git a/module/zfs/dnode.c b/module/zfs/dnode.c index 4ee192ed5..95132344c 100644 --- a/module/zfs/dnode.c +++ b/module/zfs/dnode.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include dnode_stats_t dnode_stats = { diff --git a/module/zfs/dsl_pool.c b/module/zfs/dsl_pool.c index 09045bb47..4fffe4cb5 100644 --- a/module/zfs/dsl_pool.c +++ b/module/zfs/dsl_pool.c @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include /* diff --git a/module/zfs/multilist.c b/module/zfs/multilist.c index 6f935917c..73cf8cbbc 100644 --- a/module/zfs/multilist.c +++ b/module/zfs/multilist.c @@ -18,7 +18,7 @@ #include #include -#include +#include /* needed for spa_get_random() */ #include diff --git a/module/zfs/rrwlock.c b/module/zfs/rrwlock.c index 32d45f674..c48a5d3ed 100644 --- a/module/zfs/rrwlock.c +++ b/module/zfs/rrwlock.c @@ -28,7 +28,7 @@ #include #include -#include +#include /* * This file contains the implementation of a re-entrant read diff --git a/module/zfs/txg.c b/module/zfs/txg.c index 2a5f4f689..ae96f5ec0 100644 --- a/module/zfs/txg.c +++ b/module/zfs/txg.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include /* * ZFS Transaction Groups diff --git a/module/zfs/vdev_removal.c b/module/zfs/vdev_removal.c index 3ba06e4ac..c9156054c 100644 --- a/module/zfs/vdev_removal.c +++ b/module/zfs/vdev_removal.c @@ -46,7 +46,7 @@ #include #include #include -#include +#include /* * This file contains the necessary logic to remove vdevs from a diff --git a/module/zfs/zil.c b/module/zfs/zil.c index 9df5820e5..30a73515c 100644 --- a/module/zfs/zil.c +++ b/module/zfs/zil.c @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include /* diff --git a/module/zfs/zio.c b/module/zfs/zio.c index f966023aa..1e341e224 100644 --- a/module/zfs/zio.c +++ b/module/zfs/zio.c @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/module/zfs/zrlock.c b/module/zfs/zrlock.c index 014a5cc6c..fe9044f2c 100644 --- a/module/zfs/zrlock.c +++ b/module/zfs/zrlock.c @@ -39,7 +39,7 @@ * function calls. */ #include -#include +#include /* * A ZRL can be locked only while there are zero references, so ZRL_LOCKED is -- 2.40.0