Skip to content

Commit

Permalink
Added support for zfs in ldms
Browse files Browse the repository at this point in the history
The following plugins were added

1) zfs_zpool
   Stastistics on zfs pools.

2) zfs_leafvdevs
   Statistic on virtual devices leaves only.

3) zfs_topvdevs
   Statidstics on top virtual devices in the device tree (parent only).
  • Loading branch information
carbonneau1 committed Dec 14, 2023
1 parent 4d4cc17 commit 8ac7128
Show file tree
Hide file tree
Showing 11 changed files with 1,709 additions and 0 deletions.
14 changes: 14 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,17 @@ AS_IF([test "x$enable_slingshot" = xyes],[
[AC_MSG_ERROR([libcxi or its headers not found])])
])

AC_ARG_ENABLE([zfs],
[AS_HELP_STRING([--enable-zfs], [require the zfs related plugins @<:@default=check@:>@])],
[],
[enable_zfs="check"])
AC_SEARCH_LIBS([zpool_vdev_name], [zfs],[HAVE_ZFS=yes])
AM_CONDITIONAL([ENABLE_ZFS], [test "x$enable_zfs" != xno -a "x$HAVE_ZFS" = xyes])
AS_IF([test "x$enable_zfs" = xyes],[
AS_IF([test "x$HAVE_ZFS" = xno],
[AC_MSG_ERROR([libzfs or its headers not found])])
])

# define substitutions for configvars and other sed-generated files.
# note carefully the escapes.
OVIS_DO_SUBST([LDMS_SUBST_RULE], ["sed \
Expand Down Expand Up @@ -1054,6 +1065,9 @@ ldms/src/sampler/json/Makefile
ldms/src/sampler/hweventpapi/Makefile \
ldms/src/sampler/rapl/Makefile \
ldms/src/sampler/tsampler/Makefile \
ldms/src/sampler/zfs_topvdevs/Makefile
ldms/src/sampler/zfs_leafvdevs/Makefile
ldms/src/sampler/zfs_zpool/Makefile
ldms/src/contrib/sampler/Makefile
ldms/src/contrib/sampler/daos/Makefile
ldms/src/contrib/sampler/daos/test/Makefile
Expand Down
6 changes: 6 additions & 0 deletions ldms/src/sampler/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,12 @@ if ENABLE_BLOB_STREAM
SUBDIRS += blob_stream
endif

if ENABLE_ZFS
SUBDIRS += zfs_topvdevs
SUBDIRS += zfs_leafvdevs
SUBDIRS += zfs_zpool
endif

if ENABLE_SLINGSHOT
if HAVE_LIBCXI
SUBDIRS += slingshot_metrics
Expand Down
18 changes: 18 additions & 0 deletions ldms/src/sampler/zfs_leafvdevs/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
pkglib_LTLIBRARIES =
dist_man1_MANS =

AUTOMAKE_OPTIONS = subdir-objects

AM_CPPFLAGS = @OVIS_INCLUDE_ABS@ \
-I/usr/include/libspl \
-I/usr/include/libzfs \
-Wall

AM_LDFLAGS = @OVIS_LIB_ABS@
COMMON_LIBADD = -lsampler_base -lldms -lovis_util -lcoll \
@LDFLAGS_GETTIME@

libzfs_leafvdevs_la_SOURCES = zfs_leafvdevs.c
libzfs_leafvdevs_la_LIBADD = $(COMMON_LIBADD)
pkglib_LTLIBRARIES += libzfs_leafvdevs.la
dist_man7_MANS = Plugin_zfs_leafvdevs.man
47 changes: 47 additions & 0 deletions ldms/src/sampler/zfs_leafvdevs/Plugin_zfs_leafvdevs.man
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.\" Manpage for Plugin_zfs_leafvdevs
.\" Contact [email protected] to correct errors or typos.
.TH man 7 "19 Apr 2023" "v4" "LDMS Plugin zfs_leafvdevs man page"

.SH NAME
Plugin_zfs_leafvdevs - man page for the LDMS zfs_leafvdevs plugin

.SH SYNOPSIS
Within ldmsd_controller or a configuration file:
.br
config name=zfs_leafvdevs

.SH DESCRIPTION
With LDMS (Lightweight Distributed Metric Service), plugins for the ldmsd (ldms
daemon) are configured via ldmsd_controller or a configuration file. The
zfs_leafvdevs plugin uses LDMS_V_LIST and LDMS_V_RECORD to provide zfs leaf
virtual devices using libzfs.

.SH CONFIGURATION ATTRIBUTE SYNTAX
The zfs_leafvdevs plugin uses the sampler_base base class. This man page covers
only the configuration attributes, or those with default values, specific to the
this plugin; see ldms_sampler_base.man for the attributes of the base class.

.TP
.BR config
name=<plugin_name>
.br
configuration line
.RS
.TP
name=<plugin_name>
.br
This MUST be zfs_leafvdevs.
.RE

.SH EXAMPLES
.PP
Within ldmsd_controller or a configuration file:
.nf
load name=zfs_leafvdevs
config name=zfs_leafvdevs producer=${HOSTNAME} instance=${HOSTNAME}/zfs_leafvdevs
start name=zfs_leafvdevs interval=1000000 offset=0
.fi

.SH SEE ALSO
ldmsd(8), ldms_quickstart(7), ldmsd_controller(8), ldms_sampler_base(7),
Plugin_leafvdevs(7)
Loading

0 comments on commit 8ac7128

Please sign in to comment.