aboutsummaryrefslogtreecommitdiff
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h
diff options
context:
space:
mode:
authorAllan Jude <allanjude@FreeBSD.org>2020-09-13 16:28:25 +0000
committerAllan Jude <allanjude@FreeBSD.org>2020-09-13 16:28:25 +0000
commit87257e32d1528e58fd89135fc03f60d185506205 (patch)
tree7dc442f51b44ea15bd44569f8169e69903a3ee82 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h
parent43e28945fb6e5c5826a1e0c9b5a8381bff9f1cc5 (diff)
downloadsrc-87257e32d1528e58fd89135fc03f60d185506205.tar.gz
src-87257e32d1528e58fd89135fc03f60d185506205.zip
MFOpenZFS: Introduce read/write kstats per dataset
The following patch introduces a few statistics on reads and writes grouped by dataset. These statistics are implemented as kstats (backed by aggregate sums for performance) and can be retrieved by using the dataset objset ID number. The motivation for this change is to provide some preliminary analytics on dataset usage/performance. Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com> openzfs/zfs@a448a2557ec4938ed6944c7766fe0b8e6e5f6456 Also contains parts of: MFOpenZFS: Connect dataset_kstats for FreeBSD Example output: kstat.zfs/mypool.dataset.objset-0x10b.nread: 150528 kstat.zfs/mypool.dataset.objset-0x10b.reads: 48 kstat.zfs/mypool.dataset.objset-0x10b.nwritten: 134217728 kstat.zfs/mypool.dataset.objset-0x10b.writes: 1024 kstat.zfs/mypool.dataset.objset-0x10b.dataset_name: mypool/datasetname Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed by: Sean Eric Fagan <sef@ixsystems.com> Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Allan Jude <allan@klarasystems.com> openzfs/zfs@4547fc4e071ceb1818b3a46c3035b923e06e5390 This is a direct commit to stable/12 because they do not exist in illumos upstream ZFS and needed to be heavily modified to work in stable/12 Relnotes: yes Sponsored by: Klara Inc.
Notes
Notes: svn path=/stable/12/; revision=365689
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h
index bbfb79ce24d3..0868d9440528 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018 by Delphix. All rights reserved.
* Copyright (c) 2011 Pawel Jakub Dawidek <pawel@dawidek.net>.
* All rights reserved.
*/
@@ -27,6 +28,7 @@
#ifndef _SYS_FS_ZFS_VFSOPS_H
#define _SYS_FS_ZFS_VFSOPS_H
+#include <sys/dataset_kstats.h>
#include <sys/list.h>
#include <sys/vfs.h>
#include <sys/zil.h>
@@ -80,6 +82,7 @@ struct zfsvfs {
boolean_t z_use_namecache;/* make use of FreeBSD name cache */
uint64_t z_version; /* ZPL version */
uint64_t z_shares_dir; /* hidden shares dir */
+ dataset_kstats_t z_kstat; /* fs kstats */
kmutex_t z_lock;
uint64_t z_userquota_obj;
uint64_t z_groupquota_obj;