diff options
author | brook <brook@pkgsrc.org> | 2009-11-10 14:55:17 +0000 |
---|---|---|
committer | brook <brook@pkgsrc.org> | 2009-11-10 14:55:17 +0000 |
commit | 9ec23174aea5ced2f653d4f627b39e6102f5d7cd (patch) | |
tree | d71905238dd348e6c50be6b3f5f2e501d1540a0e /parallel | |
parent | 2ab59848e4bf0f6feda693c75da63fbe0051cb6a (diff) | |
download | pkgsrc-9ec23174aea5ced2f653d4f627b39e6102f5d7cd.tar.gz |
Update to v3.1.2. The number of changes over the intervening years is
too large to list here. See the ChangeLog file or the home page for
details.
Diffstat (limited to 'parallel')
27 files changed, 102 insertions, 3618 deletions
diff --git a/parallel/ganglia-monitor-core/Makefile b/parallel/ganglia-monitor-core/Makefile index 9629301af05..734e60af3b4 100644 --- a/parallel/ganglia-monitor-core/Makefile +++ b/parallel/ganglia-monitor-core/Makefile @@ -1,12 +1,10 @@ -# $NetBSD: Makefile,v 1.23 2009/03/08 06:15:31 hasso Exp $ +# $NetBSD: Makefile,v 1.24 2009/11/10 14:55:17 brook Exp $ # -DISTNAME= ganglia-3.0.1 -PKGNAME= ganglia-monitor-core-3.0.1 -PKGREVISION= 9 +DISTNAME= ganglia-3.1.2 +PKGNAME= ganglia-monitor-core-3.1.2 CATEGORIES= net parallel MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ganglia/} -EXTRACT_SUFX= .tar.bz2 MAINTAINER= pkgsrc-users@NetBSD.org HOMEPAGE= http://ganglia.sourceforge.net/ @@ -14,55 +12,65 @@ COMMENT= Ganglia cluster monitor, monitoring daemon PKG_DESTDIR_SUPPORT= user-destdir -GNU_CONFIGURE= YES +GNU_CONFIGURE= yes CONFIGURE_ARGS+= --with-gmetad USE_LIBTOOL= yes -CONFIG_GUESS_OVERRIDE?= \ - config.guess */config.guess */*/config.guess */*/*/config.guess -CONFIG_SUB_OVERRIDE?= \ - config.sub */config.sub */*/config.sub */*/*/config.sub +USE_LANGUAGES+= c c++ fortran -PATCH_ETC= mans/gmetad.1 mans/gmond.1 \ - gmetad/cmdline.c gmetad/conf.c \ - gmond/cmdline.c gmond/g25_config.h \ - ganglia.html +PLIST_VARS+= python +PKG_OPTIONS_VAR= PKG_OPTIONS.ganglia +PKG_SUPPORTED_OPTIONS= python # Gmond support for python modules + +.include "../../mk/bsd.options.mk" + +.if !empty(PKG_OPTIONS:Mpython) +CONFIGURE_ARGS+= --with-python=${PYTHONBIN} +PLIST.python= yes +.include "../../lang/python/application.mk" +.else +CONFIGURE_ARGS+= --disable-python +.endif + +SUBST_CLASSES+= pkg_sysconfdir +SUBST_STAGE.pkg_sysconfdir= pre-configure +SUBST_MESSAGE.pkg_sysconfdir= Fixing PKG_SYSCONFDIR +SUBST_FILES.pkg_sysconfdir= ganglia.html \ + gmetad/cmdline.c gmetad/cmdline.h \ + gmetric/cmdline.c gmetric/cmdline.h \ + gmond/cmdline.c gmond/cmdline.h \ + gmond/g25_config.h gmond/gmond.conf.5 \ + gmond/modules/conf.d/modpython.conf \ + gmond/modules/conf.d/modpython.conf.in \ + gmond/modules/python/README.in \ + mans/gmetad.1 mans/gmetric.1 mans/gmond.1 +SUBST_SED.pkg_sysconfdir+= -e 's,/etc/ganglia,${PKG_SYSCONFDIR},g' +SUBST_SED.pkg_sysconfdir+= -e 's,/usr/lib/ganglia,${PREFIX}/lib/ganglia,g' + +DOCDIR= ${PREFIX}/share/doc/ganglia EGDIR= ${PREFIX}/share/examples/ganglia CONF_FILES= ${EGDIR}/gmond.conf ${PKG_SYSCONFDIR}/gmond.conf CONF_FILES+= ${EGDIR}/gmetad.conf ${PKG_SYSCONFDIR}/gmetad.conf RCD_SCRIPTS= gmond gmetad -INSTALLATION_DIRS= ${EGDIR} ${PKGMANDIR}/man1 - -pre-patch: - ${MKDIR} ${WRKSRC}/srclib/libmetrics/netbsd - ${MKDIR} ${WRKSRC}/srclib/libmetrics/dragonfly - ${CP} ${FILESDIR}/dfly-metrics.c ${WRKSRC}/srclib/libmetrics/dragonfly/metrics.c - ${CP} ${FILESDIR}/dfly-Makefile.am ${WRKSRC}/srclib/libmetrics/dragonfly/Makefile.am - ${CP} ${FILESDIR}/dfly-Makefile.in ${WRKSRC}/srclib/libmetrics/dragonfly/Makefile.in - -post-patch: -.for pfile in ${PATCH_ETC} - ${SED} -e 's|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g' \ - ${WRKSRC}/${pfile} > ${WRKSRC}/${pfile}.tmp && \ - ${MV} ${WRKSRC}/${pfile}.tmp ${WRKSRC}/${pfile} -.endfor +INSTALLATION_DIRS= ${DOCDIR} ${EGDIR} ${PKGMANDIR}/man1 ${PKGMANDIR}/man5 post-install: ${INSTALL_MAN} ${WRKSRC}/mans/gmetad.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/ ${INSTALL_MAN} ${WRKSRC}/mans/gmetric.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/ ${INSTALL_MAN} ${WRKSRC}/mans/gmond.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/ ${INSTALL_MAN} ${WRKSRC}/mans/gstat.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/ + ${INSTALL_MAN} ${WRKSRC}/gmond/gmond.conf.5 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man5/ ${INSTALL_DATA} ${WRKSRC}/gmetad/gmetad.conf ${DESTDIR}${EGDIR}/ - ${DESTDIR}${PREFIX}/sbin/gmond -t > ${DESTDIR}${EGDIR}/gmond.conf - -BUILDLINK_DEPENDS.apr+= apr>=0.9.7.2.0.55nb3 + ${WRKSRC}/gmond/gmond -t > ${DESTDIR}${EGDIR}/gmond.conf + ${INSTALL_DATA} ${WRKSRC}/gmond/modules/python/README ${DESTDIR}${DOCDIR}/ -.include "../../devel/apr0/buildlink3.mk" -.include "../../textproc/expat/buildlink3.mk" .include "../../databases/rrdtool/buildlink3.mk" +.include "../../devel/apr/buildlink3.mk" +.include "../../devel/confuse/buildlink3.mk" .include "../../mk/pthread.buildlink3.mk" +.include "../../textproc/expat/buildlink3.mk" .include "../../mk/bsd.pkg.mk" diff --git a/parallel/ganglia-monitor-core/PLIST b/parallel/ganglia-monitor-core/PLIST index 3be0870b241..576fbae43e9 100644 --- a/parallel/ganglia-monitor-core/PLIST +++ b/parallel/ganglia-monitor-core/PLIST @@ -1,15 +1,32 @@ -@comment $NetBSD: PLIST,v 1.4 2009/06/14 18:10:40 joerg Exp $ +@comment $NetBSD: PLIST,v 1.5 2009/11/10 14:55:17 brook Exp $ bin/ganglia-config bin/gmetric bin/gstat include/ganglia.h +include/ganglia_gexec.h +include/gm_metric.h +include/gm_mmn.h +include/gm_msg.h +include/gm_protocol.h +include/gm_value.h +lib/ganglia/modcpu.so +lib/ganglia/moddisk.so +lib/ganglia/modload.so +lib/ganglia/modmem.so +lib/ganglia/modmulticpu.so +lib/ganglia/modnet.so +lib/ganglia/modproc.so +${PLIST.python}lib/ganglia/modpython.so +lib/ganglia/modsys.so lib/libganglia.la man/man1/gmetad.1 man/man1/gmetric.1 man/man1/gmond.1 man/man1/gstat.1 +man/man5/gmond.conf.5 sbin/gmetad sbin/gmond +share/doc/ganglia/README share/examples/ganglia/gmetad.conf share/examples/ganglia/gmond.conf share/examples/rc.d/gmetad diff --git a/parallel/ganglia-monitor-core/distinfo b/parallel/ganglia-monitor-core/distinfo index af0155e28a4..06d6386ce08 100644 --- a/parallel/ganglia-monitor-core/distinfo +++ b/parallel/ganglia-monitor-core/distinfo @@ -1,26 +1,8 @@ -$NetBSD: distinfo,v 1.8 2006/04/30 22:28:44 joerg Exp $ +$NetBSD: distinfo,v 1.9 2009/11/10 14:55:17 brook Exp $ -SHA1 (ganglia-3.0.1.tar.bz2) = 3e5c4ec4a509713974dd1e8d516127f6aa2c5a20 -RMD160 (ganglia-3.0.1.tar.bz2) = 1f0ecc7388f1058d64df9ab98734810a983e6d26 -Size (ganglia-3.0.1.tar.bz2) = 2649342 bytes -SHA1 (patch-aa) = 4e5bb79a395f1b34062bc62fce80c809d45ae60d -SHA1 (patch-ab) = 6b349e90cdbf1a988aceb6222b5d67cacffe0a61 -SHA1 (patch-ac) = 23ad60ea06080a6763b21256e20549868110cf54 -SHA1 (patch-ad) = 4f03c665800827e1d89d7d76b81b667f0cf82ca6 -SHA1 (patch-ae) = 417a7ed552583fc61f8c3e095e9233c68311caf9 -SHA1 (patch-af) = 1874ebe88fa2ac288c5ca0a94f864bd0a71415ba -SHA1 (patch-ag) = a214bed25baff256c7670285129f77d31b18de82 -SHA1 (patch-ah) = 03ea69fd0e686776d83241f31aeb76c91d174c46 -SHA1 (patch-ai) = 1ae508692d8160aa202e02612590d329d910f434 -SHA1 (patch-aj) = d73aa994a2a6c9441d0b1cbcc9247bdf522b37c4 -SHA1 (patch-ak) = 6d84043aaf005e319517e8df61097dc00067ed10 -SHA1 (patch-al) = fbcf90d61ab6a160cbce7b90d0cdfcab44a1429c -SHA1 (patch-am) = 719f293496f648cd5829ef35edd046120764312f -SHA1 (patch-an) = 5b6c7002ead98dec9c45643be6dc6b69e1133355 -SHA1 (patch-ao) = a25381b4c8858112a46e9b61ff0af317f2472d5e -SHA1 (patch-ap) = 649940b694afd7f10c58f84d323f7b755759f84f -SHA1 (patch-aq) = 22fe789c666df1f4934046f1aa62d3629257c775 -SHA1 (patch-ar) = f652c74bf48528762e06801760753036651f874e -SHA1 (patch-as) = 710abfd3dc6e5836818a0de2ce93d873b4b9b259 -SHA1 (patch-at) = aeb83adbcb798099d6c4cf4da58b164e7cb22c06 -SHA1 (patch-au) = ff58e4e0bcd631e8358c1e7cd7824597e32c5b01 +SHA1 (ganglia-3.1.2.tar.gz) = be5db246eb755d8c450140d1c80afef4f1179fe1 +RMD160 (ganglia-3.1.2.tar.gz) = 1f78cf1019759e12c3c65901fd74ac65dfddf4e3 +Size (ganglia-3.1.2.tar.gz) = 1213196 bytes +SHA1 (patch-aa) = e258e4efb1ae012db51901de87e614cede78812c +SHA1 (patch-ab) = 260a78711c2c7f1111ce8c4b0d54d2edd60dde08 +SHA1 (patch-ac) = 094e07fac40d39093a80dfbee640a1503abaa4cb diff --git a/parallel/ganglia-monitor-core/files/dfly-Makefile.am b/parallel/ganglia-monitor-core/files/dfly-Makefile.am deleted file mode 100644 index ee336f67197..00000000000 --- a/parallel/ganglia-monitor-core/files/dfly-Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -AM_CFLAGS=-I.. -I$(top_builddir)/lib - -noinst_LTLIBRARIES = libmetric25.la -libmetric25_la_SOURCES = metrics.c -libmetrics25_LIBS = -lkinfo diff --git a/parallel/ganglia-monitor-core/files/dfly-Makefile.in b/parallel/ganglia-monitor-core/files/dfly-Makefile.in deleted file mode 100644 index c3f8ee2ae3c..00000000000 --- a/parallel/ganglia-monitor-core/files/dfly-Makefile.in +++ /dev/null @@ -1,335 +0,0 @@ -# Makefile.in generated by automake 1.6.3 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_HEADER = $(INSTALL_DATA) -transform = @program_transform_name@ -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ - -EXEEXT = @EXEEXT@ -OBJEXT = @OBJEXT@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AWK = @AWK@ -CC = @CC@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -ECHO = @ECHO@ -EGREP = @EGREP@ -F77 = @F77@ -GCJ = @GCJ@ -GCJFLAGS = @GCJFLAGS@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -OBJDUMP = @OBJDUMP@ -OS = @OS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -RC = @RC@ -STRIP = @STRIP@ -VERSION = @VERSION@ -am__include = @am__include@ -am__quote = @am__quote@ -install_sh = @install_sh@ -AM_CFLAGS = -I.. -I$(top_builddir)/lib - -noinst_LTLIBRARIES = libmetric25.la -libmetric25_la_SOURCES = metrics.c -subdir = freebsd -mkinstalldirs = $(SHELL) $(top_srcdir)/build/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) - -libmetric25_la_LDFLAGS = -libmetric25_la_LIBADD = -lkinfo -am_libmetric25_la_OBJECTS = metrics.lo -libmetric25_la_OBJECTS = $(am_libmetric25_la_OBJECTS) - -DEFS = @DEFS@ -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -depcomp = $(SHELL) $(top_srcdir)/build/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/metrics.Plo -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -CFLAGS = @CFLAGS@ -DIST_SOURCES = $(libmetric25_la_SOURCES) -DIST_COMMON = Makefile.am Makefile.in -SOURCES = $(libmetric25_la_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu freebsd/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test -z "$dir" && dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libmetric25.la: $(libmetric25_la_OBJECTS) $(libmetric25_la_DEPENDENCIES) - $(LINK) $(libmetric25_la_LDFLAGS) $(libmetric25_la_OBJECTS) $(libmetric25_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metrics.Plo@am__quote@ - -distclean-depend: - -rm -rf ./$(DEPDIR) - -.c.o: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c `cygpath -w $<` - -.c.lo: -@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< -CCDEPMODE = @CCDEPMODE@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @list='$(DISTFILES)'; for file in $$list; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) - -installdirs: - -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -distclean-am: clean-am distclean-compile distclean-depend \ - distclean-generic distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -uninstall-am: uninstall-info-am - -.PHONY: GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES distclean \ - distclean-compile distclean-depend distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am info \ - info-am install install-am install-data install-data-am \ - install-exec install-exec-am install-info install-info-am \ - install-man install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool tags uninstall uninstall-am \ - uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/parallel/ganglia-monitor-core/files/dfly-metrics.c b/parallel/ganglia-monitor-core/files/dfly-metrics.c deleted file mode 100644 index 6a186a0b5fc..00000000000 --- a/parallel/ganglia-monitor-core/files/dfly-metrics.c +++ /dev/null @@ -1,1149 +0,0 @@ -/* - * First stab at support for metrics in FreeBSD - * by Preston Smith <psmith@physics.purdue.edu> - * Wed Feb 27 14:55:33 EST 2002 - * Improved by Brooks Davis <brooks@one-eyed-alien.net>, - * Fixed libkvm code. - * Tue Jul 15 16:42:22 EST 2003 - * - * $Id: dfly-metrics.c,v 1.1 2006/04/30 22:28:44 joerg Exp $ - */ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include <kvm.h> - -#include <sys/param.h> -#include <sys/mount.h> -#include <sys/sysctl.h> -#include <sys/time.h> -#include <sys/user.h> -#include <kinfo.h> -#include <sys/stat.h> -#include <vm/vm_param.h> - -#include <sys/socket.h> -#include <net/if.h> -#include <net/if_dl.h> -#include <net/route.h> - -#include <unistd.h> -#include <err.h> -#include <fcntl.h> -#include <limits.h> -#include <paths.h> - -#include "interface.h" -#include "libmetrics.h" - -#define MIB_SWAPINFO_SIZE 3 - -#ifndef MIN_NET_POLL_INTERVAL -#define MIN_NET_POLL_INTERVAL 0.5 -#endif - -#ifndef MIN_CPU_POLL_INTERVAL -#define MIN_CPU_POLL_INTERVAL 0.5 -#endif - -#ifndef UINT64_MAX -#define UINT64_MAX ULLONG_MAX -#endif - -#define VFCF_NONLOCAL (VFCF_NETWORK|VFCF_SYNTHETIC|VFCF_LOOPBACK) - -#define timertod(tvp) \ - ((double)(tvp)->tv_sec + (double)(tvp)->tv_usec/(1000*1000)) - -#ifndef XSWDEV_VERSION -#define XSWDEV_VERSION 1 -struct xswdev { - u_int xsw_version; - udev_t xsw_dev; - int xsw_flags; - int xsw_nblks; - int xsw_used; -}; -#endif - -struct traffic { - uint64_t in_bytes; - uint64_t out_bytes; - uint64_t in_pkts; - uint64_t out_pkts; -}; - -static void get_netbw(double *, double *, double *, double *); -static uint64_t counterdiff(uint64_t, uint64_t, uint64_t, uint64_t); - - -static char *makenetvfslist(void); -static size_t regetmntinfo(struct statfs **, long, const char **); -static int checkvfsname(const char *, const char **); -static const char **makevfslist(char *); -static float find_disk_space(double *, double *); - -static int use_vm_swap_info = 0; -static int mibswap[MIB_SWAPINFO_SIZE]; -static size_t mibswap_size; -static kvm_t *kd = NULL; -static int pagesize; -static int skipvfs; - -/* - * This function is called only once by the gmond. Use to - * initialize data structures, etc or just return SYNAPSE_SUCCESS; - */ -g_val_t -metric_init(void) -{ - g_val_t val; - - /* - * Try to use the vm.swap_info sysctl to gather swap data. If it - * isn't implemented, fall back to trying to old kvm based interface. - */ - mibswap_size = MIB_SWAPINFO_SIZE; - if (sysctlnametomib("vm.swap_info", mibswap, &mibswap_size) == -1) { - kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "metric_init()"); - } else { - /* - * RELEASE versions of FreeBSD with the swap mib have a version - * of libkvm that doesn't need root for simple proc access so we - * just open /dev/null to give us a working handle here. - */ - kd = kvm_open(_PATH_DEVNULL, NULL, NULL, O_RDONLY, "metric_init()"); - use_vm_swap_info = 1; - } - pagesize = getpagesize(); - - /* Initalize some counters */ - get_netbw(NULL, NULL, NULL, NULL); - cpu_state(-1); - - val.int32 = SYNAPSE_SUCCESS; - return val; -} - -g_val_t -cpu_num_func ( void ) -{ - g_val_t val; - int ncpu; - - if (kinfo_get_cpus(&ncpu)) - ncpu = 1; - - val.uint16 = ncpu; - return val; -} - -g_val_t -cpu_speed_func ( void ) -{ - g_val_t val; - int cpu_speed; - size_t len = sizeof(cpu_speed); - - /* - * machdep.tsc_freq is an i386/amd64 only feature, but it's the best - * we've got at the moment. - */ - if (sysctlbyname("machdep.tsc_freq", &cpu_speed, &len, NULL, 0) == -1) - cpu_speed = 0; - val.uint16 = cpu_speed /= 1000000; - - return val; -} - -g_val_t -mem_total_func ( void ) -{ - g_val_t val; - size_t len; - long total; - - len = sizeof(total); - - if (sysctlbyname("hw.physmem", &total, &len, NULL, 0) == -1) - total = 0; - val.uint32 = total / 1024; - - return val; -} - -g_val_t -swap_total_func ( void ) -{ - g_val_t val; - struct kvm_swap swap[1]; - struct xswdev xsw; - size_t size; - int totswap, n; - val.uint32 = 0; - totswap = 0; - - if (use_vm_swap_info) { - for (n = 0; ; ++n) { - mibswap[mibswap_size] = n; - size = sizeof(xsw); - if (sysctl(mibswap, mibswap_size + 1, &xsw, &size, NULL, 0) == -1) - break; - if (xsw.xsw_version != XSWDEV_VERSION) - return val; - totswap += xsw.xsw_nblks; - } - } else if(kd != NULL) { - n = kvm_getswapinfo(kd, swap, 1, 0); - if (n < 0 || swap[0].ksw_total == 0) { - val.uint32 = 0; - } - totswap = swap[0].ksw_total; - } - - val.uint32 = totswap * (pagesize / 1024); - return val; -} - -g_val_t -boottime_func ( void ) -{ - g_val_t val; - struct timeval boottime; - size_t size; - - size = sizeof(boottime); - if (sysctlbyname("kern.boottime", &boottime, &size, NULL, 0) == -1) - boottime.tv_sec = 0; - - val.uint32 = (uint32_t) boottime.tv_sec; - - return val; -} - -g_val_t -sys_clock_func ( void ) -{ - g_val_t val; - - val.uint32 = time(NULL); - return val; -} - -g_val_t -machine_type_func ( void ) -{ - g_val_t val; - size_t len = sizeof(val.str); - - if (sysctlbyname("hw.machine", val.str, &len, NULL, 0) == -1 || - (len == 0)) - strlcpy(val.str, "unknown", sizeof(val.str)); - - return val; -} - -g_val_t -os_name_func ( void ) -{ - g_val_t val; - size_t len = sizeof(val.str); - - if (sysctlbyname("kern.ostype", val.str, &len, NULL, 0) == -1 || - (len == 0)) - strlcpy(val.str, "DragonFly (unknown)", sizeof(val.str)); - - return val; -} - -g_val_t -os_release_func ( void ) -{ - g_val_t val; - size_t len = sizeof(val.str); - - if (sysctlbyname("kern.osrelease", val.str, &len, NULL, 0) == -1 || - (len == 0)) - strlcpy(val.str, "unknown", sizeof(val.str)); - - return val; -} - -/* Get the CPU state given by index, from kern.cp_time - * Use the constants in <sys/dkstat.h> - * CP_USER=0, CP_NICE=1, CP_SYS=2, CP_INTR=3, CP_IDLE=4 - */ - -int cpu_state(int which) { - static struct kinfo_cputime cp_old, cp_diff; - static uint64_t total_change, half_change; - static struct timeval this_time, last_time; - - struct kinfo_cputime cp_time; - struct timeval time_diff; - int i; - - if (which == -1) { - bzero(&cp_old, sizeof(cp_old)); - bzero(&cp_diff, sizeof(cp_diff)); - total_change = 1; - half_change = 0; - bzero(&last_time, sizeof(last_time)); - return 0.0; - } - - gettimeofday(&this_time, NULL); - timersub(&this_time, &last_time, &time_diff); - if (timertod(&time_diff) < MIN_CPU_POLL_INTERVAL) { - goto output; - } - last_time = this_time; - - if (kinfo_get_sched_cputime(&cp_time)) { - warn("kinfo_get_sched_cputime"); - return 0.0; - } - cp_diff.cp_user = cp_time.cp_user - cp_old.cp_user; - cp_diff.cp_nice = cp_time.cp_nice - cp_old.cp_nice; - cp_diff.cp_sys = cp_time.cp_sys - cp_old.cp_sys; - cp_diff.cp_intr = cp_time.cp_intr - cp_old.cp_intr; - cp_diff.cp_idle = cp_time.cp_idle - cp_old.cp_idle; - total_change = cp_diff.cp_user + cp_diff.cp_nice + cp_diff.cp_sys - + cp_diff.cp_sys + cp_diff.cp_intr + cp_diff.cp_idle; - if (total_change == 0) - total_change = 1; - half_change = total_change >> 1; - -output: - switch (which) { - case 0: - return (cp_diff.cp_user * 100LL + half_change) / total_change; - case 1: - return (cp_diff.cp_nice * 100LL + half_change) / total_change; - case 2: - return (cp_diff.cp_sys * 100LL + half_change) / total_change; - case 3: - return (cp_diff.cp_intr * 100LL + half_change) / total_change; - case 4: - return (cp_diff.cp_idle * 100LL + half_change) / total_change; - default: - return 0; - } -} - -g_val_t -cpu_user_func ( void ) -{ - g_val_t val; - - val.f = (float) cpu_state(0); - - return val; -} - -g_val_t -cpu_nice_func ( void ) -{ - g_val_t val; - - val.f = (float) cpu_state(1); - - return val; -} - -g_val_t -cpu_system_func ( void ) -{ - g_val_t val; - - val.f = (float) cpu_state(2); - - return val; -} - -g_val_t -cpu_idle_func ( void ) -{ - g_val_t val; - - val.f = (float) cpu_state(4); - - return val; -} - -/* -** FIXME - This metric is not valid on FreeBSD. -*/ -g_val_t -cpu_wio_func ( void ) -{ - g_val_t val; - - val.f = 0.0; - return val; -} - -/* -** FIXME - Idle time since startup. The scheduler apparently knows -** this, but we it's fairly pointless so it's not exported. -*/ -g_val_t -cpu_aidle_func ( void ) -{ - g_val_t val; - val.f = 0.0; - return val; -} - -g_val_t -cpu_intr_func ( void ) -{ - g_val_t val; - - val.f = (float) cpu_state(3); - - return val; -} - -/* -** FIXME - This metric is not valid on FreeBSD. -*/ -g_val_t -cpu_sintr_func ( void ) -{ - g_val_t val; - val.f = 0.0; - return val; -} - -g_val_t -load_one_func ( void ) -{ - g_val_t val; - double load[3]; - - getloadavg(load, 3); - val.f = load[0]; - - return val; -} - -g_val_t -load_five_func ( void ) -{ - g_val_t val; - double load[3]; - - getloadavg(load, 3); - val.f = load[1]; - - return val; -} - -g_val_t -load_fifteen_func ( void ) -{ - g_val_t val; - double load[3]; - - getloadavg(load, 3); - val.f = load[2]; - - return val; -} - -g_val_t -proc_total_func ( void ) -{ - g_val_t val; - size_t len = 0; - - sysctlbyname("kern.proc.all", NULL, &len, NULL, 0); - - val.uint32 = (len / sizeof (struct kinfo_proc)); - - return val; -} - - -g_val_t -proc_run_func( void ) -{ - struct kinfo_proc *kp; - int i; - int state; - int nentries; - int what = KERN_PROC_ALL; - g_val_t val; - - val.uint32 = 0; - - if (kd == NULL) - goto output; -#ifdef KERN_PROC_NOTHREADS - what |= KERN_PROC_NOTHREADS -#endif - if ((kp = kvm_getprocs(kd, what, 0, &nentries)) == 0 || nentries < 0) - goto output; - - for (i = 0; i < nentries; kp++, i++) { -#ifdef KINFO_PROC_SIZE - state = kp->ki_stat; -#else - state = kp->kp_proc.p_stat; -#endif - switch(state) { - case SRUN: - case SIDL: - val.uint32++; - break; - } - } - - if (val.uint32 > 0) - val.uint32--; - -output: - return val; -} - -/* -** FIXME - The whole ganglia model of memory is bogus. Free memory is -** generally a bad idea with a modern VM and so is reporting it. There -** is simply no way to report a value for "free" memory that makes any -** kind of sense. Free+inactive might be a decent value for "free". -*/ -g_val_t -mem_free_func ( void ) -{ - g_val_t val; - size_t len; - int free_pages; - - len = sizeof (free_pages); - if((sysctlbyname("vm.stats.vm.v_free_count", &free_pages, &len, NULL, 0) - == -1) || !len) free_pages = 0; - - val.uint32 = free_pages * (pagesize / 1024); - return val; -} - -/* -** FreeBSD don't seem to report this anywhere. It's actually quite -** complicated as there is SysV shared memory, POSIX shared memory, -** and mmap shared memory at a minimum. -*/ -g_val_t -mem_shared_func ( void ) -{ - g_val_t val; - - val.uint32 = 0; - - return val; -} - -/* -** FIXME - this isn't really valid. It lists some VFS buffer space, -** but the real picture is much more complex. -*/ -g_val_t -mem_buffers_func ( void ) -{ - g_val_t val; - size_t len; - int buffers; - - len = sizeof (buffers); - if((sysctlbyname("vfs.bufspace", &buffers, &len, NULL, 0) == -1) || !len) - buffers = 0; - buffers /= 1024; - - val.uint32 = buffers; - return val; -} - -/* -** FIXME - this isn't really valid. It lists some VM cache space, -** but the real picture is more complex. -*/ -g_val_t -mem_cached_func ( void ) -{ - g_val_t val; - size_t len; - int cache; - - len = sizeof (cache); - if((sysctlbyname("vm.stats.vm.v_cache_count", &cache, &len, NULL, 0) == -1) - || !len) - cache = 0; - - val.uint32 = cache * (pagesize / 1024); - return val; -} - -g_val_t -swap_free_func ( void ) -{ - g_val_t val; - - struct kvm_swap swap[1]; - struct xswdev xsw; - size_t size; - int totswap, usedswap, freeswap, n; - val.uint32 = 0; - totswap = 0; - usedswap = 0; - if (use_vm_swap_info) { - for (n = 0; ; ++n) { - mibswap[mibswap_size] = n; - size = sizeof(xsw); - if (sysctl(mibswap, mibswap_size + 1, &xsw, &size, NULL, 0) == -1) - break; - if (xsw.xsw_version != XSWDEV_VERSION) - return val; - totswap += xsw.xsw_nblks; - usedswap += xsw.xsw_used; - } - } else if(kd != NULL) { - n = kvm_getswapinfo(kd, swap, 1, 0); - totswap = swap[0].ksw_total; - usedswap = swap[0].ksw_used; - } - freeswap = totswap - usedswap; - val.uint32 = freeswap * (pagesize / 1024); - return val; -} - - -g_val_t -mtu_func ( void ) -{ - /* We want to find the minimum MTU (Max packet size) over all UP interfaces. -*/ - g_val_t val; - val.uint32 = get_min_mtu(); - /* A val of 0 means there are no UP interfaces. Shouldn't happen. */ - return val; -} - -g_val_t -pkts_in_func ( void ) -{ - double in_pkts; - g_val_t val; - - get_netbw(NULL, NULL, &in_pkts, NULL); - - val.f = (float)in_pkts; - return val; -} - -g_val_t -pkts_out_func ( void ) -{ - double out_pkts; - g_val_t val; - - get_netbw(NULL, NULL, NULL, &out_pkts); - - val.f = (float)out_pkts; - return val; -} - -g_val_t -bytes_out_func ( void ) -{ - double out_bytes; - g_val_t val; - - get_netbw(NULL, &out_bytes, NULL, NULL); - - val.f = (float)out_bytes; - return val; -} - -g_val_t -bytes_in_func ( void ) -{ - double in_bytes; - g_val_t val; - - get_netbw(&in_bytes, NULL, NULL, NULL); - - val.f = (float)in_bytes; - return val; -} - -/* - * Disk space reporting functions from Linux code. find_disk_space() - * body derived from FreeBSD df and mount code. - */ - -g_val_t -disk_free_func( void ) -{ - double total_free=0.0; - double total_size=0.0; - g_val_t val; - - find_disk_space(&total_size, &total_free); - - val.d = total_free; - return val; -} - -g_val_t -disk_total_func( void ) -{ - double total_free=0.0; - double total_size=0.0; - g_val_t val; - - find_disk_space(&total_size, &total_free); - - val.d = total_size; - return val; -} - -g_val_t -part_max_used_func( void ) -{ - double total_free=0.0; - double total_size=0.0; - float most_full; - g_val_t val; - - most_full = find_disk_space(&total_size, &total_free); - - val.f = most_full; - return val; -} - - -/* - * Copyright (c) 1980, 1983, 1990, 1993, 1994, 1995 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * All or some portions of this file are derived from material licensed - * to the University of California by American Telephone and Telegraph - * Co. or Unix System Laboratories, Inc. and are reproduced herein with - * the permission of UNIX System Laboratories, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * - * NOTE: The copyright of UC Berkeley's Berkeley Software Distribution - * ("BSD") source has been updated. The copyright addendum may be found - * at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change. - */ - -static float -find_disk_space(double *total, double *tot_avail) -{ - struct statfs *mntbuf; - const char *fstype; - const char **vfslist; - char *netvfslist; - size_t i, mntsize; - size_t used, availblks; - const double reported_units = 1e9; - double toru; - float pct; - float most_full = 0.0; - - *total = 0.0; - *tot_avail = 0.0; - - fstype = "ufs"; - - netvfslist = makenetvfslist(); - vfslist = makevfslist(netvfslist); - free(netvfslist); - - mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); - mntsize = regetmntinfo(&mntbuf, mntsize, vfslist); - for (i = 0; i < mntsize; i++) { - if ((mntbuf[i].f_flags & MNT_IGNORE) == 0) { - used = mntbuf[i].f_blocks - mntbuf[i].f_bfree; - availblks = mntbuf[i].f_bavail + used; - pct = (availblks == 0 ? 100.0 : - (double)used / (double)availblks * 100.0); - if (pct > most_full) - most_full = pct; - - toru = reported_units/mntbuf[i].f_bsize; - *total += mntbuf[i].f_blocks / toru; - *tot_avail += mntbuf[i].f_bavail / toru; - } - } - - return most_full; -} - -/* - * Make a pass over the file system info in ``mntbuf'' filtering out - * file system types not in vfslist and possibly re-stating to get - * current (not cached) info. Returns the new count of valid statfs bufs. - */ -static size_t -regetmntinfo(struct statfs **mntbufp, long mntsize, const char **vfslist) -{ - int i, j; - struct statfs *mntbuf; - - if (vfslist == NULL) - return (getmntinfo(mntbufp, MNT_WAIT)); - - mntbuf = *mntbufp; - for (j = 0, i = 0; i < mntsize; i++) { - if (checkvfsname(mntbuf[i].f_fstypename, vfslist)) - continue; - (void)statfs(mntbuf[i].f_mntonname,&mntbuf[j]); - j++; - } - return (j); -} - -static int -checkvfsname(vfsname, vfslist) - const char *vfsname; - const char **vfslist; -{ - - if (vfslist == NULL) - return (0); - while (*vfslist != NULL) { - if (strcmp(vfsname, *vfslist) == 0) - return (skipvfs); - ++vfslist; - } - return (!skipvfs); -} - -static const char ** -makevfslist(fslist) - char *fslist; -{ - const char **av; - int i; - char *nextcp; - - if (fslist == NULL) - return (NULL); - if (fslist[0] == 'n' && fslist[1] == 'o') { - fslist += 2; - skipvfs = 1; - } - for (i = 0, nextcp = fslist; *nextcp; nextcp++) - if (*nextcp == ',') - i++; - if ((av = malloc((size_t)(i + 2) * sizeof(char *))) == NULL) { - warnx("malloc failed"); - return (NULL); - } - nextcp = fslist; - i = 0; - av[i++] = nextcp; - while ((nextcp = strchr(nextcp, ',')) != NULL) { - *nextcp++ = '\0'; - av[i++] = nextcp; - } - av[i++] = NULL; - return (av); -} - -static char * -makenetvfslist(void) -{ - char *str = NULL, *strptr, **listptr = NULL; - size_t slen; - int cnt, i; - - int mib[3], maxvfsconf; - size_t miblen; - struct ovfsconf *ptr; - - mib[0] = CTL_VFS; mib[1] = VFS_GENERIC; mib[2] = VFS_MAXTYPENUM; - miblen=sizeof(maxvfsconf); - if (sysctl(mib, (unsigned int)(sizeof(mib) / sizeof(mib[0])), - &maxvfsconf, &miblen, NULL, 0)) { - warnx("sysctl failed"); - goto done; - } - - if ((listptr = malloc(sizeof(char*) * maxvfsconf)) == NULL) { - warnx("malloc failed"); - goto done; - } - - cnt = 0; - while ((ptr = getvfsent()) != NULL && cnt < maxvfsconf) { - if (ptr->vfc_flags & VFCF_NONLOCAL) - continue; - - listptr[cnt] = strdup(ptr->vfc_name); - if (listptr[cnt] == NULL) { - warnx("malloc failed"); - goto done; - } - cnt++; - } - - if (cnt == 0) - goto done; - - /* - * Count up the string lengths, we need a extra byte to hold - * the between entries ',' or the NUL at the end. - */ - for (i = 0; i < cnt; i++) - slen = strlen(listptr[i]) + 1; - /* Add 2 for initial "no". */ - slen += 2; - - if ((str = malloc(slen)) == NULL) { - warnx("malloc failed"); - goto done; - } - - str[0] = 'n'; - str[1] = 'o'; - for (i = 0, strptr = str + 2; i < cnt; i++, strptr++) { - strcpy(strptr, listptr[i]); - strptr += strlen(listptr[i]); - *strptr = ','; - } - *strptr = '\0'; - -done: - if (listptr != NULL) { - for(i = 0; i < cnt && listptr[i] != NULL; i++) - free(listptr[i]); - free(listptr); - } - return (str); - -} - -static void -get_netbw(double *in_bytes, double *out_bytes, - double *in_pkts, double *out_pkts) -{ -#ifdef NETBW_DEBUG - char name[IFNAMSIZ]; -#endif - struct if_msghdr *ifm, *nextifm; - struct sockaddr_dl *sdl; - char *buf, *lim, *next; - size_t needed; - int mib[6]; - int i; - int index; - static double ibytes, obytes, ipkts, opkts; - struct timeval this_time; - struct timeval time_diff; - struct traffic traffic; - static struct timeval last_time = {0,0}; - static int indexes = 0; - static int *seen = NULL; - static struct traffic *lastcount = NULL; - static double o_ibytes, o_obytes, o_ipkts, o_opkts; - - ibytes = obytes = ipkts = opkts = 0.0; - - mib[0] = CTL_NET; - mib[1] = PF_ROUTE; - mib[2] = 0; - mib[3] = 0; /* address family */ - mib[4] = NET_RT_IFLIST; - mib[5] = 0; /* interface index */ - - gettimeofday(&this_time, NULL); - timersub(&this_time, &last_time, &time_diff); - if (timertod(&time_diff) < MIN_NET_POLL_INTERVAL) { - goto output; - } - - if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) - errx(1, "iflist-sysctl-estimate"); - if ((buf = malloc(needed)) == NULL) - errx(1, "malloc"); - if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) - errx(1, "actual retrieval of interface table"); - lim = buf + needed; - - next = buf; - while (next < lim) { - - ifm = (struct if_msghdr *)next; - - if (ifm->ifm_type == RTM_IFINFO) { - sdl = (struct sockaddr_dl *)(ifm + 1); - } else { - fprintf(stderr, "out of sync parsing NET_RT_IFLIST\n"); - fprintf(stderr, "expected %d, got %d\n", RTM_IFINFO, - ifm->ifm_type); - fprintf(stderr, "msglen = %d\n", ifm->ifm_msglen); - fprintf(stderr, "buf:%p, next:%p, lim:%p\n", buf, next, - lim); - exit (1); - } - - next += ifm->ifm_msglen; - while (next < lim) { - nextifm = (struct if_msghdr *)next; - - if (nextifm->ifm_type != RTM_NEWADDR) - break; - - next += nextifm->ifm_msglen; - } - - if ((ifm->ifm_flags & IFF_LOOPBACK) || - !(ifm->ifm_flags & IFF_UP)) - continue; - - index = ifm->ifm_index; - - /* If we don't have a previous value yet, make a slot. */ - if (index >= indexes) { - seen = realloc(seen, sizeof(*seen)*(index+1)); - lastcount = realloc(lastcount, - sizeof(*lastcount)*(index+1)); - - /* Initalize the new slots */ - for (i = indexes; i <= index; i++) { - seen[i] = 0; - } - indexes = index+1; - } - - /* - * If this is the first time we've seen this interface, - * set the last values to the current ones. That causes - * us to see no bandwidth on the interface the first - * time, but that's OK. - */ - if (!seen[index]) { - seen[index] = 1; - lastcount[index].in_bytes = ifm->ifm_data.ifi_ibytes; - lastcount[index].out_bytes = ifm->ifm_data.ifi_obytes; - lastcount[index].in_pkts = ifm->ifm_data.ifi_ipackets; - lastcount[index].out_pkts = ifm->ifm_data.ifi_opackets; - } - - traffic.in_bytes = counterdiff(lastcount[index].in_bytes, - ifm->ifm_data.ifi_ibytes, ULONG_MAX, 0); - traffic.out_bytes = counterdiff(lastcount[index].out_bytes, - ifm->ifm_data.ifi_obytes, ULONG_MAX, 0); - traffic.in_pkts = counterdiff(lastcount[index].in_pkts, - ifm->ifm_data.ifi_ipackets, ULONG_MAX, 0); - traffic.out_pkts = counterdiff(lastcount[index].out_pkts, - ifm->ifm_data.ifi_opackets, ULONG_MAX, 0); - - lastcount[index].in_bytes = ifm->ifm_data.ifi_ibytes; - lastcount[index].out_bytes = ifm->ifm_data.ifi_obytes; - lastcount[index].in_pkts = ifm->ifm_data.ifi_ipackets; - lastcount[index].out_pkts = ifm->ifm_data.ifi_opackets; - -#ifdef NETBW_DEBUG - if_indextoname(index, name); - printf("%s: \n", name); - printf("\topackets=%llu ipackets=%llu\n", - traffic.out_pkts, traffic.in_pkts); - printf("\tobytes=%llu ibytes=%llu\n", - traffic.out_bytes, traffic.in_bytes); -#endif - - if (timerisset(&last_time)) { - ibytes += (double)traffic.in_bytes / timertod(&time_diff); - obytes += (double)traffic.out_bytes / timertod(&time_diff); - ipkts += (double)traffic.in_pkts / timertod(&time_diff); - opkts += (double)traffic.out_pkts / timertod(&time_diff); - } - } - free(buf); - - /* Save the values from this time */ - last_time = this_time; - o_ibytes = ibytes; - o_obytes = obytes; - o_ipkts = ipkts; - o_opkts = opkts; - -output: - if (in_bytes != NULL) - *in_bytes = o_ibytes; - if (out_bytes != NULL) - *out_bytes = o_obytes; - if (in_pkts != NULL) - *in_pkts = o_ipkts; - if (out_pkts != NULL) - *out_pkts = o_opkts; -} - -static uint64_t -counterdiff(uint64_t oldval, uint64_t newval, uint64_t maxval, uint64_t maxdiff) -{ - uint64_t diff; - - if (maxdiff == 0) - maxdiff = maxval; - - /* Paranoia */ - if (oldval > maxval || newval > maxval) - return 0; - - /* - * Tackle the easy case. Don't worry about maxdiff here because - * we're SOL if it happens (i.e. assuming a reset just makes - * matters worse). - */ - if (oldval <= newval) - return (newval - oldval); - - /* - * Now the tricky part. If we assume counters never get reset, - * this is easy. Unfortunaly, they do get reset on some - * systems, so we need to try and deal with that. Our huristic - * is that if out difference is greater then maxdiff and newval - * is less or equal to maxdiff, then we've probably been reset - * rather then actually wrapping. Obviously, you need to be - * careful to poll often enough that you won't exceed maxdiff or - * you will get undersized numbers when you do wrap. - */ - diff = maxval - oldval + newval; - if (diff > maxdiff && newval <= maxdiff) - return newval; - - return diff; -} diff --git a/parallel/ganglia-monitor-core/patches/patch-aa b/parallel/ganglia-monitor-core/patches/patch-aa index 2ede38dde67..73b6fbbb9d0 100644 --- a/parallel/ganglia-monitor-core/patches/patch-aa +++ b/parallel/ganglia-monitor-core/patches/patch-aa @@ -1,36 +1,13 @@ -$NetBSD: patch-aa,v 1.3 2006/04/30 22:28:44 joerg Exp $ +$NetBSD: patch-aa,v 1.4 2009/11/10 14:55:18 brook Exp $ ---- srclib/libmetrics/configure.orig 2005-02-02 13:24:14.000000000 -0500 -+++ srclib/libmetrics/configure 2005-02-07 22:39:36.000000000 -0500 -@@ -22271,6 +22271,22 @@ cat >>confdefs.h <<\_ACEOF - _ACEOF - - ;; -+*dragonfly*) OS="dragonfly" -+ varstatedir="/var/db" -+ -+cat >>confdefs.h <<\_ACEOF -+#define DRAGONFLY 1 -+_ACEOF -+ -+ ;; -+*netbsd*) OS="netbsd" -+ varstatedir="/var/db" -+ -+cat >>confdefs.h <<\_ACEOF -+#define NETBSD 1 -+_ACEOF -+ -+ ;; - *cygwin*) OS="cygwin" - - cat >>confdefs.h <<\_ACEOF -@@ -22281,7 +22297,7 @@ _ACEOF - esac - - -- ac_config_files="$ac_config_files Makefile tests/Makefile aix/Makefile cygwin/Makefile darwin/Makefile freebsd/Makefile hpux/Makefile irix/Makefile linux/Makefile osf/Makefile solaris/Makefile" -+ ac_config_files="$ac_config_files Makefile tests/Makefile aix/Makefile cygwin/Makefile darwin/Makefile dragonfly/Makefile freebsd/Makefile hpux/Makefile irix/Makefile linux/Makefile netbsd/Makefile osf/Makefile solaris/Makefile" - - cat >confcache <<\_ACEOF - # This file is a shell script that caches the results of configure +--- gmetad/conf.c.orig 2009-01-28 16:23:20.000000000 -0700 ++++ gmetad/conf.c +@@ -265,7 +265,7 @@ set_defaults (gmetad_config_t *config) + config->debug_level = 0; + config->should_setuid = 1; + config->setuid_username = "nobody"; +- config->rrd_rootdir = "/var/lib/ganglia/rrds"; ++ config->rrd_rootdir = "/var/db/ganglia/rrds"; + config->scalable_mode = 1; + config->all_trusted = 0; + config->num_RRAs = 5; diff --git a/parallel/ganglia-monitor-core/patches/patch-ab b/parallel/ganglia-monitor-core/patches/patch-ab index dbba480ed85..16ae1387058 100644 --- a/parallel/ganglia-monitor-core/patches/patch-ab +++ b/parallel/ganglia-monitor-core/patches/patch-ab @@ -1,1296 +1,11 @@ -$NetBSD: patch-ab,v 1.4 2005/05/02 18:15:57 jschauma Exp $ +$NetBSD: patch-ab,v 1.5 2009/11/10 14:55:18 brook Exp $ ---- /dev/null 2005-04-12 21:39:02.000000000 -0400 -+++ srclib/libmetrics/netbsd/metrics.c 2005-04-12 21:34:24.000000000 -0400 -@@ -0,0 +1,1291 @@ -+/* -+ * First stab at support for metrics in NetBSD -+ * by Jan Schaumann <jschauma@netbsd.org> -+ * Thu Feb 3 22:33:36 EST 2005 -+ * -+ */ -+ -+#include <kvm.h> -+ -+#include <sys/param.h> -+#include <sys/mount.h> -+#include <sys/sysctl.h> -+#include <sys/time.h> -+#include <sys/user.h> -+#include <sys/resource.h> -+#include <sys/sched.h> -+#include <sys/stat.h> -+#include <sys/swap.h> -+#include <uvm/uvm_param.h> -+ -+#include <sys/socket.h> -+#include <net/if.h> -+#include <net/if_dl.h> -+#include <net/route.h> -+ -+#include <unistd.h> -+#include <err.h> -+#include <fcntl.h> -+#include <limits.h> -+#include <paths.h> -+ -+#include "interface.h" -+#include "libmetrics.h" -+ -+#ifdef HAVE_SYS_STATVFS_H -+#define statfs statvfs -+#endif -+ -+#define MIB_SWAPINFO_SIZE 3 -+ -+#ifndef MIN_NET_POLL_INTERVAL -+#define MIN_NET_POLL_INTERVAL 0.5 -+#endif -+ -+#ifndef MIN_CPU_POLL_INTERVAL -+#define MIN_CPU_POLL_INTERVAL 0.5 -+#endif -+ -+#ifndef UINT64_MAX -+#define UINT64_MAX ULLONG_MAX -+#endif -+ -+#define timertod(tvp) \ -+ ((double)(tvp)->tv_sec + (double)(tvp)->tv_usec/(1000*1000)) -+ -+struct traffic { -+ uint64_t in_bytes; -+ uint64_t out_bytes; -+ uint64_t in_pkts; -+ uint64_t out_pkts; -+}; -+ -+static void get_netbw(double *, double *, double *, double *); -+static uint64_t counterdiff(uint64_t, uint64_t, uint64_t, uint64_t); -+ -+static char *makenetvfslist(void); -+static size_t regetmntinfo(struct statfs **, long, const char **); -+static int checkvfsname(const char *, const char **); -+static const char **makevfslist(char *); -+static float find_disk_space(double *, double *); -+ -+// XXX -+//static int vm_state(int); -+ -+static int use_vm_swap_info = 0; -+static int mibswap[MIB_SWAPINFO_SIZE]; -+static size_t mibswap_size; -+static kvm_t *kd = NULL; -+static int pagesize; -+static int skipvfs; -+ -+/* Function prototypes */ -+static long percentages(int cnt, u_int64_t *out, register u_int64_t *new, -+ register u_int64_t *old, u_int64_t *diffs); -+ -+/* -+ * This function is called only once by the gmond. Use to -+ * initialize data structures, etc or just return SYNAPSE_SUCCESS; -+ */ -+g_val_t -+metric_init(void) -+{ -+ g_val_t val; -+ kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "metric_init()"); -+ pagesize = sysconf(_SC_PAGESIZE); -+ -+ /* Initialize some counters */ -+ get_netbw(NULL, NULL, NULL, NULL); -+ cpu_state(-1); -+ val.int32 = SYNAPSE_SUCCESS; -+ return val; -+} -+ -+g_val_t -+cpu_num_func ( void ) -+{ -+ g_val_t val; -+ int ncpu; -+ size_t len = sizeof (int); -+ int mib[2]; -+ -+ mib[0] = CTL_HW; -+ mib[1] = HW_NCPU; -+ if (sysctl(mib, 2, &ncpu, &len, NULL, 0) == -1 || !len) -+ ncpu = 1; -+ -+ val.uint16 = ncpu; -+ return val; -+} -+ -+g_val_t -+cpu_speed_func ( void ) -+{ -+ g_val_t val; -+ size_t len; -+ long cpu_speed; -+ -+ cpu_speed = 0; -+ -+#if (__NetBSD_Version__ > 299000000) -+ if (sysctlbyname("machdep.est.frequency.target", &cpu_speed, &len, NULL, 0) == -1) -+ val.uint16 = 0; -+#endif -+ -+ val.uint16 = cpu_speed /= 1000000; -+ return val; -+} -+ -+g_val_t -+mem_total_func ( void ) -+{ -+ g_val_t val; -+ size_t len; -+ int total; -+ int mib[2]; -+ -+ mib[0] = CTL_HW; -+ mib[1] = HW_PHYSMEM; -+ len = sizeof (total); -+ -+ sysctl(mib, 2, &total, &len, NULL, 0); -+ total /= 1024; -+ val.uint32 = total; -+ return val; -+} -+ -+g_val_t -+swap_total_func ( void ) -+{ -+ g_val_t val; -+ -+ int mib[2]; -+ struct uvmexp_sysctl uvmexp; -+ size_t len; -+ int totswap; -+ -+ val.uint32 = 0; -+ totswap = 0; -+ -+ mib[0] = CTL_VM; -+ mib[1] = VM_UVMEXP2; -+ -+ len = sizeof(uvmexp); -+ -+ if((sysctl(mib, 2, &uvmexp, &len, NULL, 0) < 0) -+ || !len) -+ totswap = 0; -+ else -+ totswap = uvmexp.swpages; -+ -+ val.uint32 = totswap * (pagesize / 1024); -+ -+ return val; -+} -+ -+g_val_t -+boottime_func ( void ) -+{ -+ g_val_t val; -+ struct timeval boottime; -+ int mib[2]; -+ size_t size; -+ -+ mib[0] = CTL_KERN; -+ mib[1] = KERN_BOOTTIME; -+ size = sizeof(boottime); -+ if (sysctl(mib, 2, &boottime, &size, NULL, 0) == -1) -+ val.uint32 = 0; -+ -+ val.uint32 = boottime.tv_sec; -+ -+ return val; -+} -+ -+g_val_t -+sys_clock_func ( void ) -+{ -+ g_val_t val; -+ -+ val.uint32 = time(NULL); -+ return val; -+} -+ -+g_val_t -+machine_type_func ( void ) -+{ -+ g_val_t val; -+ char machine_type[MAX_G_STRING_SIZE]; -+ size_t len = MAX_G_STRING_SIZE; -+ int mib[2]; -+ -+ mib[0] = CTL_HW; -+ mib[1] = HW_MACHINE; -+ -+ if (sysctl(mib, 2, &machine_type, &len, NULL, 0) == -1 || !len) -+ strncpy( val.str, "x86", MAX_G_STRING_SIZE ); -+ -+ strncpy( val.str, machine_type, MAX_G_STRING_SIZE ); -+ return val; -+} -+ -+g_val_t -+os_name_func ( void ) -+{ -+ g_val_t val; -+ char osname[MAX_G_STRING_SIZE]; -+ size_t len = MAX_G_STRING_SIZE; -+ int mib[2]; -+ -+ mib[0] = CTL_KERN; -+ mib[1] = KERN_OSTYPE; -+ -+ if (sysctl(mib, 2, &osname, &len, NULL, 0) == -1 || !len) -+ strncpy( val.str, "NetBSD", MAX_G_STRING_SIZE ); -+ -+ strncpy( val.str, osname, MAX_G_STRING_SIZE ); -+ -+ return val; -+} -+ -+g_val_t -+os_release_func ( void ) -+{ -+ g_val_t val; -+ int mib[2]; -+ size_t len; -+ char *prefix, buf[1024]; -+ -+ prefix = ""; -+ -+ mib[0] = CTL_KERN; -+ mib[1] = KERN_OSRELEASE; -+ len = sizeof(buf); -+ if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1) -+ strncpy( val.str, "Unknown", MAX_G_STRING_SIZE ); -+ -+ strncpy( val.str, buf, MAX_G_STRING_SIZE ); -+ -+ return val; -+} -+ -+int -+cpu_state(int which) -+{ -+ u_int64_t cp_time[CPUSTATES]; -+ u_int64_t cp_diff[CPUSTATES]; -+ static u_int64_t cp_old[CPUSTATES]; -+ static u_int64_t cpu_states[CPUSTATES]; -+ static struct timeval this_time, last_time; -+ struct timeval time_diff; -+ size_t len = sizeof(cp_time); -+ int i; -+ -+ if (which == -1) { -+ bzero(cp_old, sizeof(cp_old)); -+ bzero(&last_time, sizeof(last_time)); -+ return 0.0; -+ } -+ -+ gettimeofday(&this_time, NULL); -+ timersub(&this_time, &last_time, &time_diff); -+ if (timertod(&time_diff) < MIN_CPU_POLL_INTERVAL) { -+ goto output; -+ } -+ last_time = this_time; -+ -+ /* puts kern.cp_time array into cp_time */ -+ if (sysctlbyname("kern.cp_time", &cp_time, &len, NULL, 0) == -1) { -+ warn("kern.cp_time"); -+ return 0.0; -+ } -+ /* Use percentages function lifted from top(1) to figure percentages */ -+ percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff); -+ -+output: -+ return cpu_states[which]; -+ -+} -+ -+g_val_t -+cpu_user_func ( void ) -+{ -+ g_val_t val; -+ int res; -+ -+ static u_int64_t cp_time[CPUSTATES]; -+ static u_int64_t cp_old[CPUSTATES]; -+ static u_int64_t cp_diff[CPUSTATES]; -+ static u_int64_t cpu_states[CPUSTATES]; -+ static long tot; -+ size_t len = sizeof(cp_time); -+ int mib[2]; -+ -+ mib[0] = CTL_KERN; -+ mib[1] = KERN_CP_TIME; -+ -+ /* Copy the last cp_time into cp_old */ -+ memcpy(&cp_old, &cp_time, CPUSTATES*sizeof(long)); -+ /* puts kern.cp_time array into cp_time */ -+ if (sysctl(mib, 2, &cp_time, &len, NULL, 0) == -1 || !len) -+ res = 0.0; -+ else { -+ /* Use percentages function lifted from top(1) to figure percentages */ -+ tot = percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff); -+ res = cpu_states[CP_USER]; -+ } -+ val.f = (float)res/10; -+ return val; -+} -+ -+g_val_t -+cpu_nice_func ( void ) -+{ -+ g_val_t val; -+ int res; -+ -+ static u_int64_t cp_time[CPUSTATES]; -+ static u_int64_t cp_old[CPUSTATES]; -+ static u_int64_t cp_diff[CPUSTATES]; -+ static u_int64_t cpu_states[CPUSTATES]; -+ static long tot; -+ size_t len = sizeof(cp_time); -+ int mib[2]; -+ -+ mib[0] = CTL_KERN; -+ mib[1] = KERN_CP_TIME; -+ -+ /* Copy the last cp_time into cp_old */ -+ memcpy(&cp_old, &cp_time, CPUSTATES*sizeof(long)); -+ /* puts kern.cp_time array into cp_time */ -+ if (sysctl(mib, 2, &cp_time, &len, NULL, 0) == -1 || !len) -+ res = 0.0; -+ else { -+ /* Use percentages function lifted from top(1) to figure percentages */ -+ tot = percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff); -+ res = cpu_states[CP_NICE]; -+ } -+ val.f = (float)res/10; -+ return val; -+} -+ -+g_val_t -+cpu_system_func ( void ) -+{ -+ g_val_t val; -+ int res; -+ -+ static u_int64_t cp_time[CPUSTATES]; -+ static u_int64_t cp_old[CPUSTATES]; -+ static u_int64_t cp_diff[CPUSTATES]; -+ static u_int64_t cpu_states[CPUSTATES]; -+ static long tot; -+ size_t len = sizeof(cp_time); -+ int mib[2]; -+ -+ mib[0] = CTL_KERN; -+ mib[1] = KERN_CP_TIME; -+ -+ /* Copy the last cp_time into cp_old */ -+ memcpy(&cp_old, &cp_time, CPUSTATES*sizeof(long)); -+ /* puts kern.cp_time array into cp_time */ -+ if (sysctl(mib, 2, &cp_time, &len, NULL, 0) == -1 || !len) -+ res = 0.0; -+ else { -+ /* Use percentages function lifted from top(1) to figure percentages */ -+ tot = percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff); -+ res = cpu_states[CP_SYS]; -+ } -+ val.f = (float)res/10; -+ return val; -+} -+ -+g_val_t -+cpu_idle_func ( void ) -+{ -+ g_val_t val; -+ int res; -+ -+ static u_int64_t cp_time[CPUSTATES]; -+ static u_int64_t cp_old[CPUSTATES]; -+ static u_int64_t cp_diff[CPUSTATES]; -+ static u_int64_t cpu_states[CPUSTATES]; -+ static long tot; -+ size_t len = sizeof(cp_time); -+ int mib[2]; -+ -+ mib[0] = CTL_KERN; -+ mib[1] = KERN_CP_TIME; -+ -+ /* Copy the last cp_time into cp_old */ -+ memcpy(&cp_old, &cp_time, CPUSTATES*sizeof(long)); -+ /* puts kern.cp_time array into cp_time */ -+ if (sysctl(mib, 2, &cp_time, &len, NULL, 0) == -1 || !len) -+ res = 0.0; -+ else { -+ /* Use percentages function lifted from top(1) to figure percentages */ -+ tot = percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff); -+ res = cpu_states[CP_IDLE]; -+ } -+ val.f = (float)res/10; -+ return val; -+} -+ -+/* -+** FIXME -+*/ -+g_val_t -+cpu_wio_func ( void ) -+{ -+ g_val_t val; -+ val.f = 0.0; -+ return val; -+} -+ -+g_val_t -+cpu_aidle_func ( void ) -+{ -+ g_val_t val; -+ -+ val.f = 0.0; -+ return val; -+} -+ -+g_val_t -+cpu_intr_func ( void ) -+{ -+ g_val_t val; -+ int res; -+ -+ static u_int64_t cp_time[CPUSTATES]; -+ static u_int64_t cp_old[CPUSTATES]; -+ static u_int64_t cp_diff[CPUSTATES]; -+ static u_int64_t cpu_states[CPUSTATES]; -+ static long tot; -+ size_t len = sizeof(cp_time); -+ int mib[2]; -+ -+ mib[0] = CTL_KERN; -+ mib[1] = KERN_CP_TIME; -+ -+ /* Copy the last cp_time into cp_old */ -+ memcpy(&cp_old, &cp_time, CPUSTATES*sizeof(long)); -+ /* puts kern.cp_time array into cp_time */ -+ if (sysctl(mib, 2, &cp_time, &len, NULL, 0) == -1 || !len) -+ res = 0.0; -+ else { -+ /* Use percentages function lifted from top(1) to figure percentages */ -+ tot = percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff); -+ res = cpu_states[CP_INTR]; -+ } -+ -+ val.f = (float)res/10; -+ return val; -+} -+ -+/* -+** FIXME -+*/ -+g_val_t -+cpu_sintr_func ( void ) -+{ -+ g_val_t val; -+ val.f = 0.0; -+ return val; -+} -+ -+g_val_t -+load_one_func ( void ) -+{ -+ g_val_t val; -+ double load[3]; -+ -+ getloadavg(load, 3); -+ val.f = load[0]; -+ return val; -+} -+ -+g_val_t -+load_five_func ( void ) -+{ -+ g_val_t val; -+ double load[3]; -+ -+ getloadavg(load, 3); -+ -+ val.f = load[1]; -+ return val; -+} -+ -+g_val_t -+load_fifteen_func ( void ) -+{ -+ g_val_t val; -+ double load[3]; -+ -+ getloadavg(load, 3); -+ val.f = load[2]; -+ return val; -+} -+ -+g_val_t -+proc_total_func ( void ) -+{ -+ g_val_t val; -+ int mib[3]; -+ size_t len; -+ -+ mib[0] = CTL_KERN; -+ mib[1] = KERN_PROC; -+ mib[2] = KERN_PROC_ALL; -+ -+ sysctl(mib, 3, NULL, &len, NULL, 0); -+ -+ val.uint32 = (len / sizeof (struct kinfo_proc)); -+ -+ return val; -+} -+ -+ -+/* -+ * Don't know how to do this yet.. -+ */ -+g_val_t -+proc_run_func( void ) -+{ -+ struct kinfo_proc *kp; -+ int i; -+ int state; -+ int nentries; -+ int what = KERN_PROC_ALL; -+ g_val_t val; -+ -+ val.uint32 = 0; -+ -+ if (kd == NULL) -+ goto output; -+#ifdef KERN_PROC_NOTHREADS -+ what |= KERN_PROC_NOTHREADS -+#endif -+ if ((kp = kvm_getprocs(kd, what, 0, &nentries)) == 0 || nentries < 0) -+ goto output; -+ -+ for (i = 0; i < nentries; kp++, i++) { -+#ifdef KINFO_PROC_SIZE -+ state = kp->ki_stat; -+#else -+ state = kp->kp_proc.p_stat; -+#endif -+ switch(state) { -+#if (__NetBSD_Version__ >= 200000000) -+ case SACTIVE: -+#else -+ case SRUN: -+ case SONPROC: -+#endif -+ case SIDL: -+ val.uint32++; -+ break; -+ } -+ } -+ -+ if (val.uint32 > 0) -+ val.uint32--; -+ -+output: -+ return val; -+} -+ -+g_val_t -+mem_free_func ( void ) -+{ -+ g_val_t val; -+ size_t len; -+ struct vmtotal vminfo; -+ int mib[2]; -+ -+ len = sizeof(vminfo); -+ mib[0] = CTL_VM; -+ mib[1] = VM_METER; -+ if (sysctl(mib, 2, &vminfo, &len, NULL, 0) < 0) -+ val.uint32 = 0; -+ else -+ val.uint32 = vminfo.t_free * (pagesize / 1024); -+ return val; -+} -+ -+g_val_t -+mem_shared_func ( void ) -+{ -+ g_val_t val; -+ size_t len; -+ struct vmtotal vminfo; -+ int mib[2]; -+ -+ len = sizeof(vminfo); -+ mib[0] = CTL_VM; -+ mib[1] = VM_METER; -+ if (sysctl(mib, 2, &vminfo, &len, NULL, 0) < 0) -+ val.uint32 = 0; -+ else -+ val.uint32 = (vminfo.t_vmshr + vminfo.t_rmshr) * (pagesize / 1024); -+ return val; -+} -+ -+g_val_t -+mem_buffers_func ( void ) -+{ -+ g_val_t val; -+ size_t len; -+ int buffers; -+ int mib[2]; -+ -+ mib[0] = CTL_VM; -+ mib[1] = VM_NKMEMPAGES; -+ -+ len = sizeof (buffers); -+ if((sysctl(mib, 2, &buffers, &len, NULL, 0) == -1) || !len) -+ buffers = 0; -+ buffers /= 1024; -+ -+ val.uint32 = buffers; -+ return val; -+} -+ -+g_val_t -+mem_cached_func ( void ) -+{ -+ g_val_t val; -+ size_t len; -+ int cache; -+ struct uvmexp_sysctl uvmexp; -+ int mib[2]; -+ -+ mib[0] = CTL_VM; -+ mib[1] = VM_UVMEXP2; -+ -+ len = sizeof(uvmexp); -+ -+ if((sysctl(mib, 2, &uvmexp, &len, NULL, 0) < 0) -+ || !len) -+ cache = 0; -+ else -+ cache = uvmexp.execpages + uvmexp.filepages; -+ -+ val.uint32 = cache * (pagesize / 1024); -+ return val; -+} -+ -+g_val_t -+swap_free_func ( void ) -+{ -+ g_val_t val; -+ -+ int mib[2]; -+ struct uvmexp_sysctl uvmexp; -+ size_t len; -+ int totswapf; -+ -+ val.uint32 = 0; -+ totswapf = 0; -+ -+ mib[0] = CTL_VM; -+ mib[1] = VM_UVMEXP2; -+ -+ len = sizeof(uvmexp); -+ -+ if((sysctl(mib, 2, &uvmexp, &len, NULL, 0) < 0) -+ || !len) -+ totswapf = 0; -+ else -+ totswapf = uvmexp.swpages - uvmexp.swpginuse; -+ -+ val.uint32 = totswapf * (pagesize / 1024); -+ -+ return val; -+} -+ -+g_val_t -+mtu_func ( void ) -+{ -+ /* We want to find the minimum MTU (Max packet size) over all UP interfaces. -+*/ -+ g_val_t val; -+ val.uint32 = get_min_mtu(); -+ /* A val of 0 means there are no UP interfaces. Shouldn't happen. */ -+ return val; -+} -+ -+/* -+ * Function to get cpu percentages. -+ * Might be changed ever so slightly, but is still mostly: -+ * AUTHOR: Christos Zoulas <christos@ee.cornell.edu> -+ * Steven Wallace <swallace@freebsd.org> -+ * Wolfram Schneider <wosch@FreeBSD.org> -+ * -+ * $FreeBSD: src/usr.bin/top/machine.c,v 1.29.2.2 2001/07/31 20:27:05 tmm Exp $ -+ */ -+ -+static long percentages(int cnt, u_int64_t *out, register u_int64_t *new, -+ register u_int64_t *old, u_int64_t *diffs) { -+ -+ register int i; -+ register u_int64_t change; -+ register u_int64_t total_change; -+ register u_int64_t *dp; -+ long half_total; -+ -+ /* initialization */ -+ total_change = 0; -+ dp = diffs; -+ -+ /* calculate changes for each state and the overall change */ -+ for (i = 0; i < cnt; i++) { -+ if ((change = *new - *old) < 0) { -+ /* this only happens when the counter wraps */ -+ change = (int) -+ ((unsigned long)*new-(unsigned long)*old); -+ } -+ total_change += (*dp++ = change); -+ *old++ = *new++; -+ } -+ /* avoid divide by zero potential */ -+ if (total_change == 0) { total_change = 1; } -+ -+ /* calculate percentages based on overall change, rounding up */ -+ half_total = total_change / 2l; -+ -+ /* Do not divide by 0. Causes Floating point exception */ -+ if(total_change) { -+ for (i = 0; i < cnt; i++) { -+ *out++ = (int)((*diffs++ * 1000 + half_total) / total_change); -+ } -+ } -+ -+ /* return the total in case the caller wants to use it */ -+ return(total_change); -+} -+ -+g_val_t -+pkts_in_func ( void ) -+{ -+ double in_pkts; -+ g_val_t val; -+ -+ get_netbw(NULL, NULL, &in_pkts, NULL); -+ -+ val.f = (float)in_pkts; -+ return val; -+} -+ -+g_val_t -+pkts_out_func ( void ) -+{ -+ double out_pkts; -+ g_val_t val; -+ -+ get_netbw(NULL, NULL, NULL, &out_pkts); -+ -+ val.f = (float)out_pkts; -+ return val; -+} -+ -+g_val_t -+bytes_out_func ( void ) -+{ -+ double out_bytes; -+ g_val_t val; -+ -+ get_netbw(NULL, &out_bytes, NULL, NULL); -+ -+ val.f = (float)out_bytes; -+ return val; -+} -+ -+g_val_t -+bytes_in_func ( void ) -+{ -+ double in_bytes; -+ g_val_t val; -+ -+ get_netbw(&in_bytes, NULL, NULL, NULL); -+ -+ val.f = (float)in_bytes; -+ return val; -+} -+ -+/* -+ * Disk space reporting functions from Linux code. find_disk_space() -+ * body derived from NetBSD df and mount code. -+ */ -+ -+g_val_t -+disk_free_func( void ) -+{ -+ double total_free=0.0; -+ double total_size=0.0; -+ g_val_t val; -+ -+ find_disk_space(&total_size, &total_free); -+ -+ val.d = total_free; -+ return val; -+} -+ -+g_val_t -+disk_total_func( void ) -+{ -+ double total_free=0.0; -+ double total_size=0.0; -+ g_val_t val; -+ -+ find_disk_space(&total_size, &total_free); -+ -+ val.d = total_size; -+ return val; -+} -+ -+g_val_t -+part_max_used_func( void ) -+{ -+ double total_free=0.0; -+ double total_size=0.0; -+ float most_full; -+ g_val_t val; -+ -+ most_full = find_disk_space(&total_size, &total_free); -+ -+ val.f = most_full; -+ return val; -+} -+ -+ -+/* -+ * Copyright (c) 1980, 1983, 1990, 1993, 1994, 1995 -+ * The Regents of the University of California. All rights reserved. -+ * (c) UNIX System Laboratories, Inc. -+ * All or some portions of this file are derived from material licensed -+ * to the University of California by American Telephone and Telegraph -+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with -+ * the permission of UNIX System Laboratories, Inc. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. All advertising materials mentioning features or use of this software -+ * must display the following acknowledgement: -+ * This product includes software developed by the University of -+ * California, Berkeley and its contributors. -+ * 4. Neither the name of the University nor the names of its contributors -+ * may be used to endorse or promote products derived from this software -+ * without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ * -+ * -+ * NOTE: The copyright of UC Berkeley's Berkeley Software Distribution -+ * ("BSD") source has been updated. The copyright addendum may be found -+ * at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change. -+ */ -+ -+ -+ -+static float -+find_disk_space(double *total, double *tot_avail) -+{ -+ struct statfs *mntbuf; -+ const char *fstype; -+ const char **vfslist; -+ char *netvfslist; -+ size_t i, mntsize; -+ size_t used, availblks; -+ const double reported_units = 1e9; -+ double toru; -+ float pct; -+ float most_full = 0.0; -+ -+ *total = 0.0; -+ *tot_avail = 0.0; -+ -+ fstype = "ufs"; -+ -+ netvfslist = makenetvfslist(); -+ vfslist = makevfslist(netvfslist); -+ free(netvfslist); -+ -+ mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); -+ mntsize = regetmntinfo(&mntbuf, mntsize, vfslist); -+ for (i = 0; i < mntsize; i++) { -+#ifdef HAVE_SYS_STATVFS_H -+ if ((mntbuf[i].f_flag & MNT_IGNORE) == 0) { -+#else -+ if ((mntbuf[i].f_flags & MNT_IGNORE) == 0) { -+#endif -+ used = mntbuf[i].f_blocks - mntbuf[i].f_bfree; -+ availblks = mntbuf[i].f_bavail + used; -+ pct = (availblks == 0 ? 100.0 : -+ (double)used / (double)availblks * 100.0); -+ if (pct > most_full) -+ most_full = pct; -+ -+#ifdef HAVE_SYS_STATVFS_H -+ toru = reported_units/mntbuf[i].f_frsize; -+#else -+ toru = reported_units/mntbuf[i].f_bsize; -+#endif -+ *total += mntbuf[i].f_blocks / toru; -+ *tot_avail += mntbuf[i].f_bavail / toru; -+ } -+ } -+ -+ return most_full; -+} -+ -+/* -+ * Make a pass over the file system info in ``mntbuf'' filtering out -+ * file system types not in vfslist and possibly re-stating to get -+ * current (not cached) info. Returns the new count of valid statfs bufs. -+ */ -+static size_t -+regetmntinfo(struct statfs **mntbufp, long mntsize, const char **vfslist) -+{ -+ int i, j; -+ struct statfs *mntbuf; -+ -+ if (vfslist == NULL) -+ return (getmntinfo(mntbufp, MNT_WAIT)); -+ -+ mntbuf = *mntbufp; -+ j = 0; -+ for (j = 0, i = 0; i < mntsize; i++) { -+ if (checkvfsname(mntbuf[i].f_fstypename, vfslist)) -+ continue; -+ (void)statfs(mntbuf[i].f_mntonname, &mntbuf[j]); -+ j++; -+ } -+ return (j); -+} -+ -+static int -+checkvfsname(const char *vfsname, const char **vfslist) -+{ -+ if (vfslist == NULL) -+ return (0); -+ while (*vfslist != NULL) { -+ if (strcmp(vfsname, *vfslist) == 0) -+ return (skipvfs); -+ ++vfslist; -+ } -+ return (!skipvfs); -+} -+ -+static const char ** -+makevfslist(char *fslist) -+{ -+ const char **av; -+ int i; -+ char *nextcp; -+ if (fslist == NULL) -+ return (NULL); -+ if (fslist[0] == 'n' && fslist[1] == 'o') { -+ fslist += 2; -+ skipvfs = 1; -+ } -+ for (i = 0, nextcp = fslist; *nextcp; nextcp++) -+ if (*nextcp == ',') -+ i++; -+ if ((av = malloc((size_t)(i + 2) * sizeof(char *))) == NULL) { -+ warnx("malloc failed"); -+ return (NULL); -+ } -+ nextcp = fslist; -+ i = 0; -+ i = 0; -+ av[i++] = nextcp; -+ while ((nextcp = strchr(nextcp, ',')) != NULL) { -+ *nextcp++ = '\0'; -+ av[i++] = nextcp; -+ } -+ av[i++] = NULL; -+ return (av); -+} -+ -+static char * -+makenetvfslist(void) -+{ -+ char *str = NULL, *strptr, **listptr = NULL; -+ size_t slen; -+ int cnt, i; -+ -+ int mib[3], maxvfsconf; -+ size_t miblen; -+ struct ovfsconf *ptr; -+ -+ mib[0] = CTL_VFS; mib[1] = VFS_GENERIC; mib[2] = VFS_MAXTYPENUM; -+ miblen=sizeof(maxvfsconf); -+ if (sysctl(mib, (unsigned int)(sizeof(mib) / sizeof(mib[0])), -+ &maxvfsconf, &miblen, NULL, 0)) { -+ warnx("sysctl failed"); -+ goto done; -+ } -+ -+ if ((listptr = malloc(sizeof(char*) * maxvfsconf)) == NULL) { -+ warnx("malloc failed"); -+ goto done; -+ } -+ -+ cnt = 0; -+ /* XXX: use sysctl ? */ -+ /* while ((ptr = getvfsent()) != NULL && cnt < maxvfsconf) { -+ -+ listptr[cnt] = strdup(ptr->vfc_name); -+ if (listptr[cnt] == NULL) { -+ warnx("malloc failed"); -+ goto done; -+ } -+ cnt++; -+ } */ -+ if (cnt == 0) -+ goto done; -+ /* -+ * Count up the string lengths, we need a extra byte to hold -+ * the between entries ',' or the NUL at the end. -+ */ -+ for (i = 0; i < cnt; i++) -+ slen = strlen(listptr[i]) + 1; -+ /* Add 2 for initial "no". */ -+ slen += 2; -+ -+ if ((str = malloc(slen)) == NULL) { -+ warnx("malloc failed"); -+ goto done; -+ } -+ -+ str[0] = 'n'; -+ str[1] = 'o'; -+ for (i = 0, strptr = str + 2; i < cnt; i++, strptr++) { -+ strcpy(strptr, listptr[i]); -+ strptr += strlen(listptr[i]); -+ *strptr = ','; -+ } -+ *strptr = '\0'; -+ -+done: -+ if (listptr != NULL) { -+ for(i = 0; i < cnt && listptr[i] != NULL; i++) -+ free(listptr[i]); -+ free(listptr); -+ } -+ return (str); -+ -+} -+ -+static void -+get_netbw(double *in_bytes, double *out_bytes, -+ double *in_pkts, double *out_pkts) -+{ -+#ifdef NETBW_DEBUG -+ char name[IFNAMSIZ]; -+#endif -+ struct if_msghdr *ifm, *nextifm; -+ struct sockaddr_dl *sdl; -+ char *buf, *lim, *next; -+ size_t needed; -+ int mib[6]; -+ int i; -+ int index; -+ static double ibytes, obytes, ipkts, opkts; -+ struct timeval this_time; -+ struct timeval time_diff; -+ struct traffic traffic; -+ static struct timeval last_time = {0,0}; -+ static int indexes = 0; -+ static int *seen = NULL; -+ static struct traffic *lastcount = NULL; -+ static double o_ibytes, o_obytes, o_ipkts, o_opkts; -+ -+ ibytes = obytes = ipkts = opkts = 0.0; -+ -+ mib[0] = CTL_NET; -+ mib[1] = PF_ROUTE; -+ mib[2] = 0; -+ mib[3] = 0; /* address family */ -+ mib[4] = NET_RT_IFLIST; -+ mib[5] = 0; /* interface index */ -+ -+ gettimeofday(&this_time, NULL); -+ timersub(&this_time, &last_time, &time_diff); -+ if (timertod(&time_diff) < MIN_NET_POLL_INTERVAL) { -+ goto output; -+ } -+ -+ -+ if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) -+ errx(1, "iflist-sysctl-estimate"); -+ if ((buf = malloc(needed)) == NULL) -+ errx(1, "malloc"); -+ if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) -+ errx(1, "actual retrieval of interface table"); -+ lim = buf + needed; -+ -+ next = buf; -+ while (next < lim) { -+ -+ ifm = (struct if_msghdr *)next; -+ -+ if (ifm->ifm_type == RTM_IFINFO) { -+ sdl = (struct sockaddr_dl *)(ifm + 1); -+ } else { -+ fprintf(stderr, "out of sync parsing NET_RT_IFLIST\n"); -+ fprintf(stderr, "expected %d, got %d\n", RTM_IFINFO, -+ ifm->ifm_type); -+ fprintf(stderr, "msglen = %d\n", ifm->ifm_msglen); -+ fprintf(stderr, "buf:%p, next:%p, lim:%p\n", buf, next, -+ lim); -+ exit (1); -+ } -+ -+ next += ifm->ifm_msglen; -+ while (next < lim) { -+ nextifm = (struct if_msghdr *)next; -+ -+ if (nextifm->ifm_type != RTM_NEWADDR) -+ break; -+ -+ next += nextifm->ifm_msglen; -+ } -+ -+ if ((ifm->ifm_flags & IFF_LOOPBACK) || -+ !(ifm->ifm_flags & IFF_UP)) -+ continue; -+ -+ index = ifm->ifm_index; -+ -+ /* If we don't have a previous value yet, make a slot. */ -+ if (index >= indexes) { -+ seen = realloc(seen, sizeof(*seen)*(index+1)); -+ lastcount = realloc(lastcount, -+ sizeof(*lastcount)*(index+1)); -+ -+ /* Initalize the new slots */ -+ for (i = indexes; i <= index; i++) { -+ seen[i] = 0; -+ } -+ indexes = index+1; -+ } -+ -+ /* -+ * If this is the first time we've seen this interface, -+ * set the last values to the current ones. That causes -+ * us to see no bandwidth on the interface the first -+ * time, but that's OK. -+ */ -+ if (!seen[index]) { -+ seen[index] = 1; -+ lastcount[index].in_bytes = ifm->ifm_data.ifi_ibytes; -+ lastcount[index].out_bytes = ifm->ifm_data.ifi_obytes; -+ lastcount[index].in_pkts = ifm->ifm_data.ifi_ipackets; -+ lastcount[index].out_pkts = ifm->ifm_data.ifi_opackets; -+ } -+ -+ traffic.in_bytes = counterdiff(lastcount[index].in_bytes, -+ ifm->ifm_data.ifi_ibytes, ULONG_MAX, 0); -+ traffic.out_bytes = counterdiff(lastcount[index].out_bytes, -+ ifm->ifm_data.ifi_obytes, ULONG_MAX, 0); -+ traffic.in_pkts = counterdiff(lastcount[index].in_pkts, -+ ifm->ifm_data.ifi_ipackets, ULONG_MAX, 0); -+ traffic.out_pkts = counterdiff(lastcount[index].out_pkts, -+ ifm->ifm_data.ifi_opackets, ULONG_MAX, 0); -+ -+ lastcount[index].in_bytes = ifm->ifm_data.ifi_ibytes; -+ lastcount[index].out_bytes = ifm->ifm_data.ifi_obytes; -+ lastcount[index].in_pkts = ifm->ifm_data.ifi_ipackets; -+ lastcount[index].out_pkts = ifm->ifm_data.ifi_opackets; -+ -+#ifdef NETBW_DEBUG -+ if_indextoname(index, name); -+ printf("%s: \n", name); -+ printf("\topackets=%llu ipackets=%llu\n", -+ traffic.out_pkts, traffic.in_pkts); -+ printf("\tobytes=%llu ibytes=%llu\n", -+ traffic.out_bytes, traffic.in_bytes); -+#endif -+ -+ if (timerisset(&last_time)) { -+ ibytes += (double)traffic.in_bytes / timertod(&time_diff); -+ obytes += (double)traffic.out_bytes / timertod(&time_diff); -+ ipkts += (double)traffic.in_pkts / timertod(&time_diff); -+ opkts += (double)traffic.out_pkts / timertod(&time_diff); -+ } -+ } -+ free(buf); -+ -+ /* Save the values from this time */ -+ last_time = this_time; -+ o_ibytes = ibytes; -+ o_obytes = obytes; -+ o_ipkts = ipkts; -+ o_opkts = opkts; -+ -+output: -+ if (in_bytes != NULL) -+ *in_bytes = o_ibytes; -+ if (out_bytes != NULL) -+ *out_bytes = o_obytes; -+ if (in_pkts != NULL) -+ *in_pkts = o_ipkts; -+ if (out_pkts != NULL) -+ *out_pkts = o_opkts; -+} -+ -+static uint64_t -+counterdiff(uint64_t oldval, uint64_t newval, uint64_t maxval, uint64_t maxdiff) -+{ -+ uint64_t diff; -+ -+ if (maxdiff == 0) -+ maxdiff = maxval; -+ -+ /* Paranoia */ -+ if (oldval > maxval || newval > maxval) -+ return 0; -+ -+ /* -+ * Tackle the easy case. Don't worry about maxdiff here because -+ * we're SOL if it happens (i.e. assuming a reset just makes -+ * matters worse). -+ */ -+ if (oldval <= newval) -+ return (newval - oldval); -+ -+ /* -+ * Now the tricky part. If we assume counters never get reset, -+ * this is easy. Unfortunaly, they do get reset on some -+ * systems, so we need to try and deal with that. Our huristic -+ * is that if out difference is greater then maxdiff and newval -+ * is less or equal to maxdiff, then we've probably been reset -+ * rather then actually wrapping. Obviously, you need to be -+ * careful to poll often enough that you won't exceed maxdiff or -+ * you will get undersized numbers when you do wrap. -+ */ -+ diff = maxval - oldval + newval; -+ if (diff > maxdiff && newval <= maxdiff) -+ return newval; -+ -+ return diff; -+} +--- gmetad/gmetad.conf.orig 2009-01-28 16:23:20.000000000 -0700 ++++ gmetad/gmetad.conf +@@ -110,5 +110,5 @@ data_source "my cluster" localhost + # + #------------------------------------------------------------------------------- + # Where gmetad stores its round-robin databases +-# default: "/var/lib/ganglia/rrds" ++# default: "/var/db/ganglia/rrds" + # rrd_rootdir "/some/other/place" diff --git a/parallel/ganglia-monitor-core/patches/patch-ac b/parallel/ganglia-monitor-core/patches/patch-ac index 627f13ac99e..8b29581a947 100644 --- a/parallel/ganglia-monitor-core/patches/patch-ac +++ b/parallel/ganglia-monitor-core/patches/patch-ac @@ -1,13 +1,16 @@ -$NetBSD: patch-ac,v 1.2 2005/02/10 02:33:53 jschauma Exp $ +$NetBSD: patch-ac,v 1.3 2009/11/10 14:55:18 brook Exp $ ---- gmond/g25_config.h.orig 2005-02-07 22:27:32.000000000 -0500 -+++ gmond/g25_config.h 2005-02-07 22:27:46.000000000 -0500 -@@ -4,7 +4,7 @@ - #include <string.h> +--- libmetrics/netbsd/metrics.c.orig 2009-01-28 16:23:20.000000000 -0700 ++++ libmetrics/netbsd/metrics.c +@@ -134,7 +134,10 @@ cpu_speed_func ( void ) - /* autoconf me later */ --#define DEFAULT_GMOND_CONFIG_FILE "/etc/gmond.conf" -+#define DEFAULT_GMOND_CONFIG_FILE "@PKG_SYSCONFDIR@/gmond.conf" + cpu_speed = 0; - typedef struct - { +-#if (__NetBSD_Version__ > 299000000) ++#if (__NetBSD_Version__ > 500000000) ++ if (sysctlbyname("machdep.tsc_freq", &cpu_speed, &len, NULL, 0) == -1) ++ val.uint32 = 0; ++#elif (__NetBSD_Version__ > 299000000) + if (sysctlbyname("machdep.est.frequency.target", &cpu_speed, &len, NULL, 0) == -1) + val.uint32 = 0; + #endif diff --git a/parallel/ganglia-monitor-core/patches/patch-ad b/parallel/ganglia-monitor-core/patches/patch-ad deleted file mode 100644 index 0b281a1b93b..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-ad +++ /dev/null @@ -1,11 +0,0 @@ -$NetBSD: patch-ad,v 1.1.1.1 2005/02/07 14:33:21 jschauma Exp $ - ---- mans/gmetad.1.orig 2005-02-04 17:29:38.000000000 -0500 -+++ mans/gmetad.1 2005-02-04 17:28:38.000000000 -0500 -@@ -21,5 +21,5 @@ - Print version and exit - .TP - \fB\-cSTRING\fR \fB\-\-conf\fR=\fISTRING\fR --Location of gmetad configuration file (default='/etc/gmetad.conf') -+Location of gmetad configuration file (default='@PKG_SYSCONFDIR@/gmetad.conf') - .SH "SEE ALSO" diff --git a/parallel/ganglia-monitor-core/patches/patch-ae b/parallel/ganglia-monitor-core/patches/patch-ae deleted file mode 100644 index 92b62f42b84..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-ae +++ /dev/null @@ -1,13 +0,0 @@ -$NetBSD: patch-ae,v 1.1.1.1 2005/02/07 14:33:21 jschauma Exp $ - ---- mans/gmond.1.orig 2005-02-04 17:29:46.000000000 -0500 -+++ mans/gmond.1 2005-02-04 17:29:01.000000000 -0500 -@@ -17,7 +17,7 @@ - Print version and exit - .TP - \fB\-cSTRING\fR \fB\-\-conf\fR=\fISTRING\fR --Location of gmond configuration file (default='/etc/gmond.conf') -+Location of gmond configuration file (default='@PKG_SYSCONFDIR@/gmond.conf') - .SH AUTHOR - Matt Massie <massie@cs.berkeley.edu> - .SH "REPORTING BUGS" diff --git a/parallel/ganglia-monitor-core/patches/patch-af b/parallel/ganglia-monitor-core/patches/patch-af deleted file mode 100644 index 307198dd71c..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-af +++ /dev/null @@ -1,22 +0,0 @@ -$NetBSD: patch-af,v 1.1.1.1 2005/02/07 14:33:21 jschauma Exp $ - ---- gmetad/cmdline.c.orig 2005-02-04 17:31:01.000000000 -0500 -+++ gmetad/cmdline.c 2005-02-04 17:31:23.000000000 -0500 -@@ -50,7 +50,7 @@ - "Usage: %s [OPTIONS]...\n", PACKAGE); - printf(" -h --help Print help and exit\n"); - printf(" -V --version Print version and exit\n"); -- printf(" -cSTRING --conf=STRING Location of gmetad configuration file (default='/etc/gmetad.conf')\n"); -+ printf(" -cSTRING --conf=STRING Location of gmetad configuration file (default='@PKG_SYSCONFDIR@/gmetad.conf')\n"); - printf(" -dINT --debug=INT Debug level. If greater than zero, daemon will stay in foreground. (default=0)\n"); - } - -@@ -80,7 +80,7 @@ - args_info->conf_given = 0 ; - args_info->debug_given = 0 ; - #define clear_args() { \ -- args_info->conf_arg = strdup("/etc/gmetad.conf") ;\ -+ args_info->conf_arg = strdup("@PKG_SYSCONFDIR@/gmetad.conf") ;\ - args_info->debug_arg = 0 ;\ - } - diff --git a/parallel/ganglia-monitor-core/patches/patch-ag b/parallel/ganglia-monitor-core/patches/patch-ag deleted file mode 100644 index f6f7f3824d3..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-ag +++ /dev/null @@ -1,22 +0,0 @@ -$NetBSD: patch-ag,v 1.2 2005/02/10 02:33:53 jschauma Exp $ - ---- gmond/cmdline.c.orig 2005-02-07 22:23:36.000000000 -0500 -+++ gmond/cmdline.c 2005-02-07 22:24:47.000000000 -0500 -@@ -42,7 +42,7 @@ - printf("\n"); - printf(" -h, --help Print help and exit\n"); - printf(" -V, --version Print version and exit\n"); -- printf(" -c, --conf=STRING Location of gmond configuration file (default=\n `/etc/gmond.conf')\n"); -+ printf(" -c, --conf=STRING Location of gmond configuration file (default=\n `@PKG_SYSCONFDIR@/gmond.conf')\n"); - printf(" -l, --location=STRING Location of this host in the cluster \n 'rack,rank,plane'. (default=`0,0,0')\n"); - printf(" -d, --debug=INT Debug level. If greater than zero, daemon will stay \n in foreground. (default=`0')\n"); - printf(" -f, --foreground Run in foreground (don't daemonize) (default=off)\n"); -@@ -84,7 +84,7 @@ - args_info->bandwidth_given = 0 ; - args_info->convert_given = 0 ; - #define clear_args() { \ -- args_info->conf_arg = gengetopt_strdup("/etc/gmond.conf") ;\ -+ args_info->conf_arg = gengetopt_strdup("@PKG_SYSCONFDIR@/gmond.conf") ;\ - args_info->location_arg = gengetopt_strdup("0,0,0") ;\ - args_info->debug_arg = 0 ;\ - args_info->foreground_flag = 0;\ diff --git a/parallel/ganglia-monitor-core/patches/patch-ah b/parallel/ganglia-monitor-core/patches/patch-ah deleted file mode 100644 index 3d6c10390b7..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-ah +++ /dev/null @@ -1,13 +0,0 @@ -$NetBSD: patch-ah,v 1.3 2005/06/17 15:46:46 hira Exp $ - ---- gmetad/conf.c.orig 2005-04-03 13:24:33.000000000 -0400 -+++ gmetad/conf.c 2005-04-03 13:24:57.000000000 -0400 -@@ -264,7 +264,7 @@ - config->debug_level = 0; - config->should_setuid = 1; - config->setuid_username = "nobody"; -- config->rrd_rootdir = "/var/lib/ganglia/rrds"; -+ config->rrd_rootdir = "/var/db/ganglia/rrds"; - config->scalable_mode = 1; - config->all_trusted = 0; - config->num_RRAs = 5; diff --git a/parallel/ganglia-monitor-core/patches/patch-ai b/parallel/ganglia-monitor-core/patches/patch-ai deleted file mode 100644 index dbc99915ec7..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-ai +++ /dev/null @@ -1,11 +0,0 @@ -$NetBSD: patch-ai,v 1.1.1.1 2005/02/07 14:33:21 jschauma Exp $ - ---- gmetad/gmetad.conf.orig 2005-02-04 17:36:39.000000000 -0500 -+++ gmetad/gmetad.conf 2005-02-04 17:36:53.000000000 -0500 -@@ -102,5 +102,5 @@ - # - #------------------------------------------------------------------------------- - # Where gmetad stores its round-robin databases --# default: "/var/lib/ganglia/rrds" -+# default: "/var/db/ganglia/rrds" - # rrd_rootdir "/some/other/place" diff --git a/parallel/ganglia-monitor-core/patches/patch-aj b/parallel/ganglia-monitor-core/patches/patch-aj deleted file mode 100644 index 5c8f208f2fb..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-aj +++ /dev/null @@ -1,9 +0,0 @@ -$NetBSD: patch-aj,v 1.1 2005/02/10 02:33:53 jschauma Exp $ - ---- /dev/null 2005-02-07 22:12:34.000000000 -0500 -+++ srclib/libmetrics/netbsd/Makefile.am 2005-02-07 22:17:51.000000000 -0500 -@@ -0,0 +1,4 @@ -+AM_CFLAGS=-I.. -I$(top_builddir)/lib -+ -+noinst_LTLIBRARIES = libmetric25.la -+libmetric25_la_SOURCES = metrics.c diff --git a/parallel/ganglia-monitor-core/patches/patch-ak b/parallel/ganglia-monitor-core/patches/patch-ak deleted file mode 100644 index 07e9ac3813a..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-ak +++ /dev/null @@ -1,340 +0,0 @@ -$NetBSD: patch-ak,v 1.1 2005/02/10 02:33:53 jschauma Exp $ - ---- /dev/null 2005-02-07 22:12:34.000000000 -0500 -+++ srclib/libmetrics/netbsd/Makefile.in 2005-02-07 22:17:51.000000000 -0500 -@@ -0,0 +1,335 @@ -+# Makefile.in generated by automake 1.6.3 from Makefile.am. -+# @configure_input@ -+ -+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -+# Free Software Foundation, Inc. -+# This Makefile.in is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. -+ -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -+# PARTICULAR PURPOSE. -+ -+@SET_MAKE@ -+SHELL = @SHELL@ -+ -+srcdir = @srcdir@ -+top_srcdir = @top_srcdir@ -+VPATH = @srcdir@ -+prefix = @prefix@ -+exec_prefix = @exec_prefix@ -+ -+bindir = @bindir@ -+sbindir = @sbindir@ -+libexecdir = @libexecdir@ -+datadir = @datadir@ -+sysconfdir = @sysconfdir@ -+sharedstatedir = @sharedstatedir@ -+localstatedir = @localstatedir@ -+libdir = @libdir@ -+infodir = @infodir@ -+mandir = @mandir@ -+includedir = @includedir@ -+oldincludedir = /usr/include -+pkgdatadir = $(datadir)/@PACKAGE@ -+pkglibdir = $(libdir)/@PACKAGE@ -+pkgincludedir = $(includedir)/@PACKAGE@ -+top_builddir = .. -+ -+ACLOCAL = @ACLOCAL@ -+AUTOCONF = @AUTOCONF@ -+AUTOMAKE = @AUTOMAKE@ -+AUTOHEADER = @AUTOHEADER@ -+ -+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -+INSTALL = @INSTALL@ -+INSTALL_PROGRAM = @INSTALL_PROGRAM@ -+INSTALL_DATA = @INSTALL_DATA@ -+install_sh_DATA = $(install_sh) -c -m 644 -+install_sh_PROGRAM = $(install_sh) -c -+install_sh_SCRIPT = $(install_sh) -c -+INSTALL_SCRIPT = @INSTALL_SCRIPT@ -+INSTALL_HEADER = $(INSTALL_DATA) -+transform = @program_transform_name@ -+NORMAL_INSTALL = : -+PRE_INSTALL = : -+POST_INSTALL = : -+NORMAL_UNINSTALL = : -+PRE_UNINSTALL = : -+POST_UNINSTALL = : -+host_alias = @host_alias@ -+host_triplet = @host@ -+ -+EXEEXT = @EXEEXT@ -+OBJEXT = @OBJEXT@ -+PATH_SEPARATOR = @PATH_SEPARATOR@ -+AMTAR = @AMTAR@ -+AR = @AR@ -+AS = @AS@ -+AWK = @AWK@ -+CC = @CC@ -+CXX = @CXX@ -+CXXCPP = @CXXCPP@ -+DEPDIR = @DEPDIR@ -+DLLTOOL = @DLLTOOL@ -+ECHO = @ECHO@ -+EGREP = @EGREP@ -+F77 = @F77@ -+GCJ = @GCJ@ -+GCJFLAGS = @GCJFLAGS@ -+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -+LIBTOOL = @LIBTOOL@ -+LN_S = @LN_S@ -+OBJDUMP = @OBJDUMP@ -+OS = @OS@ -+PACKAGE = @PACKAGE@ -+RANLIB = @RANLIB@ -+RC = @RC@ -+STRIP = @STRIP@ -+VERSION = @VERSION@ -+am__include = @am__include@ -+am__quote = @am__quote@ -+install_sh = @install_sh@ -+AM_CFLAGS = -I.. -I$(top_builddir)/lib -+ -+noinst_LTLIBRARIES = libmetric25.la -+libmetric25_la_SOURCES = metrics.c -+subdir = netbsd -+mkinstalldirs = $(SHELL) $(top_srcdir)/build/mkinstalldirs -+CONFIG_HEADER = $(top_builddir)/config.h -+CONFIG_CLEAN_FILES = -+LTLIBRARIES = $(noinst_LTLIBRARIES) -+ -+libmetric25_la_LDFLAGS = -+libmetric25_la_LIBADD = -+am_libmetric25_la_OBJECTS = metrics.lo -+libmetric25_la_OBJECTS = $(am_libmetric25_la_OBJECTS) -+ -+DEFS = @DEFS@ -+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -+CPPFLAGS = @CPPFLAGS@ -+LDFLAGS = @LDFLAGS@ -+LIBS = @LIBS@ -+depcomp = $(SHELL) $(top_srcdir)/build/depcomp -+am__depfiles_maybe = depfiles -+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/metrics.Plo -+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ -+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ -+ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -+CCLD = $(CC) -+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ -+ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -+CFLAGS = @CFLAGS@ -+DIST_SOURCES = $(libmetric25_la_SOURCES) -+DIST_COMMON = Makefile.am Makefile.in -+SOURCES = $(libmetric25_la_SOURCES) -+ -+all: all-am -+ -+.SUFFIXES: -+.SUFFIXES: .c .lo .o .obj -+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) -+ cd $(top_srcdir) && \ -+ $(AUTOMAKE) --gnu netbsd/Makefile -+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -+ -+clean-noinstLTLIBRARIES: -+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) -+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ -+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ -+ test -z "$dir" && dir=.; \ -+ echo "rm -f \"$${dir}/so_locations\""; \ -+ rm -f "$${dir}/so_locations"; \ -+ done -+libmetric25.la: $(libmetric25_la_OBJECTS) $(libmetric25_la_DEPENDENCIES) -+ $(LINK) $(libmetric25_la_LDFLAGS) $(libmetric25_la_OBJECTS) $(libmetric25_la_LIBADD) $(LIBS) -+ -+mostlyclean-compile: -+ -rm -f *.$(OBJEXT) core *.core -+ -+distclean-compile: -+ -rm -f *.tab.c -+ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metrics.Plo@am__quote@ -+ -+distclean-depend: -+ -rm -rf ./$(DEPDIR) -+ -+.c.o: -+@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -+@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< -+ -+.c.obj: -+@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -+@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+ $(COMPILE) -c `cygpath -w $<` -+ -+.c.lo: -+@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -+@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< -+CCDEPMODE = @CCDEPMODE@ -+ -+mostlyclean-libtool: -+ -rm -f *.lo -+ -+clean-libtool: -+ -rm -rf .libs _libs -+ -+distclean-libtool: -+ -rm -f libtool -+uninstall-info-am: -+ -+ETAGS = etags -+ETAGSFLAGS = -+ -+tags: TAGS -+ -+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) -+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ -+ unique=`for i in $$list; do \ -+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ -+ done | \ -+ $(AWK) ' { files[$$0] = 1; } \ -+ END { for (i in files) print i; }'`; \ -+ mkid -fID $$unique -+ -+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ -+ $(TAGS_FILES) $(LISP) -+ tags=; \ -+ here=`pwd`; \ -+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ -+ unique=`for i in $$list; do \ -+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ -+ done | \ -+ $(AWK) ' { files[$$0] = 1; } \ -+ END { for (i in files) print i; }'`; \ -+ test -z "$(ETAGS_ARGS)$$tags$$unique" \ -+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ -+ $$tags $$unique -+ -+GTAGS: -+ here=`$(am__cd) $(top_builddir) && pwd` \ -+ && cd $(top_srcdir) \ -+ && gtags -i $(GTAGS_ARGS) $$here -+ -+distclean-tags: -+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -+ -+top_distdir = .. -+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) -+ -+distdir: $(DISTFILES) -+ @list='$(DISTFILES)'; for file in $$list; do \ -+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ -+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ -+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ -+ dir="/$$dir"; \ -+ $(mkinstalldirs) "$(distdir)$$dir"; \ -+ else \ -+ dir=''; \ -+ fi; \ -+ if test -d $$d/$$file; then \ -+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ -+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ -+ fi; \ -+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ -+ else \ -+ test -f $(distdir)/$$file \ -+ || cp -p $$d/$$file $(distdir)/$$file \ -+ || exit 1; \ -+ fi; \ -+ done -+check-am: all-am -+check: check-am -+all-am: Makefile $(LTLIBRARIES) -+ -+installdirs: -+ -+install: install-am -+install-exec: install-exec-am -+install-data: install-data-am -+uninstall: uninstall-am -+ -+install-am: all-am -+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -+ -+installcheck: installcheck-am -+install-strip: -+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ -+ INSTALL_STRIP_FLAG=-s \ -+ `test -z '$(STRIP)' || \ -+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -+mostlyclean-generic: -+ -+clean-generic: -+ -+distclean-generic: -+ -rm -f Makefile $(CONFIG_CLEAN_FILES) -+ -+maintainer-clean-generic: -+ @echo "This command is intended for maintainers to use" -+ @echo "it deletes files that may require special tools to rebuild." -+clean: clean-am -+ -+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ -+ mostlyclean-am -+ -+distclean: distclean-am -+ -+distclean-am: clean-am distclean-compile distclean-depend \ -+ distclean-generic distclean-libtool distclean-tags -+ -+dvi: dvi-am -+ -+dvi-am: -+ -+info: info-am -+ -+info-am: -+ -+install-data-am: -+ -+install-exec-am: -+ -+install-info: install-info-am -+ -+install-man: -+ -+installcheck-am: -+ -+maintainer-clean: maintainer-clean-am -+ -+maintainer-clean-am: distclean-am maintainer-clean-generic -+ -+mostlyclean: mostlyclean-am -+ -+mostlyclean-am: mostlyclean-compile mostlyclean-generic \ -+ mostlyclean-libtool -+ -+uninstall-am: uninstall-info-am -+ -+.PHONY: GTAGS all all-am check check-am clean clean-generic \ -+ clean-libtool clean-noinstLTLIBRARIES distclean \ -+ distclean-compile distclean-depend distclean-generic \ -+ distclean-libtool distclean-tags distdir dvi dvi-am info \ -+ info-am install install-am install-data install-data-am \ -+ install-exec install-exec-am install-info install-info-am \ -+ install-man install-strip installcheck installcheck-am \ -+ installdirs maintainer-clean maintainer-clean-generic \ -+ mostlyclean mostlyclean-compile mostlyclean-generic \ -+ mostlyclean-libtool tags uninstall uninstall-am \ -+ uninstall-info-am -+ -+# Tell versions [3.59,3.63) of GNU make to not export all variables. -+# Otherwise a system limit (for SysV at least) may be exceeded. -+.NOEXPORT: diff --git a/parallel/ganglia-monitor-core/patches/patch-al b/parallel/ganglia-monitor-core/patches/patch-al deleted file mode 100644 index 8936e61d5d0..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-al +++ /dev/null @@ -1,78 +0,0 @@ -$NetBSD: patch-al,v 1.1 2005/02/10 02:33:53 jschauma Exp $ - ---- ganglia.html.orig 2005-02-07 22:25:39.000000000 -0500 -+++ ganglia.html 2005-02-07 22:26:58.000000000 -0500 -@@ -278,7 +278,7 @@ - example, you may not want to have <code>gexec</code> run jobs on your cluster frontend nodes.</p> - </dd> - <dd> --<p>You simply add the following line to your <code>gmond</code> configuration file (<code>/etc/gmond.conf</code> by -+<p>You simply add the following line to your <code>gmond</code> configuration file (<code>@PKG_SYSCONFDIR@/gmond.conf</code> by - default)</p> - </dd> - <dd> -@@ -383,16 +383,16 @@ - <p>The configuration file format has changed between gmond version 2.5.x and version - 2.6.x. The change was necessary in order to allow more complex configuration options.</p> - <p>Gmond has a default configuration it will use if it does not find the default configuration --file <strong>/etc/gmond.conf</strong>. To see the default configuration simply run the command:</p> -+file <strong>@PKG_SYSCONFDIR@/gmond.conf</strong>. To see the default configuration simply run the command:</p> - <pre> - % gmond --default_config</pre> - <p>and gmond will output its default configuration to stdout. This default configuration can - serve as a good starting place for building a more custom configuration.</p> - <pre> - % gmond --default_config > gmond.conf</pre> --<p>would create a file <strong>gmond.conf</strong> which you can then edit to taste and copy to <strong>/etc/gmond.conf</strong> -+<p>would create a file <strong>gmond.conf</strong> which you can then edit to taste and copy to <strong>@PKG_SYSCONFDIR@/gmond.conf</strong> - or elsewhere.</p> --<p>To start gmond with a configuration file other then <strong>/etc/gmond.conf</strong>, simply specify the -+<p>To start gmond with a configuration file other then <strong>@PKG_SYSCONFDIR@/gmond.conf</strong>, simply specify the - configuration file location by running</p> - <pre> - % gmond --config /my/ganglia/configs/custom.conf</pre> -@@ -411,7 +411,7 @@ - </p> - <h2><a name="gmetad_configuration">Gmetad Configuration</a></h2> - <p>The behavior of the Ganglia Meta Daemon is completely controlled by a single configuration --file which is by default <code>/etc/gmetad.conf</code>. For gmetad to do anything useful you much -+file which is by default <code>@PKG_SYSCONFDIR@/gmetad.conf</code>. For gmetad to do anything useful you much - specify at least one <code>data_source</code> in the configuration. The format of the data_source - line is as follows</p> - <pre> -@@ -574,7 +574,7 @@ - -h, --help Print help and exit - -V, --version Print version and exit - -c, --conf=STRING The configuration file to use for finding send channels -- (default=`/etc/gmond.conf') -+ (default=`@PKG_SYSCONFDIR@/gmond.conf') - -n, --name=STRING Name of the metric - -v, --value=STRING Value of the metric - -t, --type=STRING Either -@@ -586,7 +586,7 @@ - (default=`60') - -d, --dmax=INT The lifetime in seconds of this metric (default=`0')</pre> - <p>Gmetric sends the metric specified on the commandline to all <strong>udp_send_channel</strong>s specified --in the configuration file <strong>/etc/gmond.conf</strong> by default. If you want to send metric to -+in the configuration file <strong>@PKG_SYSCONFDIR@/gmond.conf</strong> by default. If you want to send metric to - alternate <strong>udp_send_channel</strong>s, you can specify a different configuration file as such:</p> - <pre> - % gmetric --conf=./custom.conf -n "wow" -v "it works" -t "string"</pre> -@@ -913,7 +913,7 @@ - - mcast_if eth1 - -- .. in /etc/gmond.conf that tells gmond to send its data out the "eth1" -+ .. in @PKG_SYSCONFDIR@/gmond.conf that tells gmond to send its data out the "eth1" - network interface but that doesn't necessarily mean that the source - address of the packets will match the "eth1" interface. to make sure that - data sent out eth1 has the correct source address run the following... -@@ -951,7 +951,7 @@ - > 26 nodes each - > gmond - > -- > In the frontend /etc/gmond.conf I have the -+ > In the frontend @PKG_SYSCONFDIR@/gmond.conf I have the - > following statement: mcast_if eth1 - > - > The 26 nodes are correctly reported. diff --git a/parallel/ganglia-monitor-core/patches/patch-am b/parallel/ganglia-monitor-core/patches/patch-am deleted file mode 100644 index 8d8d62f5768..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-am +++ /dev/null @@ -1,13 +0,0 @@ -$NetBSD: patch-am,v 1.2 2006/04/30 22:28:44 joerg Exp $ - ---- srclib/libmetrics/Makefile.in.orig 2005-02-07 22:33:09.000000000 -0500 -+++ srclib/libmetrics/Makefile.in 2005-02-07 22:33:21.000000000 -0500 -@@ -93,7 +93,7 @@ - am__quote = @am__quote@ - install_sh = @install_sh@ - SUBDIRS = @OS@ . tests --DIST_SUBDIRS = aix cygwin darwin freebsd hpux irix linux osf solaris tests -+DIST_SUBDIRS = aix cygwin darwin dragonfly freebsd hpux irix linux netbsd osf solaris tests - - - #AM_CFLAGS = -I$(top_builddir)/lib diff --git a/parallel/ganglia-monitor-core/patches/patch-an b/parallel/ganglia-monitor-core/patches/patch-an deleted file mode 100644 index 9fc123abe61..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-an +++ /dev/null @@ -1,11 +0,0 @@ -$NetBSD: patch-an,v 1.2 2006/04/30 22:28:44 joerg Exp $ - ---- srclib/libmetrics/Makefile.am.orig 2005-02-07 22:35:25.000000000 -0500 -+++ srclib/libmetrics/Makefile.am 2005-02-07 22:35:58.000000000 -0500 -@@ -1,5 +1,5 @@ - SUBDIRS=@OS@ . tests --DIST_SUBDIRS= aix cygwin darwin freebsd hpux irix linux osf solaris tests -+DIST_SUBDIRS= aix cygwin darwin dragonfly freebsd hpux irix linux netbsd osf solaris tests - - #AM_CFLAGS = -I$(top_builddir)/lib - diff --git a/parallel/ganglia-monitor-core/patches/patch-ao b/parallel/ganglia-monitor-core/patches/patch-ao deleted file mode 100644 index 955bc8195a1..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-ao +++ /dev/null @@ -1,13 +0,0 @@ -$NetBSD: patch-ao,v 1.1 2006/04/30 22:28:44 joerg Exp $ - ---- lib/Makefile.in.orig 2006-04-30 18:38:28.000000000 +0000 -+++ lib/Makefile.in -@@ -107,7 +107,7 @@ am__quote = @am__quote@ - install_sh = @install_sh@ - varstatedir = @varstatedir@ - --AM_CFLAGS = -I.. -I. -I$(top_builddir)/srclib/expat/lib/ -I$(top_builddir)/srclib/libmetrics/ -I$(top_builddir)/srclib/apr/include/ -I$(top_builddir)/srclib/apr/include/arch/unix/ -I$(top_builddir)/srclib/confuse/src -+AM_CFLAGS = -I.. -I. -I$(top_builddir)/srclib/libmetrics/ -I$(top_builddir)/srclib/confuse/src -I$(PREFIX)/include/apr-0 -I$(PREFIX)/include/apr-0/arch/unix - - include_HEADERS = ganglia.h - diff --git a/parallel/ganglia-monitor-core/patches/patch-ap b/parallel/ganglia-monitor-core/patches/patch-ap deleted file mode 100644 index d00148fc6ed..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-ap +++ /dev/null @@ -1,30 +0,0 @@ -$NetBSD: patch-ap,v 1.1 2006/04/30 22:28:44 joerg Exp $ - ---- gmond/gstat/Makefile.in.orig 2005-02-02 18:24:14.000000000 +0000 -+++ gmond/gstat/Makefile.in -@@ -103,13 +103,13 @@ am__include = @am__include@ - am__quote = @am__quote@ - install_sh = @install_sh@ - varstatedir = @varstatedir@ --AM_CFLAGS = -I$(top_builddir)/lib -I$(top_builddir)/srclib/expat/lib/ -+AM_CFLAGS = -I$(top_builddir)/lib - - bin_PROGRAMS = gstat - gstat_SOURCES = gstat.c cmdline.c cmdline.h - gstat_LDADD = $(top_builddir)/lib/libganglia.la \ - $(top_builddir)/lib/libgetopthelper.a \ -- $(top_builddir)/srclib/expat/lib/libexpat.la -+ -L$(PREFIX)/lib -lexpat - - gstat_LDFLAGS = -static - subdir = gmond/gstat -@@ -122,8 +122,7 @@ PROGRAMS = $(bin_PROGRAMS) - am_gstat_OBJECTS = gstat.$(OBJEXT) cmdline.$(OBJEXT) - gstat_OBJECTS = $(am_gstat_OBJECTS) - gstat_DEPENDENCIES = $(top_builddir)/lib/libganglia.la \ -- $(top_builddir)/lib/libgetopthelper.a \ -- $(top_builddir)/srclib/expat/lib/libexpat.la -+ $(top_builddir)/lib/libgetopthelper.a - - DEFS = @DEFS@ - DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) diff --git a/parallel/ganglia-monitor-core/patches/patch-aq b/parallel/ganglia-monitor-core/patches/patch-aq deleted file mode 100644 index 5ddc1e4aa8d..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-aq +++ /dev/null @@ -1,30 +0,0 @@ -$NetBSD: patch-aq,v 1.1 2006/04/30 22:28:44 joerg Exp $ - ---- gmond/Makefile.in.orig 2005-02-02 18:24:14.000000000 +0000 -+++ gmond/Makefile.in -@@ -107,8 +107,7 @@ SUBDIRS = gstat - - EXTRA_DIST = gmond.init gmond.conf.5 gmond.conf.html conf.pod - --AM_CFLAGS = -I$(top_builddir)/lib -I$(top_builddir)/srclib/libmetrics/ -I$(top_builddir)/srclib/expat/lib/ -I$(top_builddir)/srclib/apr/include/ -I$(top_builddir)/srclib/confuse/src/ -- -+AM_CFLAGS = -I$(top_builddir)/lib -I$(top_builddir)/srclib/libmetrics/ -I$(top_builddir)/srclib/confuse/src/ -I$(PREFIX)/include/apr-0 - sbin_PROGRAMS = gmond - # metric.h and dtd.h are for gmetad/gmetric for now.... - gmond_SOURCES = gmond.c cmdline.c cmdline.h dtd.h metric.h g25_config.c g25_config.h -@@ -122,10 +121,13 @@ gmond_LDADD = $(top_builddir)/lib/libgan - $(top_builddir)/lib/libgetopthelper.a \ - $(top_builddir)/srclib/libmetrics/libmetrics.la \ - $(top_builddir)/srclib/confuse/src/libconfuse.la \ -- $(top_builddir)/srclib/apr/libapr-0.la -+ -lapr-0 - - gmond_LDFLAGS = -static --gmond_DEPENDENCIES = $(gmond_LDADD) -+gmond_DEPENDENCIES = $(top_builddir)/lib/libganglia.la \ -+ $(top_builddir)/lib/libgetopthelper.a \ -+ $(top_builddir)/srclib/libmetrics/libmetrics.la \ -+ $(top_builddir)/srclib/confuse/src/libconfuse.la - subdir = gmond - mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs - CONFIG_HEADER = $(top_builddir)/config.h diff --git a/parallel/ganglia-monitor-core/patches/patch-ar b/parallel/ganglia-monitor-core/patches/patch-ar deleted file mode 100644 index ca261eb016d..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-ar +++ /dev/null @@ -1,32 +0,0 @@ -$NetBSD: patch-ar,v 1.1 2006/04/30 22:28:44 joerg Exp $ - ---- gmetad/Makefile.in.orig 2005-02-02 18:24:14.000000000 +0000 -+++ gmetad/Makefile.in -@@ -103,7 +103,7 @@ am__include = @am__include@ - am__quote = @am__quote@ - install_sh = @install_sh@ - varstatedir = @varstatedir@ --AM_CFLAGS = -O0 -I$(top_builddir)/lib -I$(top_builddir)/gmond -I$(top_builddir)/srclib/expat/lib/ -+AM_CFLAGS = -O0 -I$(top_builddir)/lib -I$(top_builddir)/gmond - - sbin_PROGRAMS = gmetad - gmetad_SOURCES = gmetad.c cmdline.c cmdline.h gmetad.h data_thread.c \ -@@ -111,7 +111,7 @@ gmetad_SOURCES = gmetad.c cmdline.c cmdl - xml_hash.c cleanup.c - - gmetad_LDADD = $(top_builddir)/lib/libganglia.la -lrrd -lm \ -- $(top_builddir)/srclib/expat/lib/libexpat.la -+ -L$(PREFIX)/lib -lexpat - - gmetad_LDFLAGS = -static - EXTRA_DIST = gmetad.conf gmetad.init -@@ -127,8 +127,7 @@ am_gmetad_OBJECTS = gmetad.$(OBJEXT) cmd - rrd_helpers.$(OBJEXT) conf.$(OBJEXT) type_hash.$(OBJEXT) \ - xml_hash.$(OBJEXT) cleanup.$(OBJEXT) - gmetad_OBJECTS = $(am_gmetad_OBJECTS) --gmetad_DEPENDENCIES = $(top_builddir)/lib/libganglia.la \ -- $(top_builddir)/srclib/expat/lib/libexpat.la -+gmetad_DEPENDENCIES = $(top_builddir)/lib/libganglia.la - - DEFS = @DEFS@ - DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) diff --git a/parallel/ganglia-monitor-core/patches/patch-as b/parallel/ganglia-monitor-core/patches/patch-as deleted file mode 100644 index b5b95865bbf..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-as +++ /dev/null @@ -1,45 +0,0 @@ -$NetBSD: patch-as,v 1.1 2006/04/30 22:28:44 joerg Exp $ - ---- configure.orig 2005-02-02 18:24:14.000000000 +0000 -+++ configure -@@ -2029,14 +2029,6 @@ echo $ac_n "${nl}Configuring libmetrics - cd srclib/libmetrics && ./configure --cache-file=$ganglia_popdir/config.cache - cd $ganglia_popdir - --echo $ac_n "${nl}Configuring expat ...${nl}" --cd srclib/expat && ./configure --cache-file=$ganglia_popdir/config.cache --cd $ganglia_popdir -- --echo $ac_n "${nl}Configuring apr ...${nl}" --cd srclib/apr && ./configure --cache-file=$ganglia_popdir/config.cache --cd $ganglia_popdir -- - echo $ac_n "${nl}Configuring libconfuse ...${nl}" - cd srclib/confuse && ./configure --cache-file=$ganglia_popdir/config.cache --disable-nls - cd $ganglia_popdir -@@ -18734,13 +18726,13 @@ if test "${enable_memcheck+set}" = set; - fi; - - --echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 --echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6 -+echo "$as_me:$LINENO: checking for pthread_create in ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}" >&5 -+echo $ECHO_N "checking for pthread_create in ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}... $ECHO_C" >&6 - if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lpthread $LIBS" -+LIBS="${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - /* confdefs.h. */ -@@ -18793,7 +18785,7 @@ if test $ac_cv_lib_pthread_pthread_creat - #define HAVE_LIBPTHREAD 1 - _ACEOF - -- LIBS="-lpthread $LIBS" -+ LIBS="${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} $LIBS" - - fi - diff --git a/parallel/ganglia-monitor-core/patches/patch-at b/parallel/ganglia-monitor-core/patches/patch-at deleted file mode 100644 index 12f684e2cf3..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-at +++ /dev/null @@ -1,13 +0,0 @@ -$NetBSD: patch-at,v 1.1 2006/04/30 22:28:44 joerg Exp $ - ---- srclib/Makefile.in.orig 2006-04-30 19:41:17.000000000 +0000 -+++ srclib/Makefile.in -@@ -103,7 +103,7 @@ am__include = @am__include@ - am__quote = @am__quote@ - install_sh = @install_sh@ - varstatedir = @varstatedir@ --SUBDIRS = libmetrics expat apr confuse -+SUBDIRS = libmetrics confuse - subdir = srclib - mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs - CONFIG_HEADER = $(top_builddir)/config.h diff --git a/parallel/ganglia-monitor-core/patches/patch-au b/parallel/ganglia-monitor-core/patches/patch-au deleted file mode 100644 index 33179767ef5..00000000000 --- a/parallel/ganglia-monitor-core/patches/patch-au +++ /dev/null @@ -1,23 +0,0 @@ -$NetBSD: patch-au,v 1.1 2006/04/30 22:28:44 joerg Exp $ - ---- gmetric/Makefile.in.orig 2005-02-02 18:24:14.000000000 +0000 -+++ gmetric/Makefile.in -@@ -111,7 +111,7 @@ gmetric_LDADD = $(top_builddir)/lib/libg - $(top_builddir)/lib/libgetopthelper.a \ - $(top_builddir)/srclib/libmetrics/libmetrics.la \ - $(top_builddir)/srclib/confuse/src/libconfuse.la \ -- $(top_builddir)/srclib/apr/libapr-0.la -+ -lapr-0 - - gmetric_LDFLAGS = -static - subdir = gmetric -@@ -126,8 +126,7 @@ gmetric_OBJECTS = $(am_gmetric_OBJECTS) - gmetric_DEPENDENCIES = $(top_builddir)/lib/libganglia.la \ - $(top_builddir)/lib/libgetopthelper.a \ - $(top_builddir)/srclib/libmetrics/libmetrics.la \ -- $(top_builddir)/srclib/confuse/src/libconfuse.la \ -- $(top_builddir)/srclib/apr/libapr-0.la -+ $(top_builddir)/srclib/confuse/src/libconfuse.la - - DEFS = @DEFS@ - DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) |