pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/collectd Adapt and re-enable the process plug...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3b252bc15980
branches:  trunk
changeset: 371761:3b252bc15980
user:      he <he%pkgsrc.org@localhost>
date:      Tue Nov 21 16:02:20 2017 +0000

description:
Adapt and re-enable the process plugin for NetBSD.
Bump PKGREVISION.

diffstat:

 sysutils/collectd/Makefile                      |   4 +++-
 sysutils/collectd/distinfo                      |   4 ++--
 sysutils/collectd/options.mk                    |   6 +++---
 sysutils/collectd/patches/patch-src_processes.c |  24 +++++++++++++++++-------
 4 files changed, 25 insertions(+), 13 deletions(-)

diffs (131 lines):

diff -r a509340332ca -r 3b252bc15980 sysutils/collectd/Makefile
--- a/sysutils/collectd/Makefile        Tue Nov 21 15:18:36 2017 +0000
+++ b/sysutils/collectd/Makefile        Tue Nov 21 16:02:20 2017 +0000
@@ -1,7 +1,9 @@
-# $NetBSD: Makefile,v 1.22 2017/06/14 13:42:53 fhajny Exp $
+# $NetBSD: Makefile,v 1.23 2017/11/21 16:02:20 he Exp $
 
 .include "../../sysutils/collectd/Makefile.common"
 
+PKGREVISION=   1
+
 COMMENT=       Statistics collection daemon base
 
 RCD_SCRIPTS=   collectd
diff -r a509340332ca -r 3b252bc15980 sysutils/collectd/distinfo
--- a/sysutils/collectd/distinfo        Tue Nov 21 15:18:36 2017 +0000
+++ b/sysutils/collectd/distinfo        Tue Nov 21 16:02:20 2017 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.40 2017/11/21 15:18:22 fhajny Exp $
+$NetBSD: distinfo,v 1.41 2017/11/21 16:02:20 he Exp $
 
 SHA1 (collectd-5.8.0.tar.bz2) = eb3567563de471e1950b7388e8883b911be3756a
 RMD160 (collectd-5.8.0.tar.bz2) = 7b812b1046d57a9047213bb182b8744d98606547
@@ -18,7 +18,7 @@
 SHA1 (patch-src_lua.c) = 656934889976f489abb80a8244492f845a3bd9f8
 SHA1 (patch-src_memory.c) = 3276b09d0c09e0a9446519bd6c304d95c30b617a
 SHA1 (patch-src_netstat__udp.c) = 30cb12d25f56c60959658dbd181783212e00cc61
-SHA1 (patch-src_processes.c) = 3dd8510bfd0d25051f30519f62d638536c45a6e2
+SHA1 (patch-src_processes.c) = a22b1e9d7935c7924b65c57990b4212990acc6b7
 SHA1 (patch-src_statsd.c) = 35f4349d2d2c9bddc0f4770344f969157cd012f6
 SHA1 (patch-src_swap.c) = 98984dc7c6eee4f17b2f291124431172b06aa6c2
 SHA1 (patch-src_tcpconns.c) = 0469ffe477ae96a79e4fd28c4428a1e7682e9461
diff -r a509340332ca -r 3b252bc15980 sysutils/collectd/options.mk
--- a/sysutils/collectd/options.mk      Tue Nov 21 15:18:36 2017 +0000
+++ b/sysutils/collectd/options.mk      Tue Nov 21 16:02:20 2017 +0000
@@ -1,13 +1,13 @@
-# $NetBSD: options.mk,v 1.10 2017/11/21 15:18:22 fhajny Exp $
+# $NetBSD: options.mk,v 1.11 2017/11/21 16:02:20 he Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.collectd
 PKG_SUPPORTED_OPTIONS= cpu df interface load memory syslog uptime
 PKG_SUGGESTED_OPTIONS+=        cpu df interface load memory syslog uptime
 
 PKG_SUPPORTED_OPTIONS.NetBSD+= contextswitch disk entropy irq pf netstat_udp
-PKG_SUPPORTED_OPTIONS.NetBSD+= swap tcpconns users # processes
+PKG_SUPPORTED_OPTIONS.NetBSD+= swap tcpconns users processes
 PKG_SUGGESTED_OPTIONS.NetBSD+= contextswitch disk entropy irq pf netstat_udp
-PKG_SUGGESTED_OPTIONS.NetBSD+= swap tcpconns users # processes
+PKG_SUGGESTED_OPTIONS.NetBSD+= swap tcpconns users processes
 
 PKG_SUPPORTED_OPTIONS.FreeBSD+=        contextswitch pf processes swap tcpconns zfs-arc
 PKG_SUGGESTED_OPTIONS.FreeBSD+=        contextswitch pf processes swap tcpconns zfs-arc
diff -r a509340332ca -r 3b252bc15980 sysutils/collectd/patches/patch-src_processes.c
--- a/sysutils/collectd/patches/patch-src_processes.c   Tue Nov 21 15:18:36 2017 +0000
+++ b/sysutils/collectd/patches/patch-src_processes.c   Tue Nov 21 16:02:20 2017 +0000
@@ -1,10 +1,10 @@
-$NetBSD: patch-src_processes.c,v 1.7 2017/06/23 16:52:45 kamil Exp $
+$NetBSD: patch-src_processes.c,v 1.8 2017/11/21 16:02:20 he Exp $
 
 Add a port to NetBSD.
 
 --- src/processes.c.orig       2017-06-06 18:13:54.693164693 +0000
 +++ src/processes.c
-@@ -95,14 +95,16 @@
+@@ -97,14 +97,16 @@
  /* #endif KERNEL_LINUX */
  
  #elif HAVE_LIBKVM_GETPROCS &&                                                  \
@@ -23,7 +23,7 @@
  
  #elif HAVE_PROCINFO_H
  #include <procinfo.h>
-@@ -244,10 +246,15 @@ static void ps_fill_details(const procst
+@@ -286,10 +288,15 @@ static void ps_fill_details(const procst
  /* #endif KERNEL_LINUX */
  
  #elif HAVE_LIBKVM_GETPROCS &&                                                  \
@@ -41,7 +41,7 @@
  
  #elif HAVE_PROCINFO_H
  static struct procentry64 procentry[MAXPROCENTRY];
-@@ -601,10 +608,21 @@ static int ps_init(void) {
+@@ -673,10 +680,21 @@ static int ps_init(void) {
  /* #endif KERNEL_LINUX */
  
  #elif HAVE_LIBKVM_GETPROCS &&                                                  \
@@ -65,7 +65,7 @@
  
  #elif HAVE_PROCINFO_H
    pagesize = getpagesize();
-@@ -1896,6 +1914,187 @@ static int ps_read(void) {
+@@ -2074,6 +2092,197 @@ static int ps_read(void) {
      ps_submit_proc_list(ps_ptr);
  /* #endif HAVE_LIBKVM_GETPROCS && HAVE_STRUCT_KINFO_PROC_FREEBSD */
  
@@ -89,7 +89,7 @@
 +  struct kinfo_lwp *kl;
 +
 +  procstat_t *ps_ptr;
-+  procstat_entry_t pse;
++  process_entry_t pse;
 +
 +  ps_list_reset ();
 +
@@ -148,8 +148,8 @@
 +        }
 +      } /* if (process has argument list) */
 +
++      memset(&pse, 0, sizeof(pse));
 +      pse.id = procs[i].p_pid;
-+      pse.age = 0;
 +
 +      pse.num_proc = 1;
 +      pse.num_lwp = procs[i].p_nlwps;
@@ -188,6 +188,16 @@
 +      pse.io_syscr = procs[i].p_uru_inblock;
 +      pse.io_syscw = procs[i].p_uru_oublock;
 +
++      /* file descriptor count not implemented */
++      pse.num_fd = 0;
++
++      /* Number of memory mappings */
++      pse.num_maps = 0;
++
++      /* context switch counters not implemented */
++      pse.cswitch_vol = -1;
++      pse.cswitch_invol = -1;
++
 +      ps_list_add (procs[i].p_comm, have_cmdline ? cmdline : NULL, &pse);
 +    } /* if ((proc_ptr == NULL) || (proc_ptr->ki_pid != procs[i].ki_pid)) */
 +



Home | Main Index | Thread Index | Old Index