]> granicus.if.org Git - zfs/commitdiff
OpenZFS restructuring - move linux tracing code to platform directories
authorMatthew Macy <mmacy@mattmacy.io>
Wed, 11 Sep 2019 21:25:53 +0000 (14:25 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 11 Sep 2019 21:25:53 +0000 (14:25 -0700)
Move Linux specific tracing headers and source to platform directories
and update the build system.

Reviewed-by: Allan Jude <allanjude@freebsd.org>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #9290

37 files changed:
include/os/linux/spl/sys/Makefile.am
include/os/linux/spl/sys/trace.h [moved from include/sys/trace.h with 100% similarity]
include/os/linux/zfs/sys/Makefile.am
include/os/linux/zfs/sys/trace_acl.h [moved from include/sys/trace_acl.h with 100% similarity]
include/os/linux/zfs/sys/trace_arc.h [moved from include/sys/trace_arc.h with 100% similarity]
include/os/linux/zfs/sys/trace_common.h [moved from include/sys/trace_common.h with 100% similarity]
include/os/linux/zfs/sys/trace_dbgmsg.h [moved from include/sys/trace_dbgmsg.h with 100% similarity]
include/os/linux/zfs/sys/trace_dbuf.h [moved from include/sys/trace_dbuf.h with 100% similarity]
include/os/linux/zfs/sys/trace_defs.h [new file with mode: 0644]
include/os/linux/zfs/sys/trace_dmu.h [moved from include/sys/trace_dmu.h with 100% similarity]
include/os/linux/zfs/sys/trace_dnode.h [moved from include/sys/trace_dnode.h with 100% similarity]
include/os/linux/zfs/sys/trace_multilist.h [moved from include/sys/trace_multilist.h with 100% similarity]
include/os/linux/zfs/sys/trace_rrwlock.h [moved from include/sys/trace_rrwlock.h with 100% similarity]
include/os/linux/zfs/sys/trace_txg.h [moved from include/sys/trace_txg.h with 100% similarity]
include/os/linux/zfs/sys/trace_vdev.h [moved from include/sys/trace_vdev.h with 96% similarity]
include/os/linux/zfs/sys/trace_zil.h [moved from include/sys/trace_zil.h with 100% similarity]
include/os/linux/zfs/sys/trace_zio.h [moved from include/sys/trace_zio.h with 100% similarity]
include/os/linux/zfs/sys/trace_zrlock.h [moved from include/sys/trace_zrlock.h with 100% similarity]
include/sys/Makefile.am
lib/libspl/include/sys/Makefile.am
lib/libspl/include/sys/trace_defs.h [new file with mode: 0644]
module/os/linux/zfs/Makefile.in
module/os/linux/zfs/trace.c [moved from module/zfs/trace.c with 96% similarity]
module/zfs/Makefile.in
module/zfs/arc.c
module/zfs/dbuf.c
module/zfs/dmu.c
module/zfs/dmu_tx.c
module/zfs/dnode.c
module/zfs/dsl_pool.c
module/zfs/multilist.c
module/zfs/rrwlock.c
module/zfs/txg.c
module/zfs/vdev_removal.c
module/zfs/zil.c
module/zfs/zio.c
module/zfs/zrlock.c

index de2f74d8cda3c31eb75d1e6c3888e349898b2abf..934289321e8aaf566d7ace872be0de1d66543469 100644 (file)
@@ -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 \
index 5aa87da37c4a32c2a91441bdd98874637edf755a..c4e2df0d7e98f3473ff61bda124bb260460d166b 100644 (file)
@@ -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/os/linux/zfs/sys/trace_defs.h b/include/os/linux/zfs/sys/trace_defs.h
new file mode 100644 (file)
index 0000000..aaff65f
--- /dev/null
@@ -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 <sys/multilist.h>
+#include <sys/arc_impl.h>
+#include <sys/vdev_impl.h>
+#include <sys/zio.h>
+#include <sys/dbuf.h>
+#include <sys/dmu_objset.h>
+#include <sys/dsl_dataset.h>
+#include <sys/dmu_tx.h>
+#include <sys/dnode.h>
+#include <sys/zfs_znode.h>
+#include <sys/zil_impl.h>
+#include <sys/zrlock.h>
+
+#include <sys/trace.h>
+#include <sys/trace_acl.h>
+#include <sys/trace_arc.h>
+#include <sys/trace_dbuf.h>
+#include <sys/trace_dmu.h>
+#include <sys/trace_dnode.h>
+#include <sys/trace_multilist.h>
+#include <sys/trace_rrwlock.h>
+#include <sys/trace_txg.h>
+#include <sys/trace_vdev.h>
+#include <sys/trace_zil.h>
+#include <sys/trace_zio.h>
+#include <sys/trace_zrlock.h>
+
+#endif
similarity index 96%
rename from include/sys/trace_vdev.h
rename to include/os/linux/zfs/sys/trace_vdev.h
index 13688a99e437646b9f20e60ae73768f945a84f21..50711446ffa4be12e8bd6c88e311678b8434e62c 100644 (file)
@@ -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);
index 75033d91300473dab9e58510408dbd5c571265fc..897b7e1cc49bfbf7e4609e940e7305a66d9d0e3d 100644 (file)
@@ -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 \
index 5156e2912ca5f3b79a6f6d6a7663d34b4ced8185..60ddb7881a1e9351b40b02535f27e758b289133d 100644 (file)
@@ -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 (file)
index 0000000..a96e293
--- /dev/null
@@ -0,0 +1 @@
+/* Here to keep the libspl build happy */
index 84900bd2c30b5234734eb56513643355c9c4a1a1..2165e7f7496fd89a96f2f20dc6d1152131dfaaa4 100644 (file)
@@ -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
similarity index 96%
rename from module/zfs/trace.c
rename to module/os/linux/zfs/trace.c
index fe503776b4d9aa602c6935e72c5afa77b44e2a02..7b2f981ee9749c33a3e5ec134e38f88a3a17a734 100644 (file)
 #include <sys/dsl_dataset.h>
 #include <sys/dmu_tx.h>
 #include <sys/dnode.h>
-#include <sys/multilist.h>
 #include <sys/zfs_znode.h>
 #include <sys/zil_impl.h>
-#include <sys/zrlock.h>
 
+#ifdef _KERNEL
 #define        CREATE_TRACE_POINTS
 #include <sys/trace.h>
 #include <sys/trace_acl.h>
@@ -52,3 +51,4 @@
 #include <sys/trace_zil.h>
 #include <sys/trace_zio.h>
 #include <sys/trace_zrlock.h>
+#endif
index 7c560fad77de39c0ff41b45b994a7d0a8ddf3be0..b60b799b57c88f62d2960c055764d319edceb5e2 100644 (file)
@@ -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
index 21f3dee0773ac49bb208c24687b2efdbe11c93e9..709a565b16acca2cfd472e354d9a7f8574c9751f 100644 (file)
 #include <sys/zthr.h>
 #include <zfs_fletcher.h>
 #include <sys/arc_impl.h>
-#include <sys/trace_arc.h>
+#include <sys/trace_defs.h>
 #include <sys/aggsum.h>
 #include <sys/cityhash.h>
 
index dd33ae97c9d0a0928577e52680c5a0070628ef82..ca6032ed244c4fdf7514e20072fe4cf4984ae752 100644 (file)
@@ -44,7 +44,7 @@
 #include <sys/zfeature.h>
 #include <sys/blkptr.h>
 #include <sys/range_tree.h>
-#include <sys/trace_dbuf.h>
+#include <sys/trace_defs.h>
 #include <sys/callb.h>
 #include <sys/abd.h>
 #include <sys/vdev.h>
index 861858e3a9569104057b903b8375aa5fb14f42ba..895cac58e833d183090cc8e2db7f2d7255a449d7 100644 (file)
@@ -49,7 +49,7 @@
 #include <sys/sa.h>
 #include <sys/zfeature.h>
 #include <sys/abd.h>
-#include <sys/trace_dmu.h>
+#include <sys/trace_defs.h>
 #include <sys/zfs_rlock.h>
 #ifdef _KERNEL
 #include <sys/vmsystm.h>
index fcbe3028797e9d5580f322e144954de1d86eafb3..66dbb583a1342d5063ef8bbec3e443d8c24efbdb 100644 (file)
@@ -37,7 +37,7 @@
 #include <sys/sa.h>
 #include <sys/sa_impl.h>
 #include <sys/zfs_context.h>
-#include <sys/trace_dmu.h>
+#include <sys/trace_defs.h>
 
 typedef void (*dmu_tx_hold_func_t)(dmu_tx_t *tx, struct dnode *dn,
     uint64_t arg1, uint64_t arg2);
index 4ee192ed5e9520dd98471a14d0d93b38f31afe4c..95132344c2a97402bfc6b21949b38c11503fd5c9 100644 (file)
@@ -37,7 +37,7 @@
 #include <sys/zio.h>
 #include <sys/dmu_zfetch.h>
 #include <sys/range_tree.h>
-#include <sys/trace_dnode.h>
+#include <sys/trace_defs.h>
 #include <sys/zfs_project.h>
 
 dnode_stats_t dnode_stats = {
index 09045bb4728619427f6b1e25660bca49c667acf1..4fffe4cb5a342209aad380e955585b0f8f898f28 100644 (file)
@@ -48,7 +48,7 @@
 #include <sys/zfeature.h>
 #include <sys/zil_impl.h>
 #include <sys/dsl_userhold.h>
-#include <sys/trace_txg.h>
+#include <sys/trace_defs.h>
 #include <sys/mmp.h>
 
 /*
index 6f935917cb1895368685fd21743ff4c74c8088d5..73cf8cbbc21e505ab6dc6df5fc1368ca68c61721 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <sys/zfs_context.h>
 #include <sys/multilist.h>
-#include <sys/trace_multilist.h>
+#include <sys/trace_defs.h>
 
 /* needed for spa_get_random() */
 #include <sys/spa.h>
index 32d45f674ac47dd17ffd6a204c26893d2d2f16ad..c48a5d3ed7880fd79dcdecfe7fe3bf1967829914 100644 (file)
@@ -28,7 +28,7 @@
 
 #include <sys/refcount.h>
 #include <sys/rrwlock.h>
-#include <sys/trace_rrwlock.h>
+#include <sys/trace_defs.h>
 
 /*
  * This file contains the implementation of a re-entrant read
index 2a5f4f68966c653daba6203b71566b50cb5a484d..ae96f5ec0df88137da06b81663c43ab2f58a7680 100644 (file)
@@ -33,7 +33,7 @@
 #include <sys/dsl_scan.h>
 #include <sys/zil.h>
 #include <sys/callb.h>
-#include <sys/trace_txg.h>
+#include <sys/trace_defs.h>
 
 /*
  * ZFS Transaction Groups
index 3ba06e4acf062a193f8427e397685e0f8dbee37e..c9156054cd7fe2a1c2361332712ba8a73bd4d845 100644 (file)
@@ -46,7 +46,7 @@
 #include <sys/abd.h>
 #include <sys/vdev_initialize.h>
 #include <sys/vdev_trim.h>
-#include <sys/trace_vdev.h>
+#include <sys/trace_defs.h>
 
 /*
  * This file contains the necessary logic to remove vdevs from a
index 9df5820e5fe3260d83a31462044086e7673240a2..30a73515c7fe2ab0b847d393c7ec14a63e0f8961 100644 (file)
@@ -41,7 +41,7 @@
 #include <sys/dmu_tx.h>
 #include <sys/dsl_pool.h>
 #include <sys/metaslab.h>
-#include <sys/trace_zil.h>
+#include <sys/trace_defs.h>
 #include <sys/abd.h>
 
 /*
index f966023aaa0a1c8e3f754594f866f9e5ed0a59b4..1e341e2246979312c7acbdf4146bd51998ab5129 100644 (file)
@@ -44,7 +44,7 @@
 #include <sys/dsl_scan.h>
 #include <sys/metaslab_impl.h>
 #include <sys/time.h>
-#include <sys/trace_zio.h>
+#include <sys/trace_defs.h>
 #include <sys/abd.h>
 #include <sys/dsl_crypt.h>
 #include <sys/cityhash.h>
index 014a5cc6c7e04203d2f19f0b11a1e8958e30a7db..fe9044f2cff79eaae557c159d78a8215a591ce3e 100644 (file)
@@ -39,7 +39,7 @@
  * function calls.
  */
 #include <sys/zrlock.h>
-#include <sys/trace_zrlock.h>
+#include <sys/trace_defs.h>
 
 /*
  * A ZRL can be locked only while there are zero references, so ZRL_LOCKED is