pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/sysutils/collectd
Module Name: pkgsrc
Committed By: joerg
Date: Tue Feb 14 21:23:13 UTC 2017
Modified Files:
pkgsrc/sysutils/collectd: distinfo
pkgsrc/sysutils/collectd/patches: patch-src_entropy.c
patch-src_processes.c
Log Message:
Try to deal with API changes for the NetBSD port.
To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 pkgsrc/sysutils/collectd/distinfo
cvs rdiff -u -r1.8 -r1.9 pkgsrc/sysutils/collectd/patches/patch-src_entropy.c
cvs rdiff -u -r1.5 -r1.6 \
pkgsrc/sysutils/collectd/patches/patch-src_processes.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/sysutils/collectd/distinfo
diff -u pkgsrc/sysutils/collectd/distinfo:1.33 pkgsrc/sysutils/collectd/distinfo:1.34
--- pkgsrc/sysutils/collectd/distinfo:1.33 Wed Jan 25 14:10:18 2017
+++ pkgsrc/sysutils/collectd/distinfo Tue Feb 14 21:23:13 2017
@@ -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_cpu.c) = e645ae6b05c051c
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
Index: pkgsrc/sysutils/collectd/patches/patch-src_entropy.c
diff -u pkgsrc/sysutils/collectd/patches/patch-src_entropy.c:1.8 pkgsrc/sysutils/collectd/patches/patch-src_entropy.c:1.9
--- pkgsrc/sysutils/collectd/patches/patch-src_entropy.c:1.8 Wed Jan 25 14:10:18 2017
+++ pkgsrc/sysutils/collectd/patches/patch-src_entropy.c Tue Feb 14 21:23:13 2017
@@ -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 @@ needlessly reduce the kernel's entropy e
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 @@ needlessly reduce the kernel's entropy e
+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 @@ needlessly reduce the kernel's entropy e
+ 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;
+}
Index: pkgsrc/sysutils/collectd/patches/patch-src_processes.c
diff -u pkgsrc/sysutils/collectd/patches/patch-src_processes.c:1.5 pkgsrc/sysutils/collectd/patches/patch-src_processes.c:1.6
--- pkgsrc/sysutils/collectd/patches/patch-src_processes.c:1.5 Thu Jan 19 17:20:42 2017
+++ pkgsrc/sysutils/collectd/patches/patch-src_processes.c Tue Feb 14 21:23:13 2017
@@ -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 @@ Add a port to NetBSD.
#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 @@ Add a port to NetBSD.
#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 @@ Add a port to NetBSD.
#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 @@ Add a port to NetBSD.
+ 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