From: TG, Hari Date: Thu, 12 Sep 2019 20:25:49 +0000 (-0700) Subject: dcpmm plugin collects performance and health statistics from Intel Optane DC Presiste... X-Git-Tag: collectd-5.11.0~38^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79348a91abccaf69362eccc86fe5d1e0e2b737b2;p=thirdparty%2Fcollectd.git dcpmm plugin collects performance and health statistics from Intel Optane DC Presistent Memory (DCPMM). Signed-off-by: TG, Hari --- diff --git a/Makefile.am b/Makefile.am index 0a3831438..b9f90f9b1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -880,6 +880,14 @@ dbi_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBDBI_LDFLAGS) dbi_la_LIBADD = $(BUILD_WITH_LIBDBI_LIBS) endif +if BUILD_PLUGIN_DCPMM +pkglib_LTLIBRARIES += dcpmm.la +dcpmm_la_SOURCES = src/dcpmm.c +dcpmm_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBPMWAPI_CPPFLAGS) +dcpmm_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBPMWAPI_LDFLAGS) +dcpmm_la_LIBADD = -lpmwapi +endif + if BUILD_PLUGIN_DF pkglib_LTLIBRARIES += df.la df_la_SOURCES = src/df.c diff --git a/README b/README index dd7a437c1..3efd75b94 100644 --- a/README +++ b/README @@ -85,6 +85,9 @@ Features Executes SQL statements on various databases and interprets the returned data. + - dcpmm + Collects Intel Optane DC Presistent Memory (DCPMM) performance and health statistics. + - df Mountpoint usage (Basically the values `df(1)' delivers) @@ -909,6 +912,9 @@ Prerequisites ithread support (introduced in Perl 5.6.0). + * libpmwapi (optional) + Used by the `dcpmm` plugin. + * libpq (optional) The PostgreSQL C client library used by the `postgresql' plugin. diff --git a/configure.ac b/configure.ac index 2faa4ee8a..1b5eff723 100644 --- a/configure.ac +++ b/configure.ac @@ -4388,6 +4388,74 @@ fi AC_SUBST([PERL_CFLAGS]) AC_SUBST([PERL_LIBS]) + +# }}} + +# --with-libpmwapi {{{ +AC_ARG_WITH([libpmwapi], + [AS_HELP_STRING([--with-libpmwapi@<:@=PREFIX@:>@], [Path to libpmwapi.])], + [ + if test "x$withval" = "xyes" || test "x$withval" = "xno"; then + with_libpmwapi="$withval" + else + with_libpmwapi_cppflags="-I$withval/include" + with_libpmwapi_ldflags="-L$withval/lib64" + with_libpmwapi="yes" + fi + ], + [with_libpmwapi="yes"] +) + +if test "x$with_libpmwapi" = "xyes"; then + SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $with_libpmwapi_cppflags" + + AC_CHECK_HEADERS([pmw_api.h], + [with_libpmwapi="yes"], + [with_libpmwapi="no (pmw_api.h not found)"] + ) + + CPPFLAGS="$SAVE_CPPFLAGS" +fi + +if test "x$with_libpmwapi" = "xyes"; then + SAVE_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $with_libpmwapi_ldflags" + + AC_CHECK_LIB([pmwapi], [PMWAPIGetDIMMCount], + [with_libpmwapis="yes"], + [with_libpmwapi="no (symbol 'PMWAPIGetDIMMCount' not found)"], + [-lpmwcollect] + ) + + AC_CHECK_LIB([pmwapi], [PMWAPIStart], + [with_libpmwapi="yes"], + [with_libpmwapi="no (symbol 'PMWAPIStart' not found)"], + [-lpmwcollect] + ) + + AC_CHECK_LIB([pmwapi], [PMWAPIStop], + [with_libpmwapi="yes"], + [with_libpmwapi="no (symbol 'PMWAPIStop' not found)"], + [-lpmwcollect] + ) + + AC_CHECK_LIB([pmwapi], [PMWAPIRead], + [with_libpmwapi="yes"], + [with_libpmwapi="no (symbol 'PMWAPIRead' not found)"], + [-lpmwcollect] + ) + + LDFLAGS="$SAVE_LDFLAGS" +fi + +if test "x$with_libpmwapi" = "xyes"; then + BUILD_WITH_LIBPMWAPI_CPPFLAGS="$with_libpmwapi_cppflags" + BUILD_WITH_LIBPMWAPI_LDFLAGS="$with_libpmwapi_ldflags" +fi + +AC_SUBST([BUILD_WITH_LIBPMWAPI_CPPFLAGS]) +AC_SUBST([BUILD_WITH_LIBPMWAPI_LDFLAGS]) # }}} # --with-libpq {{{ @@ -6800,6 +6868,7 @@ AC_PLUGIN([curl], [$with_libcurl], [CURL generic web AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics]) AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics]) AC_PLUGIN([dbi], [$with_libdbi], [General database statistics]) +AC_PLUGIN([dcpmm], [$with_libpmwapi], [Intel(R) Optane(TM) DC Persistent Memory performance and health statistics]) AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics]) AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics]) AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis]) @@ -7171,6 +7240,7 @@ AC_MSG_RESULT([ libowcapi . . . . . . $with_libowcapi]) AC_MSG_RESULT([ libpcap . . . . . . . $with_libpcap]) AC_MSG_RESULT([ libperfstat . . . . . $with_perfstat]) AC_MSG_RESULT([ libperl . . . . . . . $with_libperl]) +AC_MSG_RESULT([ libpmwapi . . . . . . $with_libpmwapi]) AC_MSG_RESULT([ libpq . . . . . . . . $with_libpq]) AC_MSG_RESULT([ libpqos . . . . . . . $with_libpqos]) AC_MSG_RESULT([ libprotobuf . . . . . $with_libprotobuf]) @@ -7231,6 +7301,7 @@ AC_MSG_RESULT([ curl . . . . . . . . $enable_curl]) AC_MSG_RESULT([ curl_json . . . . . . $enable_curl_json]) AC_MSG_RESULT([ curl_xml . . . . . . $enable_curl_xml]) AC_MSG_RESULT([ dbi . . . . . . . . . $enable_dbi]) +AC_MSG_RESULT([ dcpmm . . . . . . . $enable_dcpmm]) AC_MSG_RESULT([ df . . . . . . . . . $enable_df]) AC_MSG_RESULT([ disk . . . . . . . . $enable_disk]) AC_MSG_RESULT([ dns . . . . . . . . . $enable_dns]) diff --git a/src/collectd.conf.in b/src/collectd.conf.in index ec77c2fa9..903308d0d 100644 --- a/src/collectd.conf.in +++ b/src/collectd.conf.in @@ -112,6 +112,7 @@ #@BUILD_PLUGIN_CURL_JSON_TRUE@LoadPlugin curl_json #@BUILD_PLUGIN_CURL_XML_TRUE@LoadPlugin curl_xml #@BUILD_PLUGIN_DBI_TRUE@LoadPlugin dbi +#@BUILD_PLUGIN_DCPMM_TRUE@LoadPlugin dcpmm #@BUILD_PLUGIN_DF_TRUE@LoadPlugin df #@BUILD_PLUGIN_DISK_TRUE@LoadPlugin disk #@BUILD_PLUGIN_DNS_TRUE@LoadPlugin dns @@ -544,6 +545,13 @@ # # +# +# Interval 10.0 +# CollectHealth 0 +# CollectPerfMetrics 1 +# EnableDispatchAll 0 +# + # # Device "/dev/hda1" # Device "192.168.0.2:/mnt/nfs" diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index c6b6ab4a3..996046c98 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -2538,6 +2538,65 @@ values. Defaults to the global hostname setting. =back +=head2 Plugin C + +The I will collect Intel(R) Optane(TM) DC Persistent Memory related performance statistics. + +B + + + Interval 10.0 + CollectHealth 0 + CollectPerfMetrics 1 + EnableDispatchAll 0 + + +=over 4 + +=item B I