pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/sysutils/collectd Try to deal with API changes for the...
details: https://anonhg.NetBSD.org/pkgsrc/rev/9202b2176dde
branches: trunk
changeset: 358550:9202b2176dde
user: joerg <joerg%pkgsrc.org@localhost>
date: Tue Feb 14 21:23:13 2017 +0000
description:
Try to deal with API changes for the NetBSD port.
diffstat:
sysutils/collectd/distinfo | 6 +++---
sysutils/collectd/patches/patch-src_entropy.c | 17 ++++++++++++-----
sysutils/collectd/patches/patch-src_processes.c | 14 +++++---------
3 files changed, 20 insertions(+), 17 deletions(-)
diffs (139 lines):
diff -r a1128d20e976 -r 9202b2176dde sysutils/collectd/distinfo
--- a/sysutils/collectd/distinfo Tue Feb 14 21:22:43 2017 +0000
+++ b/sysutils/collectd/distinfo Tue Feb 14 21:23:13 2017 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.33 2017/01/25 14:10:18 fhajny Exp $
+$NetBSD: distinfo,v 1.34 2017/02/14 21:23:13 joerg Exp $
SHA1 (collectd-5.7.1.tar.bz2) = bc77d2493b26e5c38e167a8a44fedfe287742c09
RMD160 (collectd-5.7.1.tar.bz2) = f743ebb21313ac0bae6a3ba78456e5c16f0d15cc
@@ -12,12 +12,12 @@
SHA1 (patch-src_daemon_Makefile.am) = e38d465faf8bdd750fd9cb7f0bd9f041fcc8f83c
SHA1 (patch-src_df.c) = 5c6549cd9ec72efed5cdb7d8dd9297c50491426e
SHA1 (patch-src_disk.c) = 1d458db9753be9c8ad1ae5edb3468acf7419a66b
-SHA1 (patch-src_entropy.c) = 326e246c52f12f5bad4df5e78504adae3121f309
+SHA1 (patch-src_entropy.c) = 293e7105866b9b7c3eb5058dc314eaa510899843
SHA1 (patch-src_irq.c) = 78f1757ff2ed6db9fb1d0e773c2a01eb190d53a0
SHA1 (patch-src_libcollectclient_network__buffer.c) = 62924943831e6d0585b103e567888f9af5c46f9e
SHA1 (patch-src_memory.c) = 2934cd50e454fc14d0ec952854c88b0a830fa9a7
SHA1 (patch-src_netstat__udp.c) = 30cb12d25f56c60959658dbd181783212e00cc61
-SHA1 (patch-src_processes.c) = dbcbb733b00bd77b0eae6d16f03fb0bcb3cbcbff
+SHA1 (patch-src_processes.c) = 1a75fdaa42f37eef1a968d299c3549e640fb68b2
SHA1 (patch-src_statsd.c) = 35f4349d2d2c9bddc0f4770344f969157cd012f6
SHA1 (patch-src_swap.c) = 24da6e04e3006639311e8111f26f72e4fab4054a
SHA1 (patch-src_tcpconns.c) = b85de1d0eb03989df12d9688b38d61733a13c028
diff -r a1128d20e976 -r 9202b2176dde sysutils/collectd/patches/patch-src_entropy.c
--- a/sysutils/collectd/patches/patch-src_entropy.c Tue Feb 14 21:22:43 2017 +0000
+++ b/sysutils/collectd/patches/patch-src_entropy.c Tue Feb 14 21:23:13 2017 +0000
@@ -1,18 +1,18 @@
-$NetBSD: patch-src_entropy.c,v 1.8 2017/01/25 14:10:18 fhajny Exp $
+$NetBSD: patch-src_entropy.c,v 1.9 2017/02/14 21:23:13 joerg Exp $
Provide a NetBSD implementation for graphing available entropy.
This version tries to keep /dev/urandom open (for repeated use),
instead of constantly re-opening/closing it, since the latter will
needlessly reduce the kernel's entropy estimate.
---- src/entropy.c.orig 2017-01-23 07:53:57.704448789 +0000
+--- src/entropy.c.orig 2017-01-23 07:53:57.000000000 +0000
+++ src/entropy.c
@@ -29,23 +29,16 @@
#include "common.h"
#include "plugin.h"
-#if !KERNEL_LINUX
-+static void entropy_submit (double);
++static void entropy_submit (value_t);
+static int entropy_read (void);
+
+#if !KERNEL_LINUX && !KERNEL_NETBSD
@@ -36,7 +36,7 @@
static int entropy_read(void) {
value_t v;
if (parse_value_file(ENTROPY_FILE, &v, DS_TYPE_GAUGE) != 0) {
-@@ -56,6 +49,63 @@ static int entropy_read(void) {
+@@ -56,6 +49,70 @@ static int entropy_read(void) {
entropy_submit(v);
return (0);
}
@@ -63,8 +63,10 @@
+static int
+entropy_read (void)
+{
++ value_t v;
+ rndpoolstat_t rs;
+ static int fd;
++ char buf[30];
+
+ if (fd == 0) {
+ fd = open(_PATH_URANDOM, O_RDONLY, 0644);
@@ -79,8 +81,13 @@
+ fd = 0; /* signal a reopening on next attempt */
+ return -1;
+ }
++ snprintf(buf, sizeof(buf), "%ju", (uintmax_t)rs.curentropy);
++ if (parse_value(buf, &v, DS_TYPE_GAUGE) != 0) {
++ ERROR("entropy plugin: Parsing \"%s\" failed.", buf);
++ return (-1);
++ }
+
-+ entropy_submit (rs.curentropy);
++ entropy_submit (v);
+
+ return 0;
+}
diff -r a1128d20e976 -r 9202b2176dde sysutils/collectd/patches/patch-src_processes.c
--- a/sysutils/collectd/patches/patch-src_processes.c Tue Feb 14 21:22:43 2017 +0000
+++ b/sysutils/collectd/patches/patch-src_processes.c Tue Feb 14 21:23:13 2017 +0000
@@ -1,8 +1,8 @@
-$NetBSD: patch-src_processes.c,v 1.5 2017/01/19 17:20:42 he Exp $
+$NetBSD: patch-src_processes.c,v 1.6 2017/02/14 21:23:13 joerg Exp $
Add a port to NetBSD.
---- src/processes.c.orig 2016-11-30 08:52:01.000000000 +0000
+--- src/processes.c.orig 2017-01-23 07:53:57.000000000 +0000
+++ src/processes.c
@@ -95,14 +95,14 @@
/* #endif KERNEL_LINUX */
@@ -21,7 +21,7 @@
#elif HAVE_PROCINFO_H
#include <procinfo.h>
-@@ -244,10 +244,15 @@ static long pagesize_g;
+@@ -244,10 +244,15 @@ static void ps_fill_details(const procst
/* #endif KERNEL_LINUX */
#elif HAVE_LIBKVM_GETPROCS && \
@@ -39,7 +39,7 @@
#elif HAVE_PROCINFO_H
static struct procentry64 procentry[MAXPROCENTRY];
-@@ -607,10 +612,21 @@ static int ps_init(void) {
+@@ -601,10 +606,21 @@ static int ps_init(void) {
/* #endif KERNEL_LINUX */
#elif HAVE_LIBKVM_GETPROCS && \
@@ -63,7 +63,7 @@
#elif HAVE_PROCINFO_H
pagesize = getpagesize();
-@@ -1917,6 +1933,191 @@ static int ps_read(void) {
+@@ -1896,6 +1912,187 @@ static int ps_read(void) {
ps_submit_proc_list(ps_ptr);
/* #endif HAVE_LIBKVM_GETPROCS && HAVE_STRUCT_KINFO_PROC_FREEBSD */
@@ -157,13 +157,9 @@
+ pse.vmem_data = procs[i].p_vm_dsize * pagesize;
+ pse.vmem_code = procs[i].p_vm_tsize * pagesize;
+ pse.stack_size = procs[i].p_vm_ssize * pagesize;
-+ pse.vmem_minflt = 0;
+ pse.vmem_minflt_counter = procs[i].p_uru_minflt;
-+ pse.vmem_majflt = 0;
+ pse.vmem_majflt_counter = procs[i].p_uru_majflt;
+
-+ pse.cpu_user = 0;
-+ pse.cpu_system = 0;
+ pse.cpu_user_counter = 0;
+ pse.cpu_system_counter = 0;
+ /* context switch counters not implemented */
Home |
Main Index |
Thread Index |
Old Index