Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Sep 2013 16:09:15 +0000 (UTC)
From:      William Grzybowski <wg@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r327084 - in head/sysutils: . xfce4-diskperf-plugin xfce4-diskperf-plugin/files
Message-ID:  <201309121609.r8CG9FDp033725@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: wg
Date: Thu Sep 12 16:09:14 2013
New Revision: 327084
URL: http://svnweb.freebsd.org/changeset/ports/327084

Log:
  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>

Added:
  head/sysutils/xfce4-diskperf-plugin/
  head/sysutils/xfce4-diskperf-plugin/Makefile   (contents, props changed)
  head/sysutils/xfce4-diskperf-plugin/distinfo   (contents, props changed)
  head/sysutils/xfce4-diskperf-plugin/files/
  head/sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__devperf.c   (contents, props changed)
  head/sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__main.c   (contents, props changed)
  head/sysutils/xfce4-diskperf-plugin/pkg-descr   (contents, props changed)
  head/sysutils/xfce4-diskperf-plugin/pkg-plist   (contents, props changed)
Modified:
  head/sysutils/Makefile

Modified: head/sysutils/Makefile
==============================================================================
--- head/sysutils/Makefile	Thu Sep 12 16:07:01 2013	(r327083)
+++ head/sysutils/Makefile	Thu Sep 12 16:09:14 2013	(r327084)
@@ -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

Added: head/sysutils/xfce4-diskperf-plugin/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/xfce4-diskperf-plugin/Makefile	Thu Sep 12 16:09:14 2013	(r327084)
@@ -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>

Added: head/sysutils/xfce4-diskperf-plugin/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/xfce4-diskperf-plugin/distinfo	Thu Sep 12 16:09:14 2013	(r327084)
@@ -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

Added: head/sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__devperf.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__devperf.c	Thu Sep 12 16:09:14 2013	(r327084)
@@ -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__)
+ 	/**************************************************************/

Added: head/sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__main.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/xfce4-diskperf-plugin/files/patch-panel-plugin__main.c	Thu Sep 12 16:09:14 2013	(r327084)
@@ -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;
+ 

Added: head/sysutils/xfce4-diskperf-plugin/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/xfce4-diskperf-plugin/pkg-descr	Thu Sep 12 16:09:14 2013	(r327084)
@@ -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/

Added: head/sysutils/xfce4-diskperf-plugin/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/xfce4-diskperf-plugin/pkg-plist	Thu Sep 12 16:09:14 2013	(r327084)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309121609.r8CG9FDp033725>