FreeBSD: Add support for procfs_list

The procfs_list interface is required by several kstats. Implement
this functionality for FreeBSD to provide access to these kstats.
                           
Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #10890
This commit is contained in:
Matthew Macy
2020-09-23 16:43:51 -07:00
committed by GitHub
parent 3dad29fb4b
commit 7b8363d7f0
11 changed files with 201 additions and 41 deletions
+1
View File
@@ -2169,6 +2169,7 @@ spa_import_progress_init(void)
spa_import_progress_list;
procfs_list_install("zfs",
NULL,
"import_progress",
0644,
&spa_import_progress_list->procfs_list,
+6 -20
View File
@@ -122,14 +122,11 @@ static void
spa_read_history_init(spa_t *spa)
{
spa_history_list_t *shl = &spa->spa_stats.read_history;
char *module;
shl->size = 0;
module = kmem_asprintf("zfs/%s", spa_name(spa));
shl->procfs_list.pl_private = shl;
procfs_list_install(module,
procfs_list_install("zfs",
spa_name(spa),
"reads",
0600,
&shl->procfs_list,
@@ -137,8 +134,6 @@ spa_read_history_init(spa_t *spa)
spa_read_history_show_header,
spa_read_history_clear,
offsetof(spa_read_history_t, srh_node));
kmem_strfree(module);
}
static void
@@ -293,14 +288,11 @@ static void
spa_txg_history_init(spa_t *spa)
{
spa_history_list_t *shl = &spa->spa_stats.txg_history;
char *module;
shl->size = 0;
module = kmem_asprintf("zfs/%s", spa_name(spa));
shl->procfs_list.pl_private = shl;
procfs_list_install(module,
procfs_list_install("zfs",
spa_name(spa),
"txgs",
0644,
&shl->procfs_list,
@@ -308,8 +300,6 @@ spa_txg_history_init(spa_t *spa)
spa_txg_history_show_header,
spa_txg_history_clear,
offsetof(spa_txg_history_t, sth_node));
kmem_strfree(module);
}
static void
@@ -699,14 +689,12 @@ static void
spa_mmp_history_init(spa_t *spa)
{
spa_history_list_t *shl = &spa->spa_stats.mmp_history;
char *module;
shl->size = 0;
module = kmem_asprintf("zfs/%s", spa_name(spa));
shl->procfs_list.pl_private = shl;
procfs_list_install(module,
procfs_list_install("zfs",
spa_name(spa),
"multihost",
0644,
&shl->procfs_list,
@@ -714,8 +702,6 @@ spa_mmp_history_init(spa_t *spa)
spa_mmp_history_show_header,
spa_mmp_history_clear,
offsetof(spa_mmp_history_t, smh_node));
kmem_strfree(module);
}
static void