aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorwg <wg@FreeBSD.org>2013-09-13 00:09:14 +0800
committerwg <wg@FreeBSD.org>2013-09-13 00:09:14 +0800
commitf1fa0627f1a9a4b9e1d85add707a63e71e648f0c (patch)
tree1f977107c39591245a609437736df2aa817d46b7 /sysutils
parent1fa50e5fb45cb0f742285dab7d1b58aef9761f3d (diff)
downloadfreebsd-ports-gnome-f1fa0627f1a9a4b9e1d85add707a63e71e648f0c.tar.gz
freebsd-ports-gnome-f1fa0627f1a9a4b9e1d85add707a63e71e648f0c.tar.zst
freebsd-ports-gnome-f1fa0627f1a9a4b9e1d85add707a63e71e648f0c.zip
sysutils/xfce4-diskperf-plugin: Graphical representation of the disk IO
Panel plugin to display a graphical representation of the disks IO. WWW: http://goodies.xfce.org/projects/panel-plugins/xfce4-diskperf-plugin/ PR: ports/182042 Submitted by: Danilo EgĂȘa Gondolfo <danilogondolfo gmail.com>
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/xfce4-diskperf-plugin/Makefile36
-rw-r--r--sysutils/xfce4-diskperf-plugin/distinfo2
-rw-r--r--sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__devperf.c97
-rw-r--r--sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__main.c75
-rw-r--r--sysutils/xfce4-diskperf-plugin/pkg-descr3
-rw-r--r--sysutils/xfce4-diskperf-plugin/pkg-plist53
7 files changed, 267 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index dfed9bb9b304..46859fe75528 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -1018,6 +1018,7 @@
SUBDIR += xfburn
SUBDIR += xfce4-battery-plugin
SUBDIR += xfce4-cpugraph-plugin
+ SUBDIR += xfce4-diskperf-plugin
SUBDIR += xfce4-fsguard-plugin
SUBDIR += xfce4-genmon-plugin
SUBDIR += xfce4-minicmd-plugin
diff --git a/sysutils/xfce4-diskperf-plugin/Makefile b/sysutils/xfce4-diskperf-plugin/Makefile
new file mode 100644
index 000000000000..36aa70e9aeac
--- /dev/null
+++ b/sysutils/xfce4-diskperf-plugin/Makefile
@@ -0,0 +1,36 @@
+# Created by: Danilo Egea Gondolfo <danilogondolfo@gmail.com>
+# $FreeBSD$
+
+PORTNAME= xfce4-diskperf-plugin
+PORTVERSION= 2.5.4
+CATEGORIES= sysutils xfce
+MASTER_SITES= ${MASTER_SITE_XFCE}
+MASTER_SITE_SUBDIR= src/panel-plugins/${PORTNAME}/${PORTVERSION:R}
+DIST_SUBDIR= xfce4
+
+MAINTAINER= danilogondolfo@gmail.com
+COMMENT= Graphical representation of the disk IO
+
+GNU_CONFIGURE= yes
+INSTALLS_ICONS= yes
+USE_BZIP2= yes
+USE_GNOME= gtk20 intltool intlhack
+USE_XFCE= configenv libmenu panel
+USES= gmake pkgconfig
+
+LDFLAGS+= -ldevstat
+
+OPTIONS_DEFINE= NLS
+OPTIONS_SUB= yes
+NLS_CONFIGURE_ENABLE= nls
+NLS_USES= gettext
+
+.include <bsd.port.options.mk>
+
+post-patch:
+.if empty(PORT_OPTIONS:MNLS)
+ @${REINPLACE_CMD} -e 's|[[:blank:]]po||' \
+ -e 's|po$$||' ${WRKSRC}/Makefile.in
+.endif
+
+.include <bsd.port.mk>
diff --git a/sysutils/xfce4-diskperf-plugin/distinfo b/sysutils/xfce4-diskperf-plugin/distinfo
new file mode 100644
index 000000000000..11fceb87aee4
--- /dev/null
+++ b/sysutils/xfce4-diskperf-plugin/distinfo
@@ -0,0 +1,2 @@
+SHA256 (xfce4/xfce4-diskperf-plugin-2.5.4.tar.bz2) = aab6b9c4e2f78620920efac6874c4edf426f05b63b94cfda0da8c99a91110a0b
+SIZE (xfce4/xfce4-diskperf-plugin-2.5.4.tar.bz2) = 321974
diff --git a/sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__devperf.c b/sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__devperf.c
new file mode 100644
index 000000000000..dc919e92a409
--- /dev/null
+++ b/sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__devperf.c
@@ -0,0 +1,97 @@
+--- ./panel-plugin/devperf.c.orig 2012-04-03 10:22:41.000000000 -0300
++++ ./panel-plugin/devperf.c 2013-09-11 17:45:00.000000000 -0300
+@@ -225,6 +225,94 @@
+
+ /************************** 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
++
++int DevPerfInit ()
++{
++ 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 statinfo stats;
++ struct devinfo dinfo;
++ struct devstat dev;
++ kvm_t *kd = NULL;
++ int i, found = 0;
++ char *check_dev = (char *) p_pvDevice;
++
++ memset(&stats, 0, sizeof(stats));
++ memset(&dinfo, 0, sizeof(dinfo));
++ stats.dinfo = &dinfo;
++
++ 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__)
+ /**************************************************************/
diff --git a/sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__main.c b/sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__main.c
new file mode 100644
index 000000000000..f02368c53b8d
--- /dev/null
+++ b/sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__main.c
@@ -0,0 +1,75 @@
+--- ./panel-plugin/main.c.orig 2012-06-23 05:02:16.000000000 -0300
++++ ./panel-plugin/main.c 2013-09-11 17:44:45.000000000 -0300
+@@ -86,7 +86,7 @@
+ typedef struct param_t {
+ /* Configurable parameters */
+ char acDevice[64];
+-#if !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__sun__)
++#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__sun__)
+ dev_t st_rdev;
+ #endif
+ int fTitleDisplayed;
+@@ -172,7 +172,7 @@
+ struct param_t *poConf = &(p_poPlugin->oConf.oParam);
+ struct monitor_t *poMonitor = &(p_poPlugin->oMonitor);
+ struct perfbar_t *poPerf = poMonitor->aoPerfBar;
+-#if !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__sun__)
++#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__sun__)
+ struct stat oStat;
+ #endif
+ uint64_t iInterval_ns, rbytes, wbytes, iRBusy_ns, iWBusy_ns;
+@@ -185,7 +185,7 @@
+ rbytes = wbytes = iRBusy_ns = iWBusy_ns = -1;
+ memset (&oPerf, 0, sizeof (oPerf));
+ oPerf.qlen = -1;
+-#if defined (__NetBSD__) || defined(__OpenBSD__) || defined(__sun__)
++#if defined(__FreeBSD__) || defined (__NetBSD__) || defined(__OpenBSD__) || defined(__sun__)
+ status = DevGetPerfData (poConf->acDevice, &oPerf);
+ #else
+ if (poConf->st_rdev == 0)
+@@ -429,7 +429,7 @@
+ struct diskperf_t *poPlugin;
+ struct param_t *poConf;
+ struct monitor_t *poMonitor;
+-#if !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__sun__)
++#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__sun__)
+ struct stat oStat;
+ int status;
+ #endif
+@@ -444,6 +444,9 @@
+ #if defined(__NetBSD__) || defined(__OpenBSD__)
+ strncpy (poConf->acDevice, "wd0", 64);
+ strncpy (poConf->acTitle, "wd0", 16);
++#elif defined(__FreeBSD__)
++ strncpy (poConf->acDevice, "ada0", 64);
++ strncpy (poConf->acTitle, "ada0", 16);
+ #elif defined(__sun__)
+ strncpy (poConf->acDevice, "sd0", 64);
+ strncpy (poConf->acTitle, "sd0", 16);
+@@ -517,7 +520,7 @@
+ struct param_t *poConf = &(poPlugin->oConf.oParam);
+ struct monitor_t *poMonitor = &(poPlugin->oMonitor);
+ Widget_t *pw2ndBar = poPlugin->oMonitor.awProgressBar + 1;
+-#if !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__sun__)
++#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__sun__)
+ struct stat oStat;
+ int status;
+ #endif
+@@ -534,7 +537,7 @@
+ if ((value = xfce_rc_read_entry (rc, (CONF_DEVICE), NULL))) {
+ memset (poConf->acDevice, 0, sizeof (poConf->acDevice));
+ strncpy (poConf->acDevice, value, sizeof (poConf->acDevice) - 1);
+-#if !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__sun__)
++#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__sun__)
+ status = stat (poConf->acDevice, &oStat);
+ poConf->st_rdev = (status == -1 ? 0 : oStat.st_rdev);
+ #endif
+@@ -666,7 +669,7 @@
+ struct diskperf_t *poPlugin = (diskperf_t *) p_pvPlugin;
+ struct param_t *poConf = &(poPlugin->oConf.oParam);
+ const char *pcDevice = gtk_entry_get_text (GTK_ENTRY (p_wTF));
+-#if !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__sun__)
++#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__sun__)
+ struct stat oStat;
+ int status;
+
diff --git a/sysutils/xfce4-diskperf-plugin/pkg-descr b/sysutils/xfce4-diskperf-plugin/pkg-descr
new file mode 100644
index 000000000000..4420aa6c3907
--- /dev/null
+++ b/sysutils/xfce4-diskperf-plugin/pkg-descr
@@ -0,0 +1,3 @@
+Panel plugin to display a graphical representation of the disks IO.
+
+WWW: http://goodies.xfce.org/projects/panel-plugins/xfce4-diskperf-plugin/
diff --git a/sysutils/xfce4-diskperf-plugin/pkg-plist b/sysutils/xfce4-diskperf-plugin/pkg-plist
new file mode 100644
index 000000000000..3d50f125f2f6
--- /dev/null
+++ b/sysutils/xfce4-diskperf-plugin/pkg-plist
@@ -0,0 +1,53 @@
+lib/xfce4/panel/plugins/libdiskperf.so
+lib/xfce4/panel/plugins/libdiskperf.la
+%%NLS%%share/locale/ar/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/ast/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/ca/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/cs/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/da/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/de/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/el/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/en_GB/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/es/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/eu/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/fr/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/gl/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/hu/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/id/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/it/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/ja/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/ko/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/lt/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/lv/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/nb/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/nl/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/pa/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/pl/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/pt/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/pt_BR/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/ru/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/sk/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/sq/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/sv/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/tr/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/ug/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/uk/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/ur/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/ur_PK/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/zh_CN/LC_MESSAGES/xfce4-diskperf-plugin.mo
+%%NLS%%share/locale/zh_TW/LC_MESSAGES/xfce4-diskperf-plugin.mo
+share/xfce4/panel/plugins/diskperf.desktop
+%%NLS%%@dirrmtry share/locale/ur_PK/LC_MESSAGES
+%%NLS%%@dirrmtry share/locale/ur_PK
+%%NLS%%@dirrmtry share/locale/ur/LC_MESSAGES
+%%NLS%%@dirrmtry share/locale/ur
+%%NLS%%@dirrmtry share/locale/ug/LC_MESSAGES
+%%NLS%%@dirrmtry share/locale/ug
+%%NLS%%@dirrmtry share/locale/ast/LC_MESSAGES
+%%NLS%%@dirrmtry share/locale/ast
+@dirrmtry share/xfce4/panel/plugins
+@dirrmtry share/xfce4/panel
+@dirrmtry share/xfce4
+@dirrmtry lib/xfce4/panel/plugins
+@dirrmtry lib/xfce4/panel
+@dirrmtry lib/xfce4