Import of pkgsrc-2015Q3

This commit is contained in:
2015-10-03 03:37:01 -07:00
committed by Lionel Sambuc
parent f641581404
commit 9d819b6d54
7578 changed files with 228314 additions and 80018 deletions

View File

@@ -1,9 +1,8 @@
# $NetBSD: Makefile,v 1.40 2015/04/25 14:24:55 tnn Exp $
# $NetBSD: Makefile,v 1.41 2015/06/29 11:16:48 youri Exp $
PKGREVISION= 1
.include "../../meta-pkgs/xfce4/Makefile.common"
DISTNAME= xfce4-diskperf-plugin-2.5.4
DISTNAME= xfce4-diskperf-plugin-2.5.5
CATEGORIES= sysutils
MASTER_SITES= http://archive.xfce.org/src/panel-plugins/xfce4-diskperf-plugin/2.5/

View File

@@ -1,17 +1,20 @@
@comment $NetBSD: PLIST,v 1.4 2015/04/21 08:56:40 jperkin Exp $
@comment $NetBSD: PLIST,v 1.5 2015/06/29 11:16:48 youri Exp $
lib/xfce4/panel/plugins/libdiskperf.la
share/locale/ar/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/ast/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/bg/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/ca/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/cs/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/da/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/de/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/el/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/en_AU/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/en_GB/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/es/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/eu/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/fr/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/gl/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/hr/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/hu/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/id/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/it/LC_MESSAGES/xfce4-diskperf-plugin.mo
@@ -19,8 +22,10 @@ share/locale/ja/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/ko/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/lt/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/lv/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/ms/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/nb/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/nl/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/oc/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/pa/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/pl/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/pt/LC_MESSAGES/xfce4-diskperf-plugin.mo
@@ -28,7 +33,9 @@ share/locale/pt_BR/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/ru/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/sk/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/sq/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/sr/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/sv/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/th/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/tr/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/ug/LC_MESSAGES/xfce4-diskperf-plugin.mo
share/locale/uk/LC_MESSAGES/xfce4-diskperf-plugin.mo

View File

@@ -1,6 +1,6 @@
$NetBSD: distinfo,v 1.7 2015/04/21 08:56:40 jperkin Exp $
$NetBSD: distinfo,v 1.8 2015/06/29 11:16:48 youri Exp $
SHA1 (xfce4-diskperf-plugin-2.5.4.tar.bz2) = fc74484b986eac9d98b050c5a98130e8a9671048
RMD160 (xfce4-diskperf-plugin-2.5.4.tar.bz2) = 18d7be932d15bbec28810b822386df6a00285ae5
Size (xfce4-diskperf-plugin-2.5.4.tar.bz2) = 321974 bytes
SHA1 (patch-panel-plugin_devperf.c) = 77c02a425cf525607bacb9b55d0238eb5b110067
SHA1 (xfce4-diskperf-plugin-2.5.5.tar.bz2) = 67c5d49f01ab21acae2ec4e4474d8f29f2ac6191
RMD160 (xfce4-diskperf-plugin-2.5.5.tar.bz2) = b713cda267658405f9398d77e27a2e03e8493fb1
Size (xfce4-diskperf-plugin-2.5.5.tar.bz2) = 321446 bytes
SHA1 (patch-panel-plugin_devperf.c) = 05a0ad3cbc273150d1665d4b796b68ad16423863

View File

@@ -1,103 +1,9 @@
$NetBSD: patch-panel-plugin_devperf.c,v 1.1 2015/04/21 08:56:40 jperkin Exp $
$NetBSD: patch-panel-plugin_devperf.c,v 1.2 2015/06/29 11:16:48 youri Exp $
Add FreeBSD support and fix NetBSD support.
--- panel-plugin/devperf.c.orig 2015-02-09 23:25:33.000000000 +0000
Fix NetBSD support.
--- panel-plugin/devperf.c.orig 2014-09-11 13:45:46.000000000 +0000
+++ panel-plugin/devperf.c
@@ -225,6 +225,93 @@ int main ()
/************************** Linux End ***************/
+#elif defined(__FreeBSD__)
+
+#include <sys/disk.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <sys/types.h>
+#include <sys/errno.h>
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <devstat.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <string.h>
+#include <syslog.h>
+#include <stdarg.h>
+
+#define MAXNAMELEN 256
+
+struct statinfo stats;
+struct devinfo dinfo;
+
+int DevPerfInit ()
+{
+ stats.dinfo = &dinfo;
+
+ return (0);
+}
+
+int DevCheckStatAvailability(char const **strptr)
+{
+ return (0);
+}
+
+int DevGetPerfData (const void *p_pvDevice, struct devperf_t *perf)
+{
+ struct timeval tv;
+ struct timespec ts;
+ struct devstat dev;
+ kvm_t *kd = NULL;
+ int i, found = 0;
+ char *check_dev = (char *) p_pvDevice;
+
+ if(devstat_getdevs(kd, &stats) == -1) {
+ syslog(0, "DISKPERF: getdevs fail");
+ }
+
+ for(found = 0, i = 0; i < (stats.dinfo)->numdevs; i++) {
+ char dev_name[MAXNAMELEN];
+ dev = (stats.dinfo)->devices[i];
+ snprintf(dev_name, MAXNAMELEN-1, "%s%d",
+ dev.device_name, dev.unit_number);
+ if ((check_dev != NULL) && (strcmp(check_dev, dev_name) != 0))
+ continue;
+ else {
+ found = 1;
+ break;
+ }
+
+ }
+
+ if(check_dev != NULL && found) {
+ perf->wbytes = dev.bytes[DEVSTAT_WRITE];
+ perf->rbytes = dev.bytes[DEVSTAT_READ];
+ gettimeofday (&tv, 0);
+ perf->timestamp_ns = (uint64_t)1000ull * 1000ull * 1000ull *
+ tv.tv_sec + 1000ull * tv.tv_usec;
+ perf->qlen = dev.start_count - dev.end_count;
+ // I'm not sure about rbusy and wbusy calculation
+ bintime2timespec(&dev.busy_time, &ts);
+ perf->rbusy_ns = (uint64_t) ts.tv_nsec;
+ perf->wbusy_ns = perf->rbusy_ns;
+ }
+
+ return (0);
+}
+
+#if 0 /* Standalone test purpose */
+int main ()
+{
+ struct devperf_t oPerf;
+ DevGetPerfData ((void*)"ada0", &oPerf);
+ printf ("%lu\t%lu\n", oPerf.rbytes, oPerf.wbytes);
+ return (0);
+}
+#endif
+
+
#elif defined(__NetBSD__)
/**************************************************************/
@@ -251,21 +338,39 @@ int DevGetPerfData (const void *p_pvDevi
@@ -335,21 +335,39 @@ int DevGetPerfData (const void *p_pvDevi
const char *device = (const char *) p_pvDevice;
struct timeval tv;
size_t size, i, ndrives;
@@ -137,7 +43,7 @@ Add FreeBSD support and fix NetBSD support.
drive = drives[i];
break;
}
@@ -279,13 +384,18 @@ int DevGetPerfData (const void *p_pvDevi
@@ -363,13 +381,18 @@ int DevGetPerfData (const void *p_pvDevi
gettimeofday (&tv, 0);
perf->timestamp_ns = (uint64_t)1000ull * 1000ull * 1000ull *
tv.tv_sec + 1000ull * tv.tv_usec;
@@ -158,7 +64,7 @@ Add FreeBSD support and fix NetBSD support.
#endif
/*
@@ -293,10 +403,18 @@ int DevGetPerfData (const void *p_pvDevi
@@ -377,10 +400,18 @@ int DevGetPerfData (const void *p_pvDevi
* time separatly.
* -- Benedikt
*/