Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Jul 2019 18:40:36 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r349821 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201907071840.x67Ieamh070053@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun Jul  7 18:40:35 2019
New Revision: 349821
URL: https://svnweb.freebsd.org/changeset/base/349821

Log:
  MFC r349039: Alike to ZoL disable metaslab allocation tracing code.
  
  It is too generous to collect in production debug traces that can only
  be read with kernel debugger.  Illumos includes special code in their
  mdb debugger to read it, we don't.

Modified:
  stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
==============================================================================
--- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Sun Jul  7 18:39:32 2019	(r349820)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Sun Jul  7 18:40:35 2019	(r349821)
@@ -259,7 +259,9 @@ int zfs_metaslab_switch_threshold = 2;
  * Internal switch to enable/disable the metaslab allocation tracing
  * facility.
  */
+#ifdef _METASLAB_TRACING
 boolean_t metaslab_trace_enabled = B_TRUE;
+#endif
 
 /*
  * Maximum entries that the metaslab allocation tracing facility will keep
@@ -269,7 +271,9 @@ boolean_t metaslab_trace_enabled = B_TRUE;
  * to every exceed this value. In debug mode, the system will panic if this
  * limit is ever reached allowing for further investigation.
  */
+#ifdef _METASLAB_TRACING
 uint64_t metaslab_trace_max_entries = 5000;
+#endif
 
 static uint64_t metaslab_weight(metaslab_t *);
 static void metaslab_set_fragmentation(metaslab_t *);
@@ -277,8 +281,9 @@ static void metaslab_free_impl(vdev_t *, uint64_t, uin
 static void metaslab_check_free_impl(vdev_t *, uint64_t, uint64_t);
 static void metaslab_passivate(metaslab_t *msp, uint64_t weight);
 static uint64_t metaslab_weight_from_range_tree(metaslab_t *msp);
-
+#ifdef _METASLAB_TRACING
 kmem_cache_t *metaslab_alloc_trace_cache;
+#endif
 
 /*
  * ==========================================================================
@@ -2797,6 +2802,7 @@ metaslab_distance(metaslab_t *msp, dva_t *dva)
  * Metaslab allocation tracing facility
  * ==========================================================================
  */
+#ifdef _METASLAB_TRACING
 kstat_t *metaslab_trace_ksp;
 kstat_named_t metaslab_trace_over_limit;
 
@@ -2900,6 +2906,32 @@ metaslab_trace_fini(zio_alloc_list_t *zal)
 	list_destroy(&zal->zal_list);
 	zal->zal_size = 0;
 }
+
+#else
+
+#define	metaslab_trace_add(zal, mg, msp, psize, id, off, alloc)
+
+void
+metaslab_alloc_trace_init(void)
+{
+}
+
+void
+metaslab_alloc_trace_fini(void)
+{
+}
+
+void
+metaslab_trace_init(zio_alloc_list_t *zal)
+{
+}
+
+void
+metaslab_trace_fini(zio_alloc_list_t *zal)
+{
+}
+
+#endif /* _METASLAB_TRACING */
 
 /*
  * ==========================================================================



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907071840.x67Ieamh070053>