Skip to content

Commit

Permalink
Make spa_stats.c tunables visible on FreeBSD
Browse files Browse the repository at this point in the history
Use ZFS_MODULE_PARAM for cross-platform tunables in spa_stats.c, and
add update tunables.cfg in tests for the newly supported ones.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #10858
  • Loading branch information
Ryan Moeller authored Sep 1, 2020
1 parent e84e492 commit 964791a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
30 changes: 12 additions & 18 deletions module/zfs/spa_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -1028,22 +1028,16 @@ spa_stats_destroy(spa_t *spa)
spa_mmp_history_destroy(spa);
}

#if defined(_KERNEL)
/* CSTYLED */
module_param(zfs_read_history, int, 0644);
MODULE_PARM_DESC(zfs_read_history,
"Historical statistics for the last N reads");

module_param(zfs_read_history_hits, int, 0644);
MODULE_PARM_DESC(zfs_read_history_hits,
"Include cache hits in read history");

module_param(zfs_txg_history, int, 0644);
MODULE_PARM_DESC(zfs_txg_history,
"Historical statistics for the last N txgs");

module_param(zfs_multihost_history, int, 0644);
MODULE_PARM_DESC(zfs_multihost_history,
"Historical statistics for last N multihost writes");
/* BEGIN CSTYLED */
ZFS_MODULE_PARAM(zfs, zfs_, read_history, INT, ZMOD_RW,
"Historical statistics for the last N reads");

ZFS_MODULE_PARAM(zfs, zfs_, read_history_hits, INT, ZMOD_RW,
"Include cache hits in read history");

ZFS_MODULE_PARAM(zfs_txg, zfs_txg_, history, INT, ZMOD_RW,
"Historical statistics for the last N txgs");

ZFS_MODULE_PARAM(zfs_multihost, zfs_multihost_, history, INT, ZMOD_RW,
"Historical statistics for last N multihost writes");
/* END CSTYLED */
#endif
4 changes: 2 additions & 2 deletions tests/zfs-tests/include/tunables.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ MAX_MISSING_TVDS max_missing_tvds zfs_max_missing_tvds
METASLAB_DEBUG_LOAD metaslab.debug_load metaslab_debug_load
METASLAB_FORCE_GANGING metaslab.force_ganging metaslab_force_ganging
MULTIHOST_FAIL_INTERVALS multihost.fail_intervals zfs_multihost_fail_intervals
MULTIHOST_HISTORY UNSUPPORTED zfs_multihost_history
MULTIHOST_HISTORY multihost.history zfs_multihost_history
MULTIHOST_IMPORT_INTERVALS multihost.import_intervals zfs_multihost_import_intervals
MULTIHOST_INTERVAL multihost.interval zfs_multihost_interval
OVERRIDE_ESTIMATE_RECORDSIZE send.override_estimate_recordsize zfs_override_estimate_recordsize
Expand All @@ -73,7 +73,7 @@ SPA_LOAD_VERIFY_METADATA spa.load_verify_metadata spa_load_verify_metadata
TRIM_EXTENT_BYTES_MIN trim.extent_bytes_min zfs_trim_extent_bytes_min
TRIM_METASLAB_SKIP trim.metaslab_skip zfs_trim_metaslab_skip
TRIM_TXG_BATCH trim.txg_batch zfs_trim_txg_batch
TXG_HISTORY UNSUPPORTED zfs_txg_history
TXG_HISTORY txg.history zfs_txg_history
TXG_TIMEOUT txg.timeout zfs_txg_timeout
UNLINK_SUSPEND_PROGRESS UNSUPPORTED zfs_unlink_suspend_progress
VDEV_MIN_MS_COUNT vdev.min_ms_count zfs_vdev_min_ms_count
Expand Down

0 comments on commit 964791a

Please sign in to comment.